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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 // Start the spawned test server, and store details of its state. Those | 181 // Start the spawned test server, and store details of its state. Those |
182 // details will be available to javascript tests using | 182 // details will be available to javascript tests using |
183 // chrome.test.getConfig(). | 183 // chrome.test.getConfig(). |
184 bool StartSpawnedTestServer(); | 184 bool StartSpawnedTestServer(); |
185 | 185 |
186 // Test that exactly one extension loaded. If so, return a pointer to | 186 // Test that exactly one extension loaded. If so, return a pointer to |
187 // the extension. If not, return NULL and set message_. | 187 // the extension. If not, return NULL and set message_. |
188 const extensions::Extension* GetSingleLoadedExtension(); | 188 const extensions::Extension* GetSingleLoadedExtension(); |
189 | 189 |
190 // All extensions tested by ExtensionApiTest are in the "api_test" dir. | 190 // All extensions tested by ExtensionApiTest are in the "api_test" dir. |
191 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; | 191 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; |
192 | 192 |
193 // If it failed, what was the error message? | 193 // If it failed, what was the error message? |
194 std::string message_; | 194 std::string message_; |
195 | 195 |
196 private: | 196 private: |
197 bool RunExtensionTestImpl(const std::string& extension_name, | 197 bool RunExtensionTestImpl(const std::string& extension_name, |
198 const std::string& test_page, | 198 const std::string& test_page, |
199 const char* custom_arg, | 199 const char* custom_arg, |
200 int flags); | 200 int flags); |
201 | 201 |
202 // Hold details of the test, set in C++, which can be accessed by | 202 // Hold details of the test, set in C++, which can be accessed by |
203 // javascript using chrome.test.getConfig(). | 203 // javascript using chrome.test.getConfig(). |
204 scoped_ptr<base::DictionaryValue> test_config_; | 204 scoped_ptr<base::DictionaryValue> test_config_; |
205 | 205 |
206 // Hold the test WebSocket server. | 206 // Hold the test WebSocket server. |
207 scoped_ptr<net::SpawnedTestServer> websocket_server_; | 207 scoped_ptr<net::SpawnedTestServer> websocket_server_; |
208 | 208 |
209 // Hold the test FTP server. | 209 // Hold the test FTP server. |
210 scoped_ptr<net::SpawnedTestServer> ftp_server_; | 210 scoped_ptr<net::SpawnedTestServer> ftp_server_; |
211 }; | 211 }; |
212 | 212 |
213 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_ | 213 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_ |
OLD | NEW |