| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/about_flags.h" | 5 #include "chrome/browser/about_flags.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
| 9 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
| 10 #include "chrome/test/testing_pref_service.h" | 10 #include "chrome/test/testing_pref_service.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 IDS_PRODUCT_NAME, | 45 IDS_PRODUCT_NAME, |
| 46 0, // This ends up enabling for an OS other than the current. | 46 0, // This ends up enabling for an OS other than the current. |
| 47 kSwitch3 | 47 kSwitch3 |
| 48 }, | 48 }, |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 class AboutFlagsTest : public ::testing::Test { | 51 class AboutFlagsTest : public ::testing::Test { |
| 52 protected: | 52 protected: |
| 53 AboutFlagsTest() { | 53 AboutFlagsTest() { |
| 54 prefs_.RegisterListPref(prefs::kEnabledLabsExperiments); | 54 prefs_.RegisterListPref(prefs::kEnabledLabsExperiments); |
| 55 #if defined(OS_CHROMEOS) |
| 56 prefs_.RegisterBooleanPref(prefs::kLabsMediaplayerEnabled, false); |
| 57 prefs_.RegisterBooleanPref(prefs::kLabsAdvancedFilesystemEnabled, false); |
| 58 prefs_.RegisterBooleanPref(prefs::kUseVerticalTabs, false); |
| 59 #endif |
| 55 testing::ClearState(); | 60 testing::ClearState(); |
| 56 } | 61 } |
| 57 | 62 |
| 58 virtual void SetUp() { | 63 virtual void SetUp() { |
| 59 for (size_t i = 0; i < arraysize(kExperiments); ++i) | 64 for (size_t i = 0; i < arraysize(kExperiments); ++i) |
| 60 kExperiments[i].supported_platforms = GetCurrentPlatform(); | 65 kExperiments[i].supported_platforms = GetCurrentPlatform(); |
| 61 | 66 |
| 62 int os_other_than_current = 1; | 67 int os_other_than_current = 1; |
| 63 while (os_other_than_current == GetCurrentPlatform()) | 68 while (os_other_than_current == GetCurrentPlatform()) |
| 64 os_other_than_current <<= 1; | 69 os_other_than_current <<= 1; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 EXPECT_TRUE(command_line.HasSwitch(kSwitch1)); | 189 EXPECT_TRUE(command_line.HasSwitch(kSwitch1)); |
| 185 EXPECT_FALSE(command_line.HasSwitch(kSwitch3)); | 190 EXPECT_FALSE(command_line.HasSwitch(kSwitch3)); |
| 186 | 191 |
| 187 // Experiment 3 should show still be persisted in preferences though. | 192 // Experiment 3 should show still be persisted in preferences though. |
| 188 scoped_ptr<ListValue> switch_prefs(GetFlagsExperimentsData(&prefs_)); | 193 scoped_ptr<ListValue> switch_prefs(GetFlagsExperimentsData(&prefs_)); |
| 189 ASSERT_TRUE(switch_prefs.get()); | 194 ASSERT_TRUE(switch_prefs.get()); |
| 190 EXPECT_EQ(2u, switch_prefs->GetSize()); | 195 EXPECT_EQ(2u, switch_prefs->GetSize()); |
| 191 } | 196 } |
| 192 | 197 |
| 193 } // namespace about_flags | 198 } // namespace about_flags |
| OLD | NEW |