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