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

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

Issue 7528010: Remove Purify and Quantify (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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/message_loop.cc ('k') | base/pickle.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Test of FieldTrial class 5 // Test of FieldTrial class
6 6
7 #include "base/metrics/field_trial.h" 7 #include "base/metrics/field_trial.h"
8 8
9 #include "base/rand_util.h" 9 #include "base/rand_util.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 22 matching lines...) Expand all
33 33
34 protected: 34 protected:
35 int next_year_; 35 int next_year_;
36 int last_year_; 36 int last_year_;
37 37
38 private: 38 private:
39 FieldTrialList trial_list_; 39 FieldTrialList trial_list_;
40 }; 40 };
41 41
42 // Test registration, and also check that destructors are called for trials 42 // Test registration, and also check that destructors are called for trials
43 // (and that Purify doesn't catch us leaking). 43 // (and that Valgrind doesn't catch us leaking).
44 TEST_F(FieldTrialTest, Registration) { 44 TEST_F(FieldTrialTest, Registration) {
45 const char* name1 = "name 1 test"; 45 const char* name1 = "name 1 test";
46 const char* name2 = "name 2 test"; 46 const char* name2 = "name 2 test";
47 EXPECT_FALSE(FieldTrialList::Find(name1)); 47 EXPECT_FALSE(FieldTrialList::Find(name1));
48 EXPECT_FALSE(FieldTrialList::Find(name2)); 48 EXPECT_FALSE(FieldTrialList::Find(name2));
49 49
50 FieldTrial* trial1 = 50 FieldTrial* trial1 =
51 new FieldTrial(name1, 10, "default name 1 test", next_year_, 12, 31); 51 new FieldTrial(name1, 10, "default name 1 test", next_year_, 12, 31);
52 EXPECT_EQ(FieldTrial::kNotFinalized, trial1->group_); 52 EXPECT_EQ(FieldTrial::kNotFinalized, trial1->group_);
53 EXPECT_EQ(name1, trial1->name()); 53 EXPECT_EQ(name1, trial1->name());
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 TEST_F(FieldTrialTest, DisableAfterInitialization) { 426 TEST_F(FieldTrialTest, DisableAfterInitialization) {
427 FieldTrial* trial = 427 FieldTrial* trial =
428 new FieldTrial("trial", 100, "default", next_year_, 12, 31); 428 new FieldTrial("trial", 100, "default", next_year_, 12, 31);
429 trial->AppendGroup("non_default", 100); 429 trial->AppendGroup("non_default", 100);
430 ASSERT_EQ("non_default", trial->group_name()); 430 ASSERT_EQ("non_default", trial->group_name());
431 trial->Disable(); 431 trial->Disable();
432 ASSERT_EQ("default", trial->group_name()); 432 ASSERT_EQ("default", trial->group_name());
433 } 433 }
434 434
435 } // namespace base 435 } // namespace base
OLDNEW
« no previous file with comments | « base/message_loop.cc ('k') | base/pickle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698