| 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 20 matching lines...) Expand all Loading... |
| 31 const std::string& extension_id, SettingsFrontend* frontend); | 31 const std::string& extension_id, SettingsFrontend* frontend); |
| 32 | 32 |
| 33 // An ExtensionService which allows extensions to be hand-added to be returned | 33 // An ExtensionService which allows extensions to be hand-added to be returned |
| 34 // by GetExtensionById. | 34 // by GetExtensionById. |
| 35 class MockExtensionService : public TestExtensionService { | 35 class MockExtensionService : public TestExtensionService { |
| 36 public: | 36 public: |
| 37 MockExtensionService(); | 37 MockExtensionService(); |
| 38 virtual ~MockExtensionService(); | 38 virtual ~MockExtensionService(); |
| 39 | 39 |
| 40 // Adds an extension with id |id| to be returned by GetExtensionById. | 40 // Adds an extension with id |id| to be returned by GetExtensionById. |
| 41 void AddExtension(const std::string& id, Extension::Type type); | 41 void AddExtensionWithId(const std::string& id, Extension::Type type); |
| 42 | 42 |
| 43 virtual const Extension* GetExtensionById( | 43 virtual const Extension* GetExtensionById( |
| 44 const std::string& id, bool include_disabled) const OVERRIDE; | 44 const std::string& id, bool include_disabled) const OVERRIDE; |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 std::map<std::string, scoped_refptr<Extension> > extensions_; | 47 std::map<std::string, scoped_refptr<Extension> > extensions_; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 // A Profile which returns ExtensionService and ExtensionEventRouters with | 50 // A Profile which returns ExtensionService and ExtensionEventRouters with |
| 51 // enough functionality for the tests. | 51 // enough functionality for the tests. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 scoped_ptr<SettingsStorageFactory> delegate_; | 84 scoped_ptr<SettingsStorageFactory> delegate_; |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 } // namespace settings_test_util | 87 } // namespace settings_test_util |
| 88 | 88 |
| 89 } // namespace extensions | 89 } // namespace extensions |
| 90 | 90 |
| 91 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_TEST_UTIL_H_ | 91 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_TEST_UTIL_H_ |
| OLD | NEW |