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

Side by Side Diff: net/url_request/url_request_unittest.cc

Issue 9430050: Remove usage of a deprecated TestServer constructor. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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 (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 <shlobj.h> 8 #include <shlobj.h>
9 #include <windows.h> 9 #include <windows.h>
10 #endif 10 #endif
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 } 1204 }
1205 } 1205 }
1206 } 1206 }
1207 } 1207 }
1208 1208
1209 // This test was disabled because it made chrome_frame_net_tests hang 1209 // This test was disabled because it made chrome_frame_net_tests hang
1210 // (see bug 102991). 1210 // (see bug 102991).
1211 TEST_F(URLRequestTestHTTP, DISABLED_HTTPSToHTTPRedirectNoRefererTest) { 1211 TEST_F(URLRequestTestHTTP, DISABLED_HTTPSToHTTPRedirectNoRefererTest) {
1212 ASSERT_TRUE(test_server_.Start()); 1212 ASSERT_TRUE(test_server_.Start());
1213 1213
1214 TestServer https_test_server( 1214 TestServer https_test_server(TestServer::TYPE_HTTPS,
1215 TestServer::TYPE_HTTPS, FilePath(FILE_PATH_LITERAL("net/data/ssl"))); 1215 TestServer::kLocalhost,
1216 FilePath(FILE_PATH_LITERAL("net/data/ssl")));
1216 ASSERT_TRUE(https_test_server.Start()); 1217 ASSERT_TRUE(https_test_server.Start());
1217 1218
1218 // An https server is sent a request with an https referer, 1219 // An https server is sent a request with an https referer,
1219 // and responds with a redirect to an http url. The http 1220 // and responds with a redirect to an http url. The http
1220 // server should not be sent the referer. 1221 // server should not be sent the referer.
1221 GURL http_destination = test_server_.GetURL(""); 1222 GURL http_destination = test_server_.GetURL("");
1222 TestDelegate d; 1223 TestDelegate d;
1223 TestURLRequest req(https_test_server.GetURL( 1224 TestURLRequest req(https_test_server.GetURL(
1224 "server-redirect?" + http_destination.spec()), &d); 1225 "server-redirect?" + http_destination.spec()), &d);
1225 req.set_context(default_context_); 1226 req.set_context(default_context_);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1267 1268
1268 protected: 1269 protected:
1269 TestNetworkDelegate default_network_delegate_; // must outlive URLRequest 1270 TestNetworkDelegate default_network_delegate_; // must outlive URLRequest
1270 scoped_refptr<TestURLRequestContext> default_context_; 1271 scoped_refptr<TestURLRequestContext> default_context_;
1271 }; 1272 };
1272 1273
1273 // This test was disabled because it made chrome_frame_net_tests hang 1274 // This test was disabled because it made chrome_frame_net_tests hang
1274 // (see bug 102991). 1275 // (see bug 102991).
1275 TEST_F(HTTPSRequestTest, DISABLED_HTTPSGetTest) { 1276 TEST_F(HTTPSRequestTest, DISABLED_HTTPSGetTest) {
1276 TestServer test_server(TestServer::TYPE_HTTPS, 1277 TestServer test_server(TestServer::TYPE_HTTPS,
1278 TestServer::kLocalhost,
1277 FilePath(FILE_PATH_LITERAL("net/data/ssl"))); 1279 FilePath(FILE_PATH_LITERAL("net/data/ssl")));
1278 ASSERT_TRUE(test_server.Start()); 1280 ASSERT_TRUE(test_server.Start());
1279 1281
1280 TestDelegate d; 1282 TestDelegate d;
1281 { 1283 {
1282 TestURLRequest r(test_server.GetURL(""), &d); 1284 TestURLRequest r(test_server.GetURL(""), &d);
1283 r.set_context(default_context_); 1285 r.set_context(default_context_);
1284 r.Start(); 1286 r.Start();
1285 EXPECT_TRUE(r.is_pending()); 1287 EXPECT_TRUE(r.is_pending());
1286 1288
(...skipping 2352 matching lines...) Expand 10 before | Expand all | Expand 10 after
3639 req.set_context(new TestURLRequestContext()); 3641 req.set_context(new TestURLRequestContext());
3640 req.set_context(default_context_); 3642 req.set_context(default_context_);
3641 req.Start(); 3643 req.Start();
3642 MessageLoop::current()->Run(); 3644 MessageLoop::current()->Run();
3643 EXPECT_EQ("", d.data_received()); 3645 EXPECT_EQ("", d.data_received());
3644 EXPECT_EQ(1, default_network_delegate_.completed_requests()); 3646 EXPECT_EQ(1, default_network_delegate_.completed_requests());
3645 } 3647 }
3646 3648
3647 class URLRequestTestFTP : public URLRequestTest { 3649 class URLRequestTestFTP : public URLRequestTest {
3648 public: 3650 public:
3649 URLRequestTestFTP() : test_server_(TestServer::TYPE_FTP, FilePath()) { 3651 URLRequestTestFTP()
3652 : test_server_(TestServer::TYPE_FTP, TestServer::kLocalhost, FilePath()) {
eroman 2012/02/23 21:06:19 I believe you want 4 spaces here.
3650 } 3653 }
3651 3654
3652 protected: 3655 protected:
3653 TestServer test_server_; 3656 TestServer test_server_;
3654 }; 3657 };
3655 3658
3656 // Flaky, see http://crbug.com/25045. 3659 // Flaky, see http://crbug.com/25045.
3657 TEST_F(URLRequestTestFTP, DISABLED_FTPDirectoryListing) { 3660 TEST_F(URLRequestTestFTP, DISABLED_FTPDirectoryListing) {
3658 ASSERT_TRUE(test_server_.Start()); 3661 ASSERT_TRUE(test_server_.Start());
3659 3662
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
4136 req.SetExtraRequestHeaders(headers); 4139 req.SetExtraRequestHeaders(headers);
4137 req.Start(); 4140 req.Start();
4138 MessageLoop::current()->Run(); 4141 MessageLoop::current()->Run();
4139 // If the net tests are being run with ChromeFrame then we need to allow for 4142 // If the net tests are being run with ChromeFrame then we need to allow for
4140 // the 'chromeframe' suffix which is added to the user agent before the 4143 // the 'chromeframe' suffix which is added to the user agent before the
4141 // closing parentheses. 4144 // closing parentheses.
4142 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true)); 4145 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true));
4143 } 4146 }
4144 4147
4145 } // namespace net 4148 } // namespace net
OLDNEW
« chrome/browser/net/network_stats_unittest.cc ('K') | « net/socket/ssl_client_socket_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698