Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: base/metrics/field_trial_unittest.cc

Issue 11783033: Fix problem where field trials using kExpirationYearInFuture could get disabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/metrics/field_trial.cc ('k') | chrome/browser/metrics/variations/variations_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « base/metrics/field_trial.cc ('k') | chrome/browser/metrics/variations/variations_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698