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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 test_server()->host_port_pair().port()); | 292 test_server()->host_port_pair().port()); |
293 | 293 |
294 return true; | 294 return true; |
295 } | 295 } |
296 | 296 |
297 bool ExtensionApiTest::StartWebSocketServer( | 297 bool ExtensionApiTest::StartWebSocketServer( |
298 const base::FilePath& root_directory) { | 298 const base::FilePath& root_directory) { |
299 websocket_server_.reset(new net::TestServer( | 299 websocket_server_.reset(new net::TestServer( |
300 net::TestServer::TYPE_WS, | 300 net::TestServer::TYPE_WS, |
301 net::TestServer::kLocalhost, | 301 net::TestServer::kLocalhost, |
302 root_directory)); | 302 net::TestServer::GetSourceRelativePath(root_directory))); |
303 | 303 |
304 if (!websocket_server_->Start()) | 304 if (!websocket_server_->Start()) |
305 return false; | 305 return false; |
306 | 306 |
307 test_config_->SetInteger(kTestWebSocketPort, | 307 test_config_->SetInteger(kTestWebSocketPort, |
308 websocket_server_->host_port_pair().port()); | 308 websocket_server_->host_port_pair().port()); |
309 | 309 |
310 return true; | 310 return true; |
311 } | 311 } |
312 | 312 |
313 void ExtensionApiTest::SetUpCommandLine(CommandLine* command_line) { | 313 void ExtensionApiTest::SetUpCommandLine(CommandLine* command_line) { |
314 ExtensionBrowserTest::SetUpCommandLine(command_line); | 314 ExtensionBrowserTest::SetUpCommandLine(command_line); |
315 test_data_dir_ = test_data_dir_.AppendASCII("api_test"); | 315 test_data_dir_ = test_data_dir_.AppendASCII("api_test"); |
316 } | 316 } |
OLD | NEW |