| OLD | NEW |
| 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 "chrome/browser/themes/theme_service.h" | 5 #include "chrome/browser/themes/theme_service.h" |
| 6 | 6 |
| 7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
| 8 #include "chrome/browser/extensions/extension_service_unittest.h" | 8 #include "chrome/browser/extensions/extension_service_unittest.h" |
| 9 #include "chrome/browser/themes/theme_service_factory.h" | 9 #include "chrome/browser/themes/theme_service_factory.h" |
| 10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 std::string error; | 28 std::string error; |
| 29 scoped_refptr<extensions::Extension> extension = | 29 scoped_refptr<extensions::Extension> extension = |
| 30 extensions::Extension::Create( | 30 extensions::Extension::Create( |
| 31 path, extensions::Manifest::EXTERNAL_PREF_DOWNLOAD, | 31 path, extensions::Manifest::EXTERNAL_PREF_DOWNLOAD, |
| 32 source, extensions::Extension::NO_FLAGS, &error); | 32 source, extensions::Extension::NO_FLAGS, &error); |
| 33 EXPECT_TRUE(extension); | 33 EXPECT_TRUE(extension); |
| 34 EXPECT_EQ("", error); | 34 EXPECT_EQ("", error); |
| 35 return extension; | 35 return extension; |
| 36 } | 36 } |
| 37 | 37 |
| 38 void SetUp() { | 38 virtual void SetUp() { |
| 39 InitializeEmptyExtensionService(); | 39 InitializeEmptyExtensionService(); |
| 40 } | 40 } |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 TEST_F(ThemeServiceTest, AlignmentConversion) { | 43 TEST_F(ThemeServiceTest, AlignmentConversion) { |
| 44 // Verify that we get out what we put in. | 44 // Verify that we get out what we put in. |
| 45 std::string top_left = "left top"; | 45 std::string top_left = "left top"; |
| 46 int alignment = ThemeService::StringToAlignment(top_left); | 46 int alignment = ThemeService::StringToAlignment(top_left); |
| 47 EXPECT_EQ(ThemeService::ALIGN_TOP | ThemeService::ALIGN_LEFT, | 47 EXPECT_EQ(ThemeService::ALIGN_TOP | ThemeService::ALIGN_LEFT, |
| 48 alignment); | 48 alignment); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 EXPECT_FALSE(theme_service->UsingDefaultTheme()); | 122 EXPECT_FALSE(theme_service->UsingDefaultTheme()); |
| 123 EXPECT_EQ(extension->id(), theme_service->GetThemeID()); | 123 EXPECT_EQ(extension->id(), theme_service->GetThemeID()); |
| 124 | 124 |
| 125 // Now unload the extension, should revert to the default theme. | 125 // Now unload the extension, should revert to the default theme. |
| 126 service_->UnloadExtension(extension->id(), | 126 service_->UnloadExtension(extension->id(), |
| 127 extension_misc::UNLOAD_REASON_UPDATE); | 127 extension_misc::UNLOAD_REASON_UPDATE); |
| 128 EXPECT_FALSE(theme_service->UsingDefaultTheme()); | 128 EXPECT_FALSE(theme_service->UsingDefaultTheme()); |
| 129 } | 129 } |
| 130 | 130 |
| 131 }; // namespace | 131 }; // namespace |
| OLD | NEW |