OLD | NEW |
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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shlobj.h> | 9 #include <shlobj.h> |
10 #endif | 10 #endif |
(...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 explicit LocalHttpTestServer(const FilePath& document_root) | 1361 explicit LocalHttpTestServer(const FilePath& document_root) |
1362 : TestServer(TestServer::TYPE_HTTP, | 1362 : TestServer(TestServer::TYPE_HTTP, |
1363 ScopedCustomUrlRequestTestHttpHost::value(), | 1363 ScopedCustomUrlRequestTestHttpHost::value(), |
1364 document_root) {} | 1364 document_root) {} |
1365 LocalHttpTestServer() | 1365 LocalHttpTestServer() |
1366 : TestServer(TestServer::TYPE_HTTP, | 1366 : TestServer(TestServer::TYPE_HTTP, |
1367 ScopedCustomUrlRequestTestHttpHost::value(), | 1367 ScopedCustomUrlRequestTestHttpHost::value(), |
1368 FilePath()) {} | 1368 FilePath()) {} |
1369 }; | 1369 }; |
1370 | 1370 |
1371 TEST_F(URLRequestTest, DISABLED_DelayedCookieCallback) { | 1371 TEST_F(URLRequestTest, DelayedCookieCallback) { |
1372 LocalHttpTestServer test_server; | 1372 LocalHttpTestServer test_server; |
1373 ASSERT_TRUE(test_server.Start()); | 1373 ASSERT_TRUE(test_server.Start()); |
1374 | 1374 |
1375 TestURLRequestContext context; | 1375 TestURLRequestContext context; |
1376 scoped_refptr<DelayedCookieMonster> delayed_cm = | 1376 scoped_refptr<DelayedCookieMonster> delayed_cm = |
1377 new DelayedCookieMonster(); | 1377 new DelayedCookieMonster(); |
1378 scoped_refptr<CookieStore> cookie_store = delayed_cm; | 1378 scoped_refptr<CookieStore> cookie_store = delayed_cm; |
1379 context.set_cookie_store(delayed_cm); | 1379 context.set_cookie_store(delayed_cm); |
1380 | 1380 |
1381 // Set up a cookie. | 1381 // Set up a cookie. |
(...skipping 19 matching lines...) Expand all Loading... |
1401 req.Start(); | 1401 req.Start(); |
1402 MessageLoop::current()->Run(); | 1402 MessageLoop::current()->Run(); |
1403 | 1403 |
1404 EXPECT_TRUE(d.data_received().find("CookieToNotSend=1") | 1404 EXPECT_TRUE(d.data_received().find("CookieToNotSend=1") |
1405 != std::string::npos); | 1405 != std::string::npos); |
1406 EXPECT_EQ(0, network_delegate.blocked_get_cookies_count()); | 1406 EXPECT_EQ(0, network_delegate.blocked_get_cookies_count()); |
1407 EXPECT_EQ(0, network_delegate.blocked_set_cookie_count()); | 1407 EXPECT_EQ(0, network_delegate.blocked_set_cookie_count()); |
1408 } | 1408 } |
1409 } | 1409 } |
1410 | 1410 |
1411 // crbug.com/170247 | 1411 TEST_F(URLRequestTest, DoNotSendCookies) { |
1412 TEST_F(URLRequestTest, DISABLED_DoNotSendCookies) { | |
1413 LocalHttpTestServer test_server; | 1412 LocalHttpTestServer test_server; |
1414 ASSERT_TRUE(test_server.Start()); | 1413 ASSERT_TRUE(test_server.Start()); |
1415 | 1414 |
1416 // Set up a cookie. | 1415 // Set up a cookie. |
1417 { | 1416 { |
1418 TestNetworkDelegate network_delegate; | 1417 TestNetworkDelegate network_delegate; |
1419 default_context_.set_network_delegate(&network_delegate); | 1418 default_context_.set_network_delegate(&network_delegate); |
1420 TestDelegate d; | 1419 TestDelegate d; |
1421 URLRequest req(test_server.GetURL("set-cookie?CookieToNotSend=1"), | 1420 URLRequest req(test_server.GetURL("set-cookie?CookieToNotSend=1"), |
1422 &d, | 1421 &d, |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2046 return is_success; | 2045 return is_success; |
2047 } | 2046 } |
2048 | 2047 |
2049 LocalHttpTestServer test_server_; | 2048 LocalHttpTestServer test_server_; |
2050 }; | 2049 }; |
2051 | 2050 |
2052 // In this unit test, we're using the HTTPTestServer as a proxy server and | 2051 // In this unit test, we're using the HTTPTestServer as a proxy server and |
2053 // issuing a CONNECT request with the magic host name "www.redirect.com". | 2052 // issuing a CONNECT request with the magic host name "www.redirect.com". |
2054 // The HTTPTestServer will return a 302 response, which we should not | 2053 // The HTTPTestServer will return a 302 response, which we should not |
2055 // follow. | 2054 // follow. |
2056 // flaky: crbug.com/96594 | 2055 TEST_F(URLRequestTestHTTP, ProxyTunnelRedirectTest) { |
2057 TEST_F(URLRequestTestHTTP, DISABLED_ProxyTunnelRedirectTest) { | |
2058 ASSERT_TRUE(test_server_.Start()); | 2056 ASSERT_TRUE(test_server_.Start()); |
2059 | 2057 |
2060 TestNetworkDelegate network_delegate; // Must outlive URLRequest. | 2058 TestNetworkDelegate network_delegate; // Must outlive URLRequest. |
2061 TestURLRequestContextWithProxy context( | 2059 TestURLRequestContextWithProxy context( |
2062 test_server_.host_port_pair().ToString(), | 2060 test_server_.host_port_pair().ToString(), |
2063 &network_delegate); | 2061 &network_delegate); |
2064 | 2062 |
2065 TestDelegate d; | 2063 TestDelegate d; |
2066 { | 2064 { |
2067 URLRequest r(GURL("https://www.redirect.com/"), &d, &context); | 2065 URLRequest r(GURL("https://www.redirect.com/"), &d, &context); |
(...skipping 2776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4844 public: | 4842 public: |
4845 URLRequestTestFTP() | 4843 URLRequestTestFTP() |
4846 : test_server_(TestServer::TYPE_FTP, TestServer::kLocalhost, FilePath()) { | 4844 : test_server_(TestServer::TYPE_FTP, TestServer::kLocalhost, FilePath()) { |
4847 } | 4845 } |
4848 | 4846 |
4849 protected: | 4847 protected: |
4850 TestServer test_server_; | 4848 TestServer test_server_; |
4851 }; | 4849 }; |
4852 | 4850 |
4853 // Make sure an FTP request using an unsafe ports fails. | 4851 // Make sure an FTP request using an unsafe ports fails. |
4854 TEST_F(URLRequestTestFTP, DISABLED_UnsafePort) { | 4852 TEST_F(URLRequestTestFTP, UnsafePort) { |
4855 ASSERT_TRUE(test_server_.Start()); | 4853 ASSERT_TRUE(test_server_.Start()); |
4856 | 4854 |
4857 URLRequestJobFactoryImpl job_factory; | 4855 URLRequestJobFactoryImpl job_factory; |
4858 | 4856 |
4859 GURL url("ftp://127.0.0.1:7"); | 4857 GURL url("ftp://127.0.0.1:7"); |
4860 FtpProtocolHandler ftp_protocol_handler( | 4858 FtpProtocolHandler ftp_protocol_handler( |
4861 default_context_.ftp_transaction_factory(), | 4859 default_context_.ftp_transaction_factory(), |
4862 default_context_.ftp_auth_cache()); | 4860 default_context_.ftp_auth_cache()); |
4863 job_factory.SetProtocolHandler( | 4861 job_factory.SetProtocolHandler( |
4864 "ftp", | 4862 "ftp", |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5190 | 5188 |
5191 EXPECT_FALSE(r.is_pending()); | 5189 EXPECT_FALSE(r.is_pending()); |
5192 EXPECT_EQ(1, d->response_started_count()); | 5190 EXPECT_EQ(1, d->response_started_count()); |
5193 EXPECT_FALSE(d->received_data_before_response()); | 5191 EXPECT_FALSE(d->received_data_before_response()); |
5194 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); | 5192 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); |
5195 } | 5193 } |
5196 } | 5194 } |
5197 #endif // !defined(DISABLE_FTP_SUPPORT) | 5195 #endif // !defined(DISABLE_FTP_SUPPORT) |
5198 | 5196 |
5199 } // namespace net | 5197 } // namespace net |
OLD | NEW |