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

Side by Side Diff: content/browser/worker_host/test/worker_browsertest.cc

Issue 12210088: Make the TestServer use an absolute document root path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: testserver uses absolute docroot path Created 7 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 | Annotate | Revision Log
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 "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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698