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

Side by Side Diff: net/websockets/websocket_end_to_end_test.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
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | url/gurl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // End-to-end tests for WebSocket. 5 // End-to-end tests for WebSocket.
6 // 6 //
7 // A python server is (re)started for each test, which is moderately 7 // A python server is (re)started for each test, which is moderately
8 // inefficient. However, it makes these tests a good fit for scenarios which 8 // inefficient. However, it makes these tests a good fit for scenarios which
9 // require special server configurations. 9 // require special server configurations.
10 10
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 proxy_server.host_port_pair().ToString() + ";" + 331 proxy_server.host_port_pair().ToString() + ";" +
332 "http=" + proxy_server.host_port_pair().ToString(); 332 "http=" + proxy_server.host_port_pair().ToString();
333 scoped_ptr<ProxyService> proxy_service( 333 scoped_ptr<ProxyService> proxy_service(
334 ProxyService::CreateFixed(proxy_config)); 334 ProxyService::CreateFixed(proxy_config));
335 context_.set_proxy_service(proxy_service.get()); 335 context_.set_proxy_service(proxy_service.get());
336 InitialiseContext(); 336 InitialiseContext();
337 337
338 // The test server doesn't have an unauthenticated proxy mode. WebSockets 338 // The test server doesn't have an unauthenticated proxy mode. WebSockets
339 // cannot provide auth information that isn't already cached, so it's 339 // cannot provide auth information that isn't already cached, so it's
340 // necessary to preflight an HTTP request to authenticate against the proxy. 340 // necessary to preflight an HTTP request to authenticate against the proxy.
341 std::string scheme("http");
342 GURL::Replacements replacements; 341 GURL::Replacements replacements;
343 replacements.SetSchemeStr(scheme); 342 replacements.SetSchemeStr("http");
344 // It doesn't matter what the URL is, as long as it is an HTTP navigation. 343 // It doesn't matter what the URL is, as long as it is an HTTP navigation.
345 GURL http_page = 344 GURL http_page =
346 ws_server.GetURL("connect_check.html").ReplaceComponents(replacements); 345 ws_server.GetURL("connect_check.html").ReplaceComponents(replacements);
347 TestDelegate delegate; 346 TestDelegate delegate;
348 delegate.set_credentials( 347 delegate.set_credentials(
349 AuthCredentials(base::ASCIIToUTF16("foo"), base::ASCIIToUTF16("bar"))); 348 AuthCredentials(base::ASCIIToUTF16("foo"), base::ASCIIToUTF16("bar")));
350 { 349 {
351 scoped_ptr<URLRequest> request( 350 scoped_ptr<URLRequest> request(
352 context_.CreateRequest(http_page, DEFAULT_PRIORITY, &delegate, NULL)); 351 context_.CreateRequest(http_page, DEFAULT_PRIORITY, &delegate, NULL));
353 request->Start(); 352 request->Start();
(...skipping 20 matching lines...) Expand all
374 ASSERT_TRUE(ws_server.Start()); 373 ASSERT_TRUE(ws_server.Start());
375 InitialiseContext(); 374 InitialiseContext();
376 375
377 GURL ws_url = ws_server.GetURL("truncated-headers"); 376 GURL ws_url = ws_server.GetURL("truncated-headers");
378 EXPECT_FALSE(ConnectAndWait(ws_url)); 377 EXPECT_FALSE(ConnectAndWait(ws_url));
379 } 378 }
380 379
381 } // namespace 380 } // namespace
382 381
383 } // namespace net 382 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | url/gurl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698