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 <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 embedded_test_server()->port()); | 408 embedded_test_server()->port()); |
409 | 409 |
410 return true; | 410 return true; |
411 } | 411 } |
412 | 412 |
413 void ExtensionApiTest::EmbeddedTestServerAcceptConnections() { | 413 void ExtensionApiTest::EmbeddedTestServerAcceptConnections() { |
414 embedded_test_server()->StartAcceptingConnections(); | 414 embedded_test_server()->StartAcceptingConnections(); |
415 } | 415 } |
416 | 416 |
417 bool ExtensionApiTest::StartWebSocketServer( | 417 bool ExtensionApiTest::StartWebSocketServer( |
418 const base::FilePath& root_directory) { | 418 const base::FilePath& root_directory, bool enable_basic_auth) { |
419 websocket_server_.reset(new net::SpawnedTestServer( | 419 websocket_server_.reset(new net::SpawnedTestServer( |
420 net::SpawnedTestServer::TYPE_WS, | 420 net::SpawnedTestServer::TYPE_WS, |
421 net::SpawnedTestServer::kLocalhost, | 421 net::SpawnedTestServer::kLocalhost, |
422 root_directory)); | 422 root_directory)); |
| 423 websocket_server_->set_websocket_basic_auth(enable_basic_auth); |
423 | 424 |
424 if (!websocket_server_->Start()) | 425 if (!websocket_server_->Start()) |
425 return false; | 426 return false; |
426 | 427 |
427 test_config_->SetInteger(kTestWebSocketPort, | 428 test_config_->SetInteger(kTestWebSocketPort, |
428 websocket_server_->host_port_pair().port()); | 429 websocket_server_->host_port_pair().port()); |
429 | 430 |
430 return true; | 431 return true; |
431 } | 432 } |
432 | 433 |
(...skipping 13 matching lines...) Expand all Loading... |
446 } | 447 } |
447 | 448 |
448 void ExtensionApiTest::SetUpCommandLine(base::CommandLine* command_line) { | 449 void ExtensionApiTest::SetUpCommandLine(base::CommandLine* command_line) { |
449 ExtensionBrowserTest::SetUpCommandLine(command_line); | 450 ExtensionBrowserTest::SetUpCommandLine(command_line); |
450 test_data_dir_ = test_data_dir_.AppendASCII("api_test"); | 451 test_data_dir_ = test_data_dir_.AppendASCII("api_test"); |
451 // Backgrounded renderer processes run at a lower priority, causing the | 452 // Backgrounded renderer processes run at a lower priority, causing the |
452 // tests to take more time to complete. Disable backgrounding so that the | 453 // tests to take more time to complete. Disable backgrounding so that the |
453 // tests don't time out. | 454 // tests don't time out. |
454 command_line->AppendSwitch(switches::kDisableRendererBackgrounding); | 455 command_line->AppendSwitch(switches::kDisableRendererBackgrounding); |
455 } | 456 } |
OLD | NEW |