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

Side by Side Diff: content/browser/shared_worker/worker_browsertest.cc

Issue 889463003: GURL::Replacements methods accept a StringPiece instead of std::string&. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase (fixed some merge conflicts). Created 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 111 }
112 112
113 IN_PROC_BROWSER_TEST_F(WorkerTest, WebSocketSharedWorker) { 113 IN_PROC_BROWSER_TEST_F(WorkerTest, WebSocketSharedWorker) {
114 // Launch WebSocket server. 114 // Launch WebSocket server.
115 net::SpawnedTestServer ws_server(net::SpawnedTestServer::TYPE_WS, 115 net::SpawnedTestServer ws_server(net::SpawnedTestServer::TYPE_WS,
116 net::SpawnedTestServer::kLocalhost, 116 net::SpawnedTestServer::kLocalhost,
117 net::GetWebSocketTestDataDirectory()); 117 net::GetWebSocketTestDataDirectory());
118 ASSERT_TRUE(ws_server.Start()); 118 ASSERT_TRUE(ws_server.Start());
119 119
120 // Generate test URL. 120 // Generate test URL.
121 std::string scheme("http");
122 GURL::Replacements replacements; 121 GURL::Replacements replacements;
123 replacements.SetSchemeStr(scheme); 122 replacements.SetSchemeStr("http");
124 GURL url = ws_server.GetURL( 123 GURL url = ws_server.GetURL(
125 "websocket_shared_worker.html").ReplaceComponents(replacements); 124 "websocket_shared_worker.html").ReplaceComponents(replacements);
126 125
127 // Run test. 126 // Run test.
128 Shell* window = shell(); 127 Shell* window = shell();
129 const base::string16 expected_title = base::ASCIIToUTF16("OK"); 128 const base::string16 expected_title = base::ASCIIToUTF16("OK");
130 TitleWatcher title_watcher(window->web_contents(), expected_title); 129 TitleWatcher title_watcher(window->web_contents(), expected_title);
131 NavigateToURL(window, url); 130 NavigateToURL(window, url);
132 base::string16 final_title = title_watcher.WaitAndGetTitle(); 131 base::string16 final_title = title_watcher.WaitAndGetTitle();
133 EXPECT_EQ(expected_title, final_title); 132 EXPECT_EQ(expected_title, final_title);
134 } 133 }
135 134
136 IN_PROC_BROWSER_TEST_F(WorkerTest, PassMessagePortToSharedWorker) { 135 IN_PROC_BROWSER_TEST_F(WorkerTest, PassMessagePortToSharedWorker) {
137 RunTest("pass_messageport_to_sharedworker.html", ""); 136 RunTest("pass_messageport_to_sharedworker.html", "");
138 } 137 }
139 138
140 IN_PROC_BROWSER_TEST_F(WorkerTest, 139 IN_PROC_BROWSER_TEST_F(WorkerTest,
141 PassMessagePortToSharedWorkerDontWaitForConnect) { 140 PassMessagePortToSharedWorkerDontWaitForConnect) {
142 RunTest("pass_messageport_to_sharedworker_dont_wait_for_connect.html", ""); 141 RunTest("pass_messageport_to_sharedworker_dont_wait_for_connect.html", "");
143 } 142 }
144 143
145 } // namespace content 144 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698