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 <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
11 #include "build/build_config.h" | 12 #include "build/build_config.h" |
12 | 13 |
13 #if defined(OS_WIN) | 14 #if defined(OS_WIN) |
14 #include "ui/base/win/scoped_ole_initializer.h" | 15 #include "ui/base/win/scoped_ole_initializer.h" |
15 #endif | 16 #endif |
16 | 17 |
17 class ExtensionService; | 18 class ExtensionService; |
18 class TestingProfile; | 19 class TestingProfile; |
19 | 20 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // Use a specific extension ID instead of the default generated in | 73 // Use a specific extension ID instead of the default generated in |
73 // Extension::Create. | 74 // Extension::Create. |
74 const Extension* MakeExtension(const base::Value& manifest_extra, | 75 const Extension* MakeExtension(const base::Value& manifest_extra, |
75 const std::string& id); | 76 const std::string& id); |
76 | 77 |
77 // Generates a valid packaged app manifest with the given ID. If |install| | 78 // Generates a valid packaged app manifest with the given ID. If |install| |
78 // it gets added to the ExtensionService in |profile|. | 79 // it gets added to the ExtensionService in |profile|. |
79 scoped_refptr<Extension> MakePackagedApp(const std::string& id, bool install); | 80 scoped_refptr<Extension> MakePackagedApp(const std::string& id, bool install); |
80 | 81 |
81 // Returns a test web contents that has a tab id. | 82 // Returns a test web contents that has a tab id. |
82 scoped_ptr<content::WebContents> MakeTab() const; | 83 std::unique_ptr<content::WebContents> MakeTab() const; |
83 | 84 |
84 // Deletes the testing profile to test profile teardown. | 85 // Deletes the testing profile to test profile teardown. |
85 void DeleteProfile(); | 86 void DeleteProfile(); |
86 | 87 |
87 private: | 88 private: |
88 class ChromeOSEnv; | 89 class ChromeOSEnv; |
89 | 90 |
90 void Init(); | 91 void Init(); |
91 | 92 |
92 scoped_ptr<content::TestBrowserThreadBundle> thread_bundle_; | 93 std::unique_ptr<content::TestBrowserThreadBundle> thread_bundle_; |
93 scoped_ptr<ChromeOSEnv> chromeos_env_; | 94 std::unique_ptr<ChromeOSEnv> chromeos_env_; |
94 | 95 |
95 #if defined(OS_WIN) | 96 #if defined(OS_WIN) |
96 ui::ScopedOleInitializer ole_initializer_; | 97 ui::ScopedOleInitializer ole_initializer_; |
97 #endif | 98 #endif |
98 scoped_ptr<TestingProfile> profile_; | 99 std::unique_ptr<TestingProfile> profile_; |
99 ExtensionService* extension_service_; | 100 ExtensionService* extension_service_; |
100 | 101 |
101 DISALLOW_COPY_AND_ASSIGN(TestExtensionEnvironment); | 102 DISALLOW_COPY_AND_ASSIGN(TestExtensionEnvironment); |
102 }; | 103 }; |
103 | 104 |
104 } // namespace extensions | 105 } // namespace extensions |
105 | 106 |
106 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_ENVIRONMENT_H_ | 107 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_ENVIRONMENT_H_ |
OLD | NEW |