Lines Matching refs:trial
53 void OnFieldTrialGroupFinalized(const std::string& trial, in OnFieldTrialGroupFinalized() argument
55 trial_name_ = trial; in OnFieldTrialGroupFinalized()
147 scoped_refptr<FieldTrial> trial; in TEST_F() local
152 trial = CreateFieldTrial(name, 10, winner, &default_group_number); in TEST_F()
153 trial->AppendGroup(loser, 5); // 50% chance of not being chosen. in TEST_F()
155 } while (trial->group_ != FieldTrial::kNotFinalized); in TEST_F()
158 EXPECT_EQ(default_group_number, trial->group()); in TEST_F()
161 EXPECT_EQ(winner, trial->group_name()); in TEST_F()
176 scoped_refptr<FieldTrial> trial = in TEST_F() local
178 trial->AppendGroup("first", 1); // 50% chance of being chosen. in TEST_F()
180 if (trial->group_ != FieldTrial::kNotFinalized) { in TEST_F()
184 trial->AppendGroup("second", 1); // Always chosen at this point. in TEST_F()
185 EXPECT_NE(FieldTrial::kNotFinalized, trial->group()); in TEST_F()
201 scoped_refptr<FieldTrial> trial = in TEST_F() local
203 int might_win = trial->AppendGroup("MightWin", 5); in TEST_F()
205 if (trial->group() == might_win) { in TEST_F()
225 scoped_refptr<FieldTrial> trial = in TEST_F() local
231 int might_win = trial->AppendGroup(std::string(), 1); in TEST_F()
235 if (trial->group_ == might_win) { in TEST_F()
239 EXPECT_EQ(winner_name, trial->group_name()); in TEST_F()
245 EXPECT_NE(trial->group(), default_group_number); in TEST_F()
246 EXPECT_EQ(trial->group(), winner_index); in TEST_F()
247 EXPECT_EQ(trial->group_name(), winner_name); in TEST_F()
257 FieldTrial* trial = FieldTrialList::FactoryGetFieldTrial( in TEST_F() local
261 trial->AppendGroup(loser, 999999999); // 99.9999999% chance of being chosen. in TEST_F()
264 EXPECT_EQ(default_group_number, trial->group()); in TEST_F()
267 EXPECT_EQ(default_group_name, trial->group_name()); in TEST_F()
272 scoped_refptr<FieldTrial> trial = in TEST_F() local
277 EXPECT_FALSE(trial->GetActiveGroup(&active_group)); in TEST_F()
281 trial = CreateFieldTrial(one_winner, 10, "Default", NULL); in TEST_F()
283 trial->AppendGroup(winner, 10); in TEST_F()
284 EXPECT_FALSE(trial->GetActiveGroup(&active_group)); in TEST_F()
286 trial->group(); in TEST_F()
287 EXPECT_TRUE(trial->GetActiveGroup(&active_group)); in TEST_F()
333 scoped_refptr<FieldTrial> trial = in TEST_F() local
336 trial->AppendGroup(winner, 10); in TEST_F()
337 EXPECT_TRUE(trial->GetState(&field_trial_state)); in TEST_F()
340 trial->group(); in TEST_F()
341 EXPECT_TRUE(trial->GetState(&field_trial_state)); in TEST_F()
365 scoped_refptr<FieldTrial> trial = in TEST_F() local
367 const int secondary_group = trial->AppendGroup(kSecondaryGroupName, 50); in TEST_F()
371 EXPECT_FALSE(trial->GetActiveGroup(&active_group)); in TEST_F()
379 const int chosen_group = trial->group(); in TEST_F()
382 EXPECT_TRUE(trial->GetActiveGroup(&active_group)); in TEST_F()
400 scoped_refptr<FieldTrial> trial = in TEST_F() local
402 trial->AppendGroup(kSecondaryGroupName, 50); in TEST_F()
408 std::string group_name = trial->GetGroupNameWithoutActivation(); in TEST_F()
413 EXPECT_EQ(group_name, trial->group_name()); in TEST_F()
420 scoped_refptr<FieldTrial> trial = in TEST_F() local
424 EXPECT_EQ("", trial->group_name_internal()); in TEST_F()
430 trial->AppendGroup("Winner", 10); in TEST_F()
432 trial->group(); in TEST_F()
462 scoped_refptr<FieldTrial> trial = in TEST_F() local
464 EXPECT_EQ("", trial->group_name_internal()); in TEST_F()
468 EXPECT_EQ("Default some name", trial->group_name_internal()); in TEST_F()
472 trial = CreateFieldTrial("trial2", 10, "Default some name", nullptr); in TEST_F()
473 trial->AppendGroup("Winner", 10); in TEST_F()
475 trial->group(); in TEST_F()
510 FieldTrial* trial = FieldTrialList::Find("Some_name"); in TEST_F() local
511 ASSERT_NE(static_cast<FieldTrial*>(NULL), trial); in TEST_F()
512 EXPECT_EQ("Winner", trial->group_name()); in TEST_F()
513 EXPECT_EQ("Some_name", trial->trial_name()); in TEST_F()
515 trial = FieldTrialList::Find("xxx"); in TEST_F()
516 ASSERT_NE(static_cast<FieldTrial*>(NULL), trial); in TEST_F()
517 EXPECT_EQ("yyyy", trial->group_name()); in TEST_F()
518 EXPECT_EQ("xxx", trial->trial_name()); in TEST_F()
526 FieldTrial* trial = FieldTrialList::Find("tname"); in TEST_F() local
527 ASSERT_NE(static_cast<FieldTrial*>(NULL), trial); in TEST_F()
528 EXPECT_EQ("gname", trial->group_name()); in TEST_F()
529 EXPECT_EQ("tname", trial->trial_name()); in TEST_F()
551 scoped_refptr<FieldTrial> trial = in TEST_F() local
553 trial->AppendGroup("Winner", 10); in TEST_F()
555 trial->group(); in TEST_F()
689 FieldTrial* trial = FieldTrialList::Find("Foo"); in TEST_F() local
690 ASSERT_NE(static_cast<FieldTrial*>(NULL), trial); in TEST_F()
691 EXPECT_EQ("Foo", trial->trial_name()); in TEST_F()
692 EXPECT_EQ("Foo_name", trial->group_name()); in TEST_F()
694 trial = FieldTrialList::Find("Bar"); in TEST_F()
695 ASSERT_NE(static_cast<FieldTrial*>(NULL), trial); in TEST_F()
696 EXPECT_EQ("Bar", trial->trial_name()); in TEST_F()
697 EXPECT_EQ("Bar_name", trial->group_name()); in TEST_F()
705 FieldTrial* trial = FieldTrialList::Find("Some_name"); in TEST_F() local
706 ASSERT_NE(static_cast<FieldTrial*>(NULL), trial); in TEST_F()
707 EXPECT_EQ("Winner", trial->group_name()); in TEST_F()
708 EXPECT_EQ("Some_name", trial->trial_name()); in TEST_F()
723 scoped_refptr<FieldTrial> trial = in TEST_F() local
725 trial->AppendGroup("Winner", 10); in TEST_F()
738 scoped_refptr<FieldTrial> trial = in TEST_F() local
740 trial->Disable(); in TEST_F()
741 ASSERT_EQ("default", trial->group_name()); in TEST_F()
742 ASSERT_EQ(default_group_number, trial->group()); in TEST_F()
746 scoped_refptr<FieldTrial> trial = in TEST_F() local
748 trial->AppendGroup("non_default", 100); in TEST_F()
749 trial->Disable(); in TEST_F()
750 ASSERT_EQ("default", trial->group_name()); in TEST_F()
833 scoped_refptr<FieldTrial> trial = in TEST_F() local
835 trial->SetForced(); in TEST_F()
837 trial = CreateFieldTrial(kTrialName, 100, kDefaultGroupName, NULL); in TEST_F()
838 EXPECT_EQ(default_group, trial->group()); in TEST_F()
839 EXPECT_EQ(kDefaultGroupName, trial->group_name()); in TEST_F()
847 scoped_refptr<FieldTrial> trial = in TEST_F() local
849 trial->SetForced(); in TEST_F()
851 trial = CreateFieldTrial(kTrialName, 100, kDefaultGroupName, NULL); in TEST_F()
852 const int extra_group = trial->AppendGroup("Extra", 100); in TEST_F()
853 EXPECT_EQ(default_group, trial->group()); in TEST_F()
854 EXPECT_NE(extra_group, trial->group()); in TEST_F()
855 EXPECT_EQ(kDefaultGroupName, trial->group_name()); in TEST_F()
962 scoped_refptr<FieldTrial> trial = in TEST_F() local
964 const int secondary_group = trial->AppendGroup(kSecondaryGroupName, 50); in TEST_F()
965 const int chosen_group = trial->group(); in TEST_F()
981 scoped_refptr<FieldTrial> trial = in TEST_F() local
983 trial->AppendGroup("A", 25); in TEST_F()
984 trial->AppendGroup("B", 25); in TEST_F()
985 trial->AppendGroup("C", 25); in TEST_F()
986 trial->Disable(); in TEST_F()
994 EXPECT_EQ(default_group, trial->group()); in TEST_F()
1005 scoped_refptr<FieldTrial> trial = in TEST_F() local
1007 trial->AppendGroup("A", 25); in TEST_F()
1008 trial->AppendGroup("B", 25); in TEST_F()
1009 trial->AppendGroup("C", 25); in TEST_F()
1010 trial->SetForced(); in TEST_F()
1011 trial->Disable(); in TEST_F()
1019 EXPECT_EQ(default_group, trial->group()); in TEST_F()
1029 scoped_refptr<FieldTrial> trial = in TEST_F() local
1031 trial->AppendGroup("X", 50); in TEST_F()
1032 trial->Disable(); in TEST_F()
1051 scoped_refptr<FieldTrial> trial = in TEST_F() local
1053 trial->AppendGroup(kGroupName, kProbability); in TEST_F()
1054 EXPECT_EQ(kGroupName, trial->group_name()); in TEST_F()
1064 scoped_refptr<base::FieldTrial> trial( in TEST_F() local
1067 trial->AppendGroup(base::IntToString(j), 1); in TEST_F()
1069 EXPECT_EQ(base::IntToString(i), trial->group_name()); in TEST_F()
1077 scoped_refptr<base::FieldTrial> trial( in TEST_F() local
1079 trial->AppendGroup("1", 1); in TEST_F()
1080 trial->AppendGroup("2", 1); in TEST_F()
1082 EXPECT_EQ("2", trial->group_name()); in TEST_F()
1101 scoped_refptr<FieldTrial> trial( in TEST_F() local
1104 trial->AppendGroup("A", 80); in TEST_F()
1105 trial->AppendGroup("B", 10); in TEST_F()
1106 EXPECT_EQ(test_cases[i].expected_group, trial->group_name()); in TEST_F()
1135 scoped_refptr<FieldTrial> trial = in TEST() local
1137 trial->AppendGroup("cba", 10); in TEST()
1138 trial->group(); in TEST()