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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 url = GetTestURL("single_shared_worker.html", query); | 447 url = GetTestURL("single_shared_worker.html", query); |
448 NavigateToURL(CreateBrowser(), url); | 448 NavigateToURL(CreateBrowser(), url); |
449 | 449 |
450 ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab + 1)); | 450 ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab + 1)); |
451 } | 451 } |
452 | 452 |
453 IN_PROC_BROWSER_TEST_F(WorkerTest, WebSocketSharedWorker) { | 453 IN_PROC_BROWSER_TEST_F(WorkerTest, WebSocketSharedWorker) { |
454 // Launch WebSocket server. | 454 // Launch WebSocket server. |
455 net::TestServer ws_server(net::TestServer::TYPE_WS, | 455 net::TestServer ws_server(net::TestServer::TYPE_WS, |
456 net::TestServer::kLocalhost, | 456 net::TestServer::kLocalhost, |
457 net::GetWebSocketTestDataDirectory()); | 457 net::TestServer::GetSourceRelativePath( |
| 458 net::GetWebSocketTestDataDirectory())); |
458 ASSERT_TRUE(ws_server.Start()); | 459 ASSERT_TRUE(ws_server.Start()); |
459 | 460 |
460 // Generate test URL. | 461 // Generate test URL. |
461 std::string scheme("http"); | 462 std::string scheme("http"); |
462 GURL::Replacements replacements; | 463 GURL::Replacements replacements; |
463 replacements.SetSchemeStr(scheme); | 464 replacements.SetSchemeStr(scheme); |
464 GURL url = ws_server.GetURL( | 465 GURL url = ws_server.GetURL( |
465 "websocket_shared_worker.html").ReplaceComponents(replacements); | 466 "websocket_shared_worker.html").ReplaceComponents(replacements); |
466 | 467 |
467 // Run test. | 468 // Run test. |
468 Shell* window = shell(); | 469 Shell* window = shell(); |
469 const string16 expected_title = ASCIIToUTF16("OK"); | 470 const string16 expected_title = ASCIIToUTF16("OK"); |
470 TitleWatcher title_watcher(window->web_contents(), expected_title); | 471 TitleWatcher title_watcher(window->web_contents(), expected_title); |
471 NavigateToURL(window, url); | 472 NavigateToURL(window, url); |
472 string16 final_title = title_watcher.WaitAndGetTitle(); | 473 string16 final_title = title_watcher.WaitAndGetTitle(); |
473 EXPECT_EQ(expected_title, final_title); | 474 EXPECT_EQ(expected_title, final_title); |
474 } | 475 } |
475 | 476 |
476 } // namespace content | 477 } // namespace content |
OLD | NEW |