OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |