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

Side by Side Diff: chrome/browser/themes/theme_service_unittest.cc

Issue 22794012: Rename extension_manifest_keys namespace to extensions::manifest_keys. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
OLDNEW
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/managed_mode/managed_user_service.h" 9 #include "chrome/browser/managed_mode/managed_user_service.h"
10 #include "chrome/browser/managed_mode/managed_user_service_factory.h" 10 #include "chrome/browser/managed_mode/managed_user_service_factory.h"
11 #include "chrome/browser/themes/custom_theme_supplier.h" 11 #include "chrome/browser/themes/custom_theme_supplier.h"
12 #include "chrome/browser/themes/theme_service_factory.h" 12 #include "chrome/browser/themes/theme_service_factory.h"
13 #include "chrome/common/extensions/extension.h" 13 #include "chrome/common/extensions/extension.h"
14 #include "chrome/common/extensions/extension_manifest_constants.h"
15 #include "chrome/common/pref_names.h" 14 #include "chrome/common/pref_names.h"
16 #include "chrome/test/base/testing_browser_process.h" 15 #include "chrome/test/base/testing_browser_process.h"
17 #include "chrome/test/base/testing_profile.h" 16 #include "chrome/test/base/testing_profile.h"
18 #include "chrome/test/base/testing_profile_manager.h" 17 #include "chrome/test/base/testing_profile_manager.h"
18 #include "extensions/common/manifest_constants.h"
19 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
20 20
21 namespace theme_service_internal { 21 namespace theme_service_internal {
22 22
23 class ThemeServiceTest : public ExtensionServiceTestBase { 23 class ThemeServiceTest : public ExtensionServiceTestBase {
24 public: 24 public:
25 ThemeServiceTest() { 25 ThemeServiceTest() {
26 manager_.reset( 26 manager_.reset(
27 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); 27 new TestingProfileManager(TestingBrowserProcess::GetGlobal()));
28 } 28 }
29 virtual ~ThemeServiceTest() {} 29 virtual ~ThemeServiceTest() {}
30 30
31 scoped_refptr<extensions::Extension> MakeThemeExtension(base::FilePath path) { 31 scoped_refptr<extensions::Extension> MakeThemeExtension(base::FilePath path) {
32 DictionaryValue source; 32 DictionaryValue source;
33 source.SetString(extension_manifest_keys::kName, "theme"); 33 source.SetString(extensions::manifest_keys::kName, "theme");
34 source.Set(extension_manifest_keys::kTheme, new DictionaryValue()); 34 source.Set(extensions::manifest_keys::kTheme, new DictionaryValue());
35 source.SetString(extension_manifest_keys::kUpdateURL, "http://foo.com"); 35 source.SetString(extensions::manifest_keys::kUpdateURL, "http://foo.com");
36 source.SetString(extension_manifest_keys::kVersion, "0.0.0.0"); 36 source.SetString(extensions::manifest_keys::kVersion, "0.0.0.0");
37 std::string error; 37 std::string error;
38 scoped_refptr<extensions::Extension> extension = 38 scoped_refptr<extensions::Extension> extension =
39 extensions::Extension::Create( 39 extensions::Extension::Create(
40 path, extensions::Manifest::EXTERNAL_PREF_DOWNLOAD, 40 path, extensions::Manifest::EXTERNAL_PREF_DOWNLOAD,
41 source, extensions::Extension::NO_FLAGS, &error); 41 source, extensions::Extension::NO_FLAGS, &error);
42 EXPECT_TRUE(extension.get()); 42 EXPECT_TRUE(extension.get());
43 EXPECT_EQ("", error); 43 EXPECT_EQ("", error);
44 return extension; 44 return extension;
45 } 45 }
46 46
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 ThemeServiceFactory::GetForProfile(profile_.get()); 141 ThemeServiceFactory::GetForProfile(profile_.get());
142 theme_service->UseDefaultTheme(); 142 theme_service->UseDefaultTheme();
143 EXPECT_TRUE(theme_service->UsingDefaultTheme()); 143 EXPECT_TRUE(theme_service->UsingDefaultTheme());
144 EXPECT_TRUE(get_theme_supplier(theme_service)); 144 EXPECT_TRUE(get_theme_supplier(theme_service));
145 EXPECT_EQ(get_theme_supplier(theme_service)->get_theme_type(), 145 EXPECT_EQ(get_theme_supplier(theme_service)->get_theme_type(),
146 CustomThemeSupplier::MANAGED_USER_THEME); 146 CustomThemeSupplier::MANAGED_USER_THEME);
147 } 147 }
148 #endif 148 #endif
149 149
150 }; // namespace theme_service_internal 150 }; // namespace theme_service_internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698