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

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

Issue 670183003: Update from chromium 62675d9fb31fb8cedc40f68e78e8445a74f362e7 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « base/metrics/field_trial.cc ('k') | base/win/metro.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/metrics/field_trial.h" 5 #include "base/metrics/field_trial.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 FieldTrialList::GetActiveFieldTrialGroups(&active_groups); 983 FieldTrialList::GetActiveFieldTrialGroups(&active_groups);
984 EXPECT_TRUE(active_groups.empty()); 984 EXPECT_TRUE(active_groups.empty());
985 985
986 // The trial shouldn't be listed in the |StatesToString()| result. 986 // The trial shouldn't be listed in the |StatesToString()| result.
987 std::string states; 987 std::string states;
988 FieldTrialList::StatesToString(&states); 988 FieldTrialList::StatesToString(&states);
989 EXPECT_TRUE(states.empty()); 989 EXPECT_TRUE(states.empty());
990 } 990 }
991 } 991 }
992 992
993 #if GTEST_HAS_DEATH_TEST
994 TEST(FieldTrialDeathTest, OneTimeRandomizedTrialWithoutFieldTrialList) {
995 // Trying to instantiate a one-time randomized field trial before the
996 // FieldTrialList is created should crash.
997 EXPECT_DEATH(FieldTrialList::FactoryGetFieldTrial(
998 "OneTimeRandomizedTrialWithoutFieldTrialList", 100, kDefaultGroupName,
999 base::FieldTrialList::kNoExpirationYear, 1, 1,
1000 base::FieldTrial::ONE_TIME_RANDOMIZED, NULL), "");
1001 }
1002 #endif
1003
993 } // namespace base 1004 } // namespace base
OLDNEW
« no previous file with comments | « base/metrics/field_trial.cc ('k') | base/win/metro.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698