| 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 #include "chrome/browser/extensions/extension_apitest.h" | 5 #include "chrome/browser/extensions/extension_apitest.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "chrome/browser/extensions/api/test/test_api.h" | 9 #include "chrome/browser/extensions/api/test/test_api.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 bool ExtensionApiTest::RunPageTest(const std::string& page_url) { | 167 bool ExtensionApiTest::RunPageTest(const std::string& page_url) { |
| 168 return RunExtensionSubtest("", page_url); | 168 return RunExtensionSubtest("", page_url); |
| 169 } | 169 } |
| 170 | 170 |
| 171 bool ExtensionApiTest::RunPageTest(const std::string& page_url, | 171 bool ExtensionApiTest::RunPageTest(const std::string& page_url, |
| 172 int flags) { | 172 int flags) { |
| 173 return RunExtensionSubtest("", page_url, flags); | 173 return RunExtensionSubtest("", page_url, flags); |
| 174 } | 174 } |
| 175 | 175 |
| 176 bool ExtensionApiTest::RunPlatformAppTest(const char* extension_name) { | 176 bool ExtensionApiTest::RunPlatformAppTest(const char* extension_name) { |
| 177 bool res = RunPlatformAppTestReturnImmediately(extension_name); | |
| 178 CloseShellWindowsAndWaitForAppToExit(); | |
| 179 return res; | |
| 180 } | |
| 181 | |
| 182 bool ExtensionApiTest::RunPlatformAppTestReturnImmediately( | |
| 183 const char* extension_name) { | |
| 184 return RunExtensionTestImpl(extension_name, "", kFlagLaunchPlatformApp); | 177 return RunExtensionTestImpl(extension_name, "", kFlagLaunchPlatformApp); |
| 185 } | 178 } |
| 186 | 179 |
| 187 // Load |extension_name| extension and/or |page_url| and wait for | 180 // Load |extension_name| extension and/or |page_url| and wait for |
| 188 // PASSED or FAILED notification. | 181 // PASSED or FAILED notification. |
| 189 bool ExtensionApiTest::RunExtensionTestImpl(const char* extension_name, | 182 bool ExtensionApiTest::RunExtensionTestImpl(const char* extension_name, |
| 190 const std::string& page_url, | 183 const std::string& page_url, |
| 191 int flags) { | 184 int flags) { |
| 192 bool load_as_component = (flags & kFlagLoadAsComponent) != 0; | 185 bool load_as_component = (flags & kFlagLoadAsComponent) != 0; |
| 193 bool launch_platform_app = (flags & kFlagLaunchPlatformApp) != 0; | 186 bool launch_platform_app = (flags & kFlagLaunchPlatformApp) != 0; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 test_config_->SetInteger(kTestWebSocketPort, | 306 test_config_->SetInteger(kTestWebSocketPort, |
| 314 websocket_server_->host_port_pair().port()); | 307 websocket_server_->host_port_pair().port()); |
| 315 | 308 |
| 316 return true; | 309 return true; |
| 317 } | 310 } |
| 318 | 311 |
| 319 void ExtensionApiTest::SetUpCommandLine(CommandLine* command_line) { | 312 void ExtensionApiTest::SetUpCommandLine(CommandLine* command_line) { |
| 320 ExtensionBrowserTest::SetUpCommandLine(command_line); | 313 ExtensionBrowserTest::SetUpCommandLine(command_line); |
| 321 test_data_dir_ = test_data_dir_.AppendASCII("api_test"); | 314 test_data_dir_ = test_data_dir_.AppendASCII("api_test"); |
| 322 } | 315 } |
| OLD | NEW |