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

Unified Diff: chrome/browser/net/proxy_browsertest.cc

Issue 11085039: WebSocket test server migration on browser_tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: protected -> private Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/proxy_browsertest.cc
diff --git a/chrome/browser/net/proxy_browsertest.cc b/chrome/browser/net/proxy_browsertest.cc
index dbfa42066a0e8108d240c8d5817d0d3c625ba1e9..a555384c05c4960e8311d90f412b37418c90f2fa 100644
--- a/chrome/browser/net/proxy_browsertest.cc
+++ b/chrome/browser/net/proxy_browsertest.cc
@@ -85,11 +85,10 @@ class ProxyBrowserTest : public InProcessBrowserTest {
// that requires basic authentication.
IN_PROC_BROWSER_TEST_F(ProxyBrowserTest, MAYBE_BasicAuthWSConnect) {
// Launch WebSocket server.
- content::TestWebSocketServer ws_server;
- int port = ws_server.UseRandomPort();
- FilePath ws_root_dir;
- ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &ws_root_dir));
- ASSERT_TRUE(ws_server.Start(ws_root_dir));
+ net::TestServer ws_server(net::TestServer::TYPE_WS,
+ net::TestServer::kLocalhost,
+ FilePath(FILE_PATH_LITERAL("net/data/websocket")));
+ ASSERT_TRUE(ws_server.Start());
content::WebContents* tab = chrome::GetActiveWebContents(browser());
content::NavigationController* controller = &tab->GetController();
@@ -105,10 +104,12 @@ IN_PROC_BROWSER_TEST_F(ProxyBrowserTest, MAYBE_BasicAuthWSConnect) {
// Visit a page that tries to establish WebSocket connection. The title
// of the page will be 'PASS' on success.
- // TODO(bashi): Add TestWebSocketServer::GetURL() instead creating url here.
- std::string url_path =
- StringPrintf("%s%d%s", "http://localhost:", port, "/ws.html");
- ui_test_utils::NavigateToURL(browser(), GURL(url_path));
+ std::string scheme("http");
+ GURL::Replacements replacements;
+ replacements.SetSchemeStr(scheme);
+ ui_test_utils::NavigateToURL(
+ browser(),
+ ws_server.GetURL("connect_check.html").ReplaceComponents(replacements));
const string16 result = watcher.WaitAndGetTitle();
EXPECT_TRUE(EqualsASCII(result, "PASS"));
« no previous file with comments | « no previous file | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698