OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/metrics/field_trial.h" | 6 #include "base/metrics/field_trial.h" |
7 #include "base/rand_util.h" | 7 #include "base/rand_util.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 FieldTrial::ActiveGroups active_groups; | 710 FieldTrial::ActiveGroups active_groups; |
711 FieldTrialList::GetActiveFieldTrialGroups(&active_groups); | 711 FieldTrialList::GetActiveFieldTrialGroups(&active_groups); |
712 EXPECT_TRUE(active_groups.empty()); | 712 EXPECT_TRUE(active_groups.empty()); |
713 | 713 |
714 // Ensure the trial is not listed in the |StatesToString()| result. | 714 // Ensure the trial is not listed in the |StatesToString()| result. |
715 std::string states; | 715 std::string states; |
716 FieldTrialList::StatesToString(&states); | 716 FieldTrialList::StatesToString(&states); |
717 EXPECT_TRUE(states.empty()); | 717 EXPECT_TRUE(states.empty()); |
718 } | 718 } |
719 | 719 |
| 720 TEST_F(FieldTrialTest, ExpirationYearNotExpired) { |
| 721 const char kTrialName[] = "NotExpired"; |
| 722 const char kGroupName[] = "Group2"; |
| 723 const int kProbability = 100; |
| 724 ASSERT_FALSE(FieldTrialList::TrialExists(kTrialName)); |
| 725 |
| 726 FieldTrial* trial = |
| 727 FieldTrialList::FactoryGetFieldTrial( |
| 728 kTrialName, kProbability, kDefaultGroupName, |
| 729 FieldTrialList::kNoExpirationYear, 1, 1, NULL); |
| 730 trial->AppendGroup(kGroupName, kProbability); |
| 731 EXPECT_EQ(kGroupName, trial->group_name()); |
| 732 } |
720 | 733 |
721 } // namespace base | 734 } // namespace base |
OLD | NEW |