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 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "chrome/browser/extensions/extension_browsertest.h" | 13 #include "chrome/browser/extensions/extension_browsertest.h" |
14 #include "content/public/browser/notification_registrar.h" | 14 #include "content/public/browser/notification_registrar.h" |
15 | 15 |
16 class FilePath; | 16 class FilePath; |
17 | 17 |
18 namespace content { | |
19 class TestWebSocketServer; | |
20 } | |
21 | |
22 namespace extensions { | 18 namespace extensions { |
23 class Extension; | 19 class Extension; |
24 } | 20 } |
25 | 21 |
26 | 22 |
27 // The general flow of these API tests should work like this: | 23 // The general flow of these API tests should work like this: |
28 // (1) Setup initial browser state (e.g. create some bookmarks for the | 24 // (1) Setup initial browser state (e.g. create some bookmarks for the |
29 // bookmark test) | 25 // bookmark test) |
30 // (2) Call ASSERT_TRUE(RunExtensionTest(name)); | 26 // (2) Call ASSERT_TRUE(RunExtensionTest(name)); |
31 // (3) In your extension code, run your test and call chrome.test.pass or | 27 // (3) In your extension code, run your test and call chrome.test.pass or |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 private: | 173 private: |
178 bool RunExtensionTestImpl(const char* extension_name, | 174 bool RunExtensionTestImpl(const char* extension_name, |
179 const std::string& test_page, | 175 const std::string& test_page, |
180 int flags); | 176 int flags); |
181 | 177 |
182 // Hold details of the test, set in C++, which can be accessed by | 178 // Hold details of the test, set in C++, which can be accessed by |
183 // javascript using chrome.test.getConfig(). | 179 // javascript using chrome.test.getConfig(). |
184 scoped_ptr<DictionaryValue> test_config_; | 180 scoped_ptr<DictionaryValue> test_config_; |
185 | 181 |
186 // Hold the test WebSocket server. | 182 // Hold the test WebSocket server. |
187 scoped_ptr<content::TestWebSocketServer> websocket_server_; | 183 scoped_ptr<net::TestServer> websocket_server_; |
188 }; | 184 }; |
189 | 185 |
190 // PlatformAppApiTest sets up the command-line flags necessary for platform | 186 // PlatformAppApiTest sets up the command-line flags necessary for platform |
191 // apps (if any). | 187 // apps (if any). |
192 class PlatformAppApiTest : public ExtensionApiTest { | 188 class PlatformAppApiTest : public ExtensionApiTest { |
193 public: | 189 public: |
194 PlatformAppApiTest(); | 190 PlatformAppApiTest(); |
195 virtual ~PlatformAppApiTest(); | 191 virtual ~PlatformAppApiTest(); |
196 | 192 |
197 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; | 193 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; |
198 }; | 194 }; |
199 | 195 |
200 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_ | 196 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_ |
OLD | NEW |