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 "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/browser/prefs/pref_registry_syncable.h" | |
14 #include "chrome/common/chrome_paths.h" | 13 #include "chrome/common/chrome_paths.h" |
15 #include "chrome/common/extensions/background_info.h" | 14 #include "chrome/common/extensions/background_info.h" |
16 #include "chrome/common/extensions/extension.h" | 15 #include "chrome/common/extensions/extension.h" |
17 #include "chrome/common/extensions/extension_set.h" | 16 #include "chrome/common/extensions/extension_set.h" |
18 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
19 #include "chrome/test/base/testing_pref_service_syncable.h" | 18 #include "chrome/test/base/testing_pref_service_syncable.h" |
| 19 #include "components/user_prefs/pref_registry_syncable.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
21 | 21 |
22 using extensions::Extension; | 22 using extensions::Extension; |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 class MockExtensionService : public TestExtensionService { | 26 class MockExtensionService : public TestExtensionService { |
27 private: | 27 private: |
28 bool ready_; | 28 bool ready_; |
29 size_t unloaded_count_; | 29 size_t unloaded_count_; |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size()); | 312 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size()); |
313 EXPECT_EQ(0u, extension_service_.unloaded_count()); | 313 EXPECT_EQ(0u, extension_service_.unloaded_count()); |
314 | 314 |
315 // replace loaded component extension. | 315 // replace loaded component extension. |
316 component_loader_.AddOrReplace(known_extension); | 316 component_loader_.AddOrReplace(known_extension); |
317 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size()); | 317 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size()); |
318 EXPECT_EQ(1u, extension_service_.unloaded_count()); | 318 EXPECT_EQ(1u, extension_service_.unloaded_count()); |
319 } | 319 } |
320 | 320 |
321 } // namespace extensions | 321 } // namespace extensions |
OLD | NEW |