OLD | NEW |
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 #include <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 }, | 285 }, |
286 }; | 286 }; |
287 | 287 |
288 class AboutFlagsTest : public ::testing::Test { | 288 class AboutFlagsTest : public ::testing::Test { |
289 protected: | 289 protected: |
290 AboutFlagsTest() : flags_storage_(&prefs_) { | 290 AboutFlagsTest() : flags_storage_(&prefs_) { |
291 prefs_.registry()->RegisterListPref(prefs::kEnabledLabsExperiments); | 291 prefs_.registry()->RegisterListPref(prefs::kEnabledLabsExperiments); |
292 testing::ClearState(); | 292 testing::ClearState(); |
293 } | 293 } |
294 | 294 |
295 virtual void SetUp() OVERRIDE { | 295 virtual void SetUp() override { |
296 for (size_t i = 0; i < arraysize(kExperiments); ++i) | 296 for (size_t i = 0; i < arraysize(kExperiments); ++i) |
297 kExperiments[i].supported_platforms = GetCurrentPlatform(); | 297 kExperiments[i].supported_platforms = GetCurrentPlatform(); |
298 | 298 |
299 int os_other_than_current = 1; | 299 int os_other_than_current = 1; |
300 while (os_other_than_current == GetCurrentPlatform()) | 300 while (os_other_than_current == GetCurrentPlatform()) |
301 os_other_than_current <<= 1; | 301 os_other_than_current <<= 1; |
302 kExperiments[2].supported_platforms = os_other_than_current; | 302 kExperiments[2].supported_platforms = os_other_than_current; |
303 | 303 |
304 testing::SetExperiments(kExperiments, arraysize(kExperiments)); | 304 testing::SetExperiments(kExperiments, arraysize(kExperiments)); |
305 } | 305 } |
306 | 306 |
307 virtual void TearDown() OVERRIDE { | 307 virtual void TearDown() override { |
308 testing::SetExperiments(NULL, 0); | 308 testing::SetExperiments(NULL, 0); |
309 } | 309 } |
310 | 310 |
311 TestingPrefServiceSimple prefs_; | 311 TestingPrefServiceSimple prefs_; |
312 PrefServiceFlagsStorage flags_storage_; | 312 PrefServiceFlagsStorage flags_storage_; |
313 }; | 313 }; |
314 | 314 |
315 | 315 |
316 TEST_F(AboutFlagsTest, NoChangeNoRestart) { | 316 TEST_F(AboutFlagsTest, NoChangeNoRestart) { |
317 EXPECT_FALSE(IsRestartNeededToCommitChanges()); | 317 EXPECT_FALSE(IsRestartNeededToCommitChanges()); |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 EXPECT_TRUE(enum_entry != histograms_xml_switches_ids.end() && | 765 EXPECT_TRUE(enum_entry != histograms_xml_switches_ids.end() && |
766 enum_entry->first == *it) | 766 enum_entry->first == *it) |
767 << "histograms.xml enum LoginCustomFlags doesn't contain switch '" | 767 << "histograms.xml enum LoginCustomFlags doesn't contain switch '" |
768 << *it << "' (value=" << uma_id | 768 << *it << "' (value=" << uma_id |
769 << " expected). Consider adding entry:\n" | 769 << " expected). Consider adding entry:\n" |
770 << " " << GetHistogramEnumEntryText(*it, uma_id); | 770 << " " << GetHistogramEnumEntryText(*it, uma_id); |
771 } | 771 } |
772 } | 772 } |
773 | 773 |
774 } // namespace about_flags | 774 } // namespace about_flags |
OLD | NEW |