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 // Start the test WebSocket server, and store details of its state. Those | 141 // Start the test WebSocket server, and store details of its state. Those |
142 // details will be available to javascript tests using | 142 // details will be available to javascript tests using |
143 // chrome.test.getConfig(). | 143 // chrome.test.getConfig(). |
144 bool StartWebSocketServer(const base::FilePath& root_directory); | 144 bool StartWebSocketServer(const base::FilePath& root_directory); |
145 | 145 |
146 // Start the test FTP server, and store details of its state. Those | 146 // Start the test FTP server, and store details of its state. Those |
147 // details will be available to JavaScript tests using | 147 // details will be available to JavaScript tests using |
148 // chrome.test.getConfig(). | 148 // chrome.test.getConfig(). |
149 bool StartFTPServer(const base::FilePath& root_directory); | 149 bool StartFTPServer(const base::FilePath& root_directory); |
150 | 150 |
151 // Start the spawned test server, and store details of its state. Those | |
152 // details will be available to javascript tests using | |
153 // chrome.test.getConfig(). | |
154 bool StartSpawnedTestServer(); | |
155 | |
156 // Test that exactly one extension loaded. If so, return a pointer to | 151 // Test that exactly one extension loaded. If so, return a pointer to |
157 // the extension. If not, return NULL and set message_. | 152 // the extension. If not, return NULL and set message_. |
158 const extensions::Extension* GetSingleLoadedExtension(); | 153 const extensions::Extension* GetSingleLoadedExtension(); |
159 | 154 |
160 // All extensions tested by ExtensionApiTest are in the "api_test" dir. | 155 // All extensions tested by ExtensionApiTest are in the "api_test" dir. |
161 void SetUpCommandLine(base::CommandLine* command_line) override; | 156 void SetUpCommandLine(base::CommandLine* command_line) override; |
162 | 157 |
163 // If it failed, what was the error message? | 158 // If it failed, what was the error message? |
164 std::string message_; | 159 std::string message_; |
165 | 160 |
166 private: | 161 private: |
167 bool RunExtensionTestImpl(const std::string& extension_name, | 162 bool RunExtensionTestImpl(const std::string& extension_name, |
168 const std::string& test_page, | 163 const std::string& test_page, |
169 const char* custom_arg, | 164 const char* custom_arg, |
170 int flags); | 165 int flags); |
171 | 166 |
172 // Hold details of the test, set in C++, which can be accessed by | 167 // Hold details of the test, set in C++, which can be accessed by |
173 // javascript using chrome.test.getConfig(). | 168 // javascript using chrome.test.getConfig(). |
174 scoped_ptr<base::DictionaryValue> test_config_; | 169 scoped_ptr<base::DictionaryValue> test_config_; |
175 | 170 |
176 // Hold the test WebSocket server. | 171 // Hold the test WebSocket server. |
177 scoped_ptr<net::SpawnedTestServer> websocket_server_; | 172 scoped_ptr<net::SpawnedTestServer> websocket_server_; |
178 | 173 |
179 // Hold the test FTP server. | 174 // Hold the test FTP server. |
180 scoped_ptr<net::SpawnedTestServer> ftp_server_; | 175 scoped_ptr<net::SpawnedTestServer> ftp_server_; |
181 }; | 176 }; |
182 | 177 |
183 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_ | 178 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_ |
OLD | NEW |