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 <string> | 5 #include <string> |
6 | 6 |
7 #include "chrome/browser/extensions/component_loader.h" | 7 #include "chrome/browser/extensions/component_loader.h" |
8 | 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 "chrome/browser/extensions/test_extension_service.h" | 11 #include "chrome/browser/extensions/test_extension_service.h" |
| 12 #include "chrome/browser/prefs/pref_registry_simple.h" |
12 #include "chrome/common/chrome_paths.h" | 13 #include "chrome/common/chrome_paths.h" |
13 #include "chrome/common/extensions/extension.h" | 14 #include "chrome/common/extensions/extension.h" |
14 #include "chrome/common/extensions/extension_set.h" | 15 #include "chrome/common/extensions/extension_set.h" |
15 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
16 #include "chrome/test/base/testing_pref_service.h" | 17 #include "chrome/test/base/testing_pref_service.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
18 | 19 |
19 using extensions::Extension; | 20 using extensions::Extension; |
20 | 21 |
21 namespace { | 22 namespace { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // Register the user prefs that ComponentLoader will read. | 94 // Register the user prefs that ComponentLoader will read. |
94 prefs_.RegisterStringPref(prefs::kEnterpriseWebStoreURL, | 95 prefs_.RegisterStringPref(prefs::kEnterpriseWebStoreURL, |
95 std::string(), | 96 std::string(), |
96 PrefServiceSyncable::UNSYNCABLE_PREF); | 97 PrefServiceSyncable::UNSYNCABLE_PREF); |
97 prefs_.RegisterStringPref(prefs::kEnterpriseWebStoreName, | 98 prefs_.RegisterStringPref(prefs::kEnterpriseWebStoreName, |
98 std::string(), | 99 std::string(), |
99 PrefServiceSyncable::UNSYNCABLE_PREF); | 100 PrefServiceSyncable::UNSYNCABLE_PREF); |
100 | 101 |
101 // Register the local state prefs. | 102 // Register the local state prefs. |
102 #if defined(OS_CHROMEOS) | 103 #if defined(OS_CHROMEOS) |
103 local_state_.RegisterBooleanPref(prefs::kSpokenFeedbackEnabled, false); | 104 local_state_.registry()->RegisterBooleanPref( |
| 105 prefs::kSpokenFeedbackEnabled, false); |
104 #endif | 106 #endif |
105 } | 107 } |
106 | 108 |
107 protected: | 109 protected: |
108 MockExtensionService extension_service_; | 110 MockExtensionService extension_service_; |
109 TestingPrefServiceSyncable prefs_; | 111 TestingPrefServiceSyncable prefs_; |
110 TestingPrefServiceSimple local_state_; | 112 TestingPrefServiceSimple local_state_; |
111 ComponentLoader component_loader_; | 113 ComponentLoader component_loader_; |
112 | 114 |
113 // The root directory of the text extension. | 115 // The root directory of the text extension. |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size()); | 306 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size()); |
305 EXPECT_EQ(0u, extension_service_.unloaded_count()); | 307 EXPECT_EQ(0u, extension_service_.unloaded_count()); |
306 | 308 |
307 // replace loaded component extension. | 309 // replace loaded component extension. |
308 component_loader_.AddOrReplace(known_extension); | 310 component_loader_.AddOrReplace(known_extension); |
309 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size()); | 311 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size()); |
310 EXPECT_EQ(1u, extension_service_.unloaded_count()); | 312 EXPECT_EQ(1u, extension_service_.unloaded_count()); |
311 } | 313 } |
312 | 314 |
313 } // namespace extensions | 315 } // namespace extensions |
OLD | NEW |