OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_SETTINGS_SETTINGS_TEST_UTIL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_TEST_UTIL_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_TEST_UTIL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_TEST_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 const std::string& extension_id, SettingsFrontend* frontend); | 30 const std::string& extension_id, SettingsFrontend* frontend); |
31 | 31 |
32 // An ExtensionService which allows extensions to be hand-added to be returned | 32 // An ExtensionService which allows extensions to be hand-added to be returned |
33 // by GetExtensionById. | 33 // by GetExtensionById. |
34 class MockExtensionService : public TestExtensionService { | 34 class MockExtensionService : public TestExtensionService { |
35 public: | 35 public: |
36 MockExtensionService(); | 36 MockExtensionService(); |
37 virtual ~MockExtensionService(); | 37 virtual ~MockExtensionService(); |
38 | 38 |
39 // Adds an extension with id |id| to be returned by GetExtensionById. | 39 // Adds an extension with id |id| to be returned by GetExtensionById. |
40 void AddExtension(const std::string& id, Extension::Type type); | 40 void AddExtensionWithId(const std::string& id, Extension::Type type); |
41 | 41 |
42 virtual const Extension* GetExtensionById( | 42 virtual const Extension* GetExtensionById( |
43 const std::string& id, bool include_disabled) const OVERRIDE; | 43 const std::string& id, bool include_disabled) const OVERRIDE; |
44 | 44 |
45 private: | 45 private: |
46 std::map<std::string, scoped_refptr<Extension> > extensions_; | 46 std::map<std::string, scoped_refptr<Extension> > extensions_; |
47 }; | 47 }; |
48 | 48 |
49 // A Profile which returns ExtensionService and ExtensionEventRouters with | 49 // A Profile which returns ExtensionService and ExtensionEventRouters with |
50 // enough functionality for the tests. | 50 // enough functionality for the tests. |
(...skipping 12 matching lines...) Expand all Loading... |
63 private: | 63 private: |
64 MockExtensionService extension_service_; | 64 MockExtensionService extension_service_; |
65 scoped_ptr<ExtensionEventRouter> event_router_; | 65 scoped_ptr<ExtensionEventRouter> event_router_; |
66 }; | 66 }; |
67 | 67 |
68 } // namespace settings_test_util | 68 } // namespace settings_test_util |
69 | 69 |
70 } // namespace extensions | 70 } // namespace extensions |
71 | 71 |
72 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_TEST_UTIL_H_ | 72 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_TEST_UTIL_H_ |
OLD | NEW |