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

Side by Side Diff: chrome/browser/extensions/component_loader_unittest.cc

Issue 14622003: components: Move PrefRegistrySyncable into user_prefs namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 years, 7 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
« no previous file with comments | « chrome/browser/extensions/component_loader.cc ('k') | chrome/browser/extensions/default_apps.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) 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/extensions/component_loader.h"
6
5 #include <string> 7 #include <string>
6 8
7 #include "chrome/browser/extensions/component_loader.h"
8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "base/prefs/pref_registry_simple.h" 11 #include "base/prefs/pref_registry_simple.h"
12 #include "chrome/browser/extensions/test_extension_service.h" 12 #include "chrome/browser/extensions/test_extension_service.h"
13 #include "chrome/common/chrome_paths.h" 13 #include "chrome/common/chrome_paths.h"
14 #include "chrome/common/extensions/background_info.h" 14 #include "chrome/common/extensions/background_info.h"
15 #include "chrome/common/extensions/extension.h" 15 #include "chrome/common/extensions/extension.h"
16 #include "chrome/common/extensions/extension_set.h" 16 #include "chrome/common/extensions/extension_set.h"
17 #include "chrome/common/extensions/extension_unittest.h" 17 #include "chrome/common/extensions/extension_unittest.h"
18 #include "chrome/common/pref_names.h" 18 #include "chrome/common/pref_names.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 // Read in the extension manifest. 92 // Read in the extension manifest.
93 ASSERT_TRUE(file_util::ReadFileToString( 93 ASSERT_TRUE(file_util::ReadFileToString(
94 extension_path_.Append(kManifestFilename), 94 extension_path_.Append(kManifestFilename),
95 &manifest_contents_)); 95 &manifest_contents_));
96 96
97 // Register the user prefs that ComponentLoader will read. 97 // Register the user prefs that ComponentLoader will read.
98 prefs_.registry()->RegisterStringPref( 98 prefs_.registry()->RegisterStringPref(
99 prefs::kEnterpriseWebStoreURL, 99 prefs::kEnterpriseWebStoreURL,
100 std::string(), 100 std::string(),
101 PrefRegistrySyncable::UNSYNCABLE_PREF); 101 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
102 prefs_.registry()->RegisterStringPref( 102 prefs_.registry()->RegisterStringPref(
103 prefs::kEnterpriseWebStoreName, 103 prefs::kEnterpriseWebStoreName,
104 std::string(), 104 std::string(),
105 PrefRegistrySyncable::UNSYNCABLE_PREF); 105 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
106 106
107 // Register the local state prefs. 107 // Register the local state prefs.
108 #if defined(OS_CHROMEOS) 108 #if defined(OS_CHROMEOS)
109 local_state_.registry()->RegisterBooleanPref( 109 local_state_.registry()->RegisterBooleanPref(
110 prefs::kSpokenFeedbackEnabled, false); 110 prefs::kSpokenFeedbackEnabled, false);
111 #endif 111 #endif
112 } 112 }
113 113
114 protected: 114 protected:
115 MockExtensionService extension_service_; 115 MockExtensionService extension_service_;
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size()); 311 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size());
312 EXPECT_EQ(0u, extension_service_.unloaded_count()); 312 EXPECT_EQ(0u, extension_service_.unloaded_count());
313 313
314 // replace loaded component extension. 314 // replace loaded component extension.
315 component_loader_.AddOrReplace(known_extension); 315 component_loader_.AddOrReplace(known_extension);
316 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size()); 316 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size());
317 EXPECT_EQ(1u, extension_service_.unloaded_count()); 317 EXPECT_EQ(1u, extension_service_.unloaded_count());
318 } 318 }
319 319
320 } // namespace extensions 320 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/component_loader.cc ('k') | chrome/browser/extensions/default_apps.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698