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

Side by Side Diff: base/field_trial_unittest.cc

Issue 179028: Revert "Fix a ton of compiler warnings." (Closed)
Patch Set: Created 11 years, 3 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 | « app/tree_model.h ('k') | base/file_descriptor_shuffle.h » ('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) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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/field_trial.h" 7 #include "base/field_trial.h"
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 // Create a second trial and winning group. 153 // Create a second trial and winning group.
154 FieldTrial* trial2 = new FieldTrial("xxx", 10); 154 FieldTrial* trial2 = new FieldTrial("xxx", 10);
155 trial2->AppendGroup("yyyy", 10); 155 trial2->AppendGroup("yyyy", 10);
156 156
157 FieldTrialList::StatesToString(&save_string); 157 FieldTrialList::StatesToString(&save_string);
158 // We assume names are alphabetized... though this is not critical. 158 // We assume names are alphabetized... though this is not critical.
159 EXPECT_EQ(save_string, "Some name/Winner/xxx/yyyy/"); 159 EXPECT_EQ(save_string, "Some name/Winner/xxx/yyyy/");
160 } 160 }
161 161
162 TEST_F(FieldTrialTest, Restore) { 162 TEST_F(FieldTrialTest, Restore) {
163 EXPECT_TRUE(NULL == FieldTrialList::Find("Some_name")); 163 EXPECT_EQ(NULL, FieldTrialList::Find("Some_name"));
164 EXPECT_TRUE(NULL == FieldTrialList::Find("xxx")); 164 EXPECT_EQ(NULL, FieldTrialList::Find("xxx"));
165 165
166 FieldTrialList::StringAugmentsState("Some_name/Winner/xxx/yyyy/"); 166 FieldTrialList::StringAugmentsState("Some_name/Winner/xxx/yyyy/");
167 167
168 FieldTrial* trial = FieldTrialList::Find("Some_name"); 168 FieldTrial* trial = FieldTrialList::Find("Some_name");
169 ASSERT_NE(static_cast<FieldTrial*>(NULL), trial); 169 ASSERT_NE(static_cast<FieldTrial*>(NULL), trial);
170 EXPECT_EQ(trial->group_name(), "Winner"); 170 EXPECT_EQ(trial->group_name(), "Winner");
171 EXPECT_EQ(trial->name(), "Some_name"); 171 EXPECT_EQ(trial->name(), "Some_name");
172 172
173 trial = FieldTrialList::Find("xxx"); 173 trial = FieldTrialList::Find("xxx");
174 ASSERT_NE(static_cast<FieldTrial*>(NULL), trial); 174 ASSERT_NE(static_cast<FieldTrial*>(NULL), trial);
(...skipping 14 matching lines...) Expand all
189 std::string save_string; 189 std::string save_string;
190 FieldTrialList::StatesToString(&save_string); 190 FieldTrialList::StatesToString(&save_string);
191 EXPECT_EQ("Some name/Winner/", save_string); 191 EXPECT_EQ("Some name/Winner/", save_string);
192 192
193 // It is OK if we redundantly specify a winner. 193 // It is OK if we redundantly specify a winner.
194 EXPECT_TRUE(FieldTrialList::StringAugmentsState(save_string)); 194 EXPECT_TRUE(FieldTrialList::StringAugmentsState(save_string));
195 195
196 // But it is an error to try to change to a different winner. 196 // But it is an error to try to change to a different winner.
197 EXPECT_FALSE(FieldTrialList::StringAugmentsState("Some name/Loser/")); 197 EXPECT_FALSE(FieldTrialList::StringAugmentsState("Some name/Loser/"));
198 } 198 }
OLDNEW
« no previous file with comments | « app/tree_model.h ('k') | base/file_descriptor_shuffle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698