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/extensions/component_loader.h" | 5 #include "chrome/browser/extensions/component_loader.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
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/common/chrome_paths.h" | 13 #include "chrome/common/chrome_paths.h" |
14 #include "chrome/common/extensions/extension_set.h" | |
15 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
16 #include "chrome/test/base/testing_pref_service_syncable.h" | 15 #include "chrome/test/base/testing_pref_service_syncable.h" |
17 #include "components/user_prefs/pref_registry_syncable.h" | 16 #include "components/user_prefs/pref_registry_syncable.h" |
18 #include "extensions/common/constants.h" | 17 #include "extensions/common/constants.h" |
19 #include "extensions/common/extension.h" | 18 #include "extensions/common/extension.h" |
| 19 #include "extensions/common/extension_set.h" |
20 #include "extensions/common/manifest_handlers/background_info.h" | 20 #include "extensions/common/manifest_handlers/background_info.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 | 22 |
23 namespace extensions { | 23 namespace extensions { |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 class MockExtensionService : public TestExtensionService { | 27 class MockExtensionService : public TestExtensionService { |
28 private: | 28 private: |
29 bool ready_; | 29 bool ready_; |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 component_loader_.AddOrReplace(known_extension); | 266 component_loader_.AddOrReplace(known_extension); |
267 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size()); | 267 EXPECT_EQ(default_count + 1, extension_service_.extensions()->size()); |
268 EXPECT_EQ(1u, extension_service_.unloaded_count()); | 268 EXPECT_EQ(1u, extension_service_.unloaded_count()); |
269 | 269 |
270 // Add an invalid component extension. | 270 // Add an invalid component extension. |
271 std::string extension_id = component_loader_.AddOrReplace(invalid_extension); | 271 std::string extension_id = component_loader_.AddOrReplace(invalid_extension); |
272 EXPECT_TRUE(extension_id.empty()); | 272 EXPECT_TRUE(extension_id.empty()); |
273 } | 273 } |
274 | 274 |
275 } // namespace extensions | 275 } // namespace extensions |
OLD | NEW |