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 #ifndef CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_TEST_UTIL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_TEST_UTIL_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_TEST_UTIL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_TEST_UTIL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 SettingsFrontend* frontend); | 41 SettingsFrontend* frontend); |
42 | 42 |
43 // An ExtensionService which allows extensions to be hand-added to be returned | 43 // An ExtensionService which allows extensions to be hand-added to be returned |
44 // by GetExtensionById. | 44 // by GetExtensionById. |
45 class MockExtensionService : public TestExtensionService { | 45 class MockExtensionService : public TestExtensionService { |
46 public: | 46 public: |
47 MockExtensionService(); | 47 MockExtensionService(); |
48 virtual ~MockExtensionService(); | 48 virtual ~MockExtensionService(); |
49 | 49 |
50 // Adds an extension with id |id| to be returned by GetExtensionById. | 50 // Adds an extension with id |id| to be returned by GetExtensionById. |
51 void AddExtensionWithId(const std::string& id, Extension::Type type); | 51 void AddExtensionWithId(const std::string& id, Manifest::Type type); |
52 | 52 |
53 // Adds an extension with id |id| to be returned by GetExtensionById, with | 53 // Adds an extension with id |id| to be returned by GetExtensionById, with |
54 // a set of permissions. | 54 // a set of permissions. |
55 void AddExtensionWithIdAndPermissions( | 55 void AddExtensionWithIdAndPermissions( |
56 const std::string& id, | 56 const std::string& id, |
57 Extension::Type type, | 57 Manifest::Type type, |
58 const std::set<std::string>& permissions); | 58 const std::set<std::string>& permissions); |
59 | 59 |
60 virtual const Extension* GetExtensionById( | 60 virtual const Extension* GetExtensionById( |
61 const std::string& id, bool include_disabled) const OVERRIDE; | 61 const std::string& id, bool include_disabled) const OVERRIDE; |
62 | 62 |
63 private: | 63 private: |
64 std::map<std::string, scoped_refptr<Extension> > extensions_; | 64 std::map<std::string, scoped_refptr<Extension> > extensions_; |
65 }; | 65 }; |
66 | 66 |
67 // A mock ExtensionSystem to serve an EventRouter. | 67 // A mock ExtensionSystem to serve an EventRouter. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 virtual ~ScopedSettingsStorageFactory(); | 108 virtual ~ScopedSettingsStorageFactory(); |
109 | 109 |
110 scoped_refptr<SettingsStorageFactory> delegate_; | 110 scoped_refptr<SettingsStorageFactory> delegate_; |
111 }; | 111 }; |
112 | 112 |
113 } // namespace settings_test_util | 113 } // namespace settings_test_util |
114 | 114 |
115 } // namespace extensions | 115 } // namespace extensions |
116 | 116 |
117 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_TEST_UTIL_H_ | 117 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_TEST_UTIL_H_ |
OLD | NEW |