OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_TEST_EXTENSION_ENVIRONMENT_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_ENVIRONMENT_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_ENVIRONMENT_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_ENVIRONMENT_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "content/public/test/test_browser_thread_bundle.h" | 10 #include "content/public/test/test_browser_thread_bundle.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // Returns ExtensionPrefs created (and owned) by the | 55 // Returns ExtensionPrefs created (and owned) by the |
56 // TestExtensionSystem created by the TestingProfile. | 56 // TestExtensionSystem created by the TestingProfile. |
57 ExtensionPrefs* GetExtensionPrefs(); | 57 ExtensionPrefs* GetExtensionPrefs(); |
58 | 58 |
59 // Creates an Extension and registers it with the ExtensionService. | 59 // Creates an Extension and registers it with the ExtensionService. |
60 // The Extension has a default manifest of {name: "Extension", | 60 // The Extension has a default manifest of {name: "Extension", |
61 // version: "1.0", manifest_version: 2}, and values in | 61 // version: "1.0", manifest_version: 2}, and values in |
62 // manifest_extra override these defaults. | 62 // manifest_extra override these defaults. |
63 const Extension* MakeExtension(const base::Value& manifest_extra); | 63 const Extension* MakeExtension(const base::Value& manifest_extra); |
64 | 64 |
65 // Use a specific extension ID instead of the default generated in | |
66 // Extension::Create. | |
67 const Extension* MakeExtension(const base::Value& manifest_extra, | |
68 const std::string& id); | |
69 | |
70 // Returns a test web contents that has a tab id. | 65 // Returns a test web contents that has a tab id. |
71 scoped_ptr<content::WebContents> MakeTab() const; | 66 scoped_ptr<content::WebContents> MakeTab() const; |
72 | 67 |
73 private: | 68 private: |
74 content::TestBrowserThreadBundle thread_bundle_; | 69 content::TestBrowserThreadBundle thread_bundle_; |
75 | 70 |
76 #if defined(OS_CHROMEOS) | 71 #if defined(OS_CHROMEOS) |
77 chromeos::ScopedTestDeviceSettingsService test_device_settings_service_; | 72 chromeos::ScopedTestDeviceSettingsService test_device_settings_service_; |
78 chromeos::ScopedTestCrosSettings test_cros_settings_; | 73 chromeos::ScopedTestCrosSettings test_cros_settings_; |
79 chromeos::ScopedTestUserManager test_user_manager_; | 74 chromeos::ScopedTestUserManager test_user_manager_; |
80 #endif | 75 #endif |
81 | 76 |
82 #if defined(OS_WIN) | 77 #if defined(OS_WIN) |
83 ui::ScopedOleInitializer ole_initializer_; | 78 ui::ScopedOleInitializer ole_initializer_; |
84 #endif | 79 #endif |
85 scoped_ptr<TestingProfile> profile_; | 80 scoped_ptr<TestingProfile> profile_; |
86 ExtensionService* extension_service_; | 81 ExtensionService* extension_service_; |
87 ExtensionPrefs* extension_prefs_; | 82 ExtensionPrefs* extension_prefs_; |
88 }; | 83 }; |
89 | 84 |
90 } // namespace extensions | 85 } // namespace extensions |
91 | 86 |
92 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_ENVIRONMENT_H_ | 87 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_ENVIRONMENT_H_ |
OLD | NEW |