Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Side by Side Diff: chrome/browser/extensions/extension_apitest.cc

Issue 2449913002: Support WebSocket in WebRequest API. (Closed)
Patch Set: git cl format Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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,
419 bool enable_basic_auth) {
419 websocket_server_.reset(new net::SpawnedTestServer( 420 websocket_server_.reset(new net::SpawnedTestServer(
420 net::SpawnedTestServer::TYPE_WS, 421 net::SpawnedTestServer::TYPE_WS,
421 net::SpawnedTestServer::kLocalhost, 422 net::SpawnedTestServer::kLocalhost,
422 root_directory)); 423 root_directory));
424 websocket_server_->set_websocket_basic_auth(enable_basic_auth);
423 425
424 if (!websocket_server_->Start()) 426 if (!websocket_server_->Start())
425 return false; 427 return false;
426 428
427 test_config_->SetInteger(kTestWebSocketPort, 429 test_config_->SetInteger(kTestWebSocketPort,
428 websocket_server_->host_port_pair().port()); 430 websocket_server_->host_port_pair().port());
429 431
430 return true; 432 return true;
431 } 433 }
432 434
(...skipping 13 matching lines...) Expand all
446 } 448 }
447 449
448 void ExtensionApiTest::SetUpCommandLine(base::CommandLine* command_line) { 450 void ExtensionApiTest::SetUpCommandLine(base::CommandLine* command_line) {
449 ExtensionBrowserTest::SetUpCommandLine(command_line); 451 ExtensionBrowserTest::SetUpCommandLine(command_line);
450 test_data_dir_ = test_data_dir_.AppendASCII("api_test"); 452 test_data_dir_ = test_data_dir_.AppendASCII("api_test");
451 // Backgrounded renderer processes run at a lower priority, causing the 453 // Backgrounded renderer processes run at a lower priority, causing the
452 // tests to take more time to complete. Disable backgrounding so that the 454 // tests to take more time to complete. Disable backgrounding so that the
453 // tests don't time out. 455 // tests don't time out.
454 command_line->AppendSwitch(switches::kDisableRendererBackgrounding); 456 command_line->AppendSwitch(switches::kDisableRendererBackgrounding);
455 } 457 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_apitest.h ('k') | chrome/common/extensions/docs/templates/intros/webRequest.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698