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_EXTENSION_APITEST_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 bool RunExtensionSubtest(const char* extension_name, | 141 bool RunExtensionSubtest(const char* extension_name, |
142 const std::string& page_url, | 142 const std::string& page_url, |
143 int flags); | 143 int flags); |
144 | 144 |
145 // Load |page_url| and wait for pass / fail notification from the extension | 145 // Load |page_url| and wait for pass / fail notification from the extension |
146 // API on the page. | 146 // API on the page. |
147 bool RunPageTest(const std::string& page_url); | 147 bool RunPageTest(const std::string& page_url); |
148 bool RunPageTest(const std::string& page_url, int flags); | 148 bool RunPageTest(const std::string& page_url, int flags); |
149 | 149 |
150 // Similar to RunExtensionTest, except used for running tests in platform app | 150 // Similar to RunExtensionTest, except used for running tests in platform app |
151 // shell windows. | 151 // shell windows. After running the test will close all shell windows and wait |
| 152 // for the background page to be unloaded. |
152 bool RunPlatformAppTest(const char* extension_name); | 153 bool RunPlatformAppTest(const char* extension_name); |
153 | 154 |
| 155 // Similar to RunPlatformAppTest, except after running the test returns |
| 156 // without closing shell windows or waiting for the background page to be |
| 157 // unloaded. |
| 158 bool RunPlatformAppTestReturnImmediately(const char* extension_name); |
| 159 |
154 // Start the test server, and store details of its state. Those details | 160 // Start the test server, and store details of its state. Those details |
155 // will be available to javascript tests using chrome.test.getConfig(). | 161 // will be available to javascript tests using chrome.test.getConfig(). |
156 bool StartTestServer(); | 162 bool StartTestServer(); |
157 | 163 |
158 // Start the test WebSocket server, and store details of its state. Those | 164 // Start the test WebSocket server, and store details of its state. Those |
159 // details will be available to javascript tests using | 165 // details will be available to javascript tests using |
160 // chrome.test.getConfig(). | 166 // chrome.test.getConfig(). |
161 bool StartWebSocketServer(const FilePath& root_directory); | 167 bool StartWebSocketServer(const FilePath& root_directory); |
162 | 168 |
163 // Test that exactly one extension loaded. If so, return a pointer to | 169 // Test that exactly one extension loaded. If so, return a pointer to |
(...skipping 13 matching lines...) Expand all Loading... |
177 | 183 |
178 // Hold details of the test, set in C++, which can be accessed by | 184 // Hold details of the test, set in C++, which can be accessed by |
179 // javascript using chrome.test.getConfig(). | 185 // javascript using chrome.test.getConfig(). |
180 scoped_ptr<DictionaryValue> test_config_; | 186 scoped_ptr<DictionaryValue> test_config_; |
181 | 187 |
182 // Hold the test WebSocket server. | 188 // Hold the test WebSocket server. |
183 scoped_ptr<net::TestServer> websocket_server_; | 189 scoped_ptr<net::TestServer> websocket_server_; |
184 }; | 190 }; |
185 | 191 |
186 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_ | 192 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_ |
OLD | NEW |