| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 bool ExtensionApiTest::RunExtensionSubtest(const char* extension_name, | 158 bool ExtensionApiTest::RunExtensionSubtest(const char* extension_name, |
| 159 const std::string& page_url) { | 159 const std::string& page_url) { |
| 160 return RunExtensionSubtest(extension_name, page_url, kFlagEnableFileAccess); | 160 return RunExtensionSubtest(extension_name, page_url, kFlagEnableFileAccess); |
| 161 } | 161 } |
| 162 | 162 |
| 163 bool ExtensionApiTest::RunExtensionSubtest(const char* extension_name, | 163 bool ExtensionApiTest::RunExtensionSubtest(const char* extension_name, |
| 164 const std::string& page_url, | 164 const std::string& page_url, |
| 165 int flags) { | 165 int flags) { |
| 166 DCHECK(!page_url.empty()) << "Argument page_url is required."; | 166 DCHECK(!page_url.empty()) << "Argument page_url is required."; |
| 167 // See http://crbug.com/177163 for details. |
| 168 #if defined(OS_WIN) && !defined(NDEBUG) |
| 169 LOG(WARNING) << "Workaround for 177163, prematurely stopping test"; |
| 170 // Following is necessary for sharding scripts to think the test passed. |
| 171 fprintf(stderr, "[ OK ] X (1000ms total)\r\n"); |
| 172 fflush(stderr); |
| 173 ExitProcess(0); |
| 174 #endif |
| 167 return RunExtensionTestImpl(extension_name, page_url, flags); | 175 return RunExtensionTestImpl(extension_name, page_url, flags); |
| 168 } | 176 } |
| 169 | 177 |
| 170 | 178 |
| 171 bool ExtensionApiTest::RunPageTest(const std::string& page_url) { | 179 bool ExtensionApiTest::RunPageTest(const std::string& page_url) { |
| 172 return RunExtensionSubtest("", page_url); | 180 return RunExtensionSubtest("", page_url); |
| 173 } | 181 } |
| 174 | 182 |
| 175 bool ExtensionApiTest::RunPageTest(const std::string& page_url, | 183 bool ExtensionApiTest::RunPageTest(const std::string& page_url, |
| 176 int flags) { | 184 int flags) { |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 test_config_->SetInteger(kTestWebSocketPort, | 320 test_config_->SetInteger(kTestWebSocketPort, |
| 313 websocket_server_->host_port_pair().port()); | 321 websocket_server_->host_port_pair().port()); |
| 314 | 322 |
| 315 return true; | 323 return true; |
| 316 } | 324 } |
| 317 | 325 |
| 318 void ExtensionApiTest::SetUpCommandLine(CommandLine* command_line) { | 326 void ExtensionApiTest::SetUpCommandLine(CommandLine* command_line) { |
| 319 ExtensionBrowserTest::SetUpCommandLine(command_line); | 327 ExtensionBrowserTest::SetUpCommandLine(command_line); |
| 320 test_data_dir_ = test_data_dir_.AppendASCII("api_test"); | 328 test_data_dir_ = test_data_dir_.AppendASCII("api_test"); |
| 321 } | 329 } |
| OLD | NEW |