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

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

Issue 149710: Fix 307 redirects of a POST request to actually send the body again, and add ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « net/url_request/url_request.cc ('k') | net\data\url_request_unittest\redirect307-to-echo » ('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 (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 "net/url_request/url_request_unittest.h" 5 #include "net/url_request/url_request_unittest.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <windows.h> 10 #include <windows.h>
(...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1335 EXPECT_FALSE(ContainsString(data, "Content-Length:")); 1335 EXPECT_FALSE(ContainsString(data, "Content-Length:"));
1336 EXPECT_FALSE(ContainsString(data, "Content-Type:")); 1336 EXPECT_FALSE(ContainsString(data, "Content-Type:"));
1337 EXPECT_FALSE(ContainsString(data, "Origin:")); 1337 EXPECT_FALSE(ContainsString(data, "Origin:"));
1338 1338
1339 // These extra request headers should not have been stripped. 1339 // These extra request headers should not have been stripped.
1340 EXPECT_TRUE(ContainsString(data, "Accept:")); 1340 EXPECT_TRUE(ContainsString(data, "Accept:"));
1341 EXPECT_TRUE(ContainsString(data, "Accept-Language:")); 1341 EXPECT_TRUE(ContainsString(data, "Accept-Language:"));
1342 EXPECT_TRUE(ContainsString(data, "Accept-Charset:")); 1342 EXPECT_TRUE(ContainsString(data, "Accept-Charset:"));
1343 } 1343 }
1344 1344
1345 // TODO(darin): Re-enable this test once bug 16832 is fixed. 1345 TEST_F(URLRequestTest, Post307RedirectPost) {
1346 TEST_F(URLRequestTest, DISABLED_Post307RedirectPost) {
1347 const char kData[] = "hello world"; 1346 const char kData[] = "hello world";
1348 scoped_refptr<HTTPTestServer> server = 1347 scoped_refptr<HTTPTestServer> server =
1349 HTTPTestServer::CreateServer(L"net/data/url_request_unittest", NULL); 1348 HTTPTestServer::CreateServer(L"net/data/url_request_unittest", NULL);
1350 ASSERT_TRUE(NULL != server.get()); 1349 ASSERT_TRUE(NULL != server.get());
1351 TestDelegate d; 1350 TestDelegate d;
1352 TestURLRequest req(server->TestServerPage("files/redirect307-to-echo"), 1351 TestURLRequest req(server->TestServerPage("files/redirect307-to-echo"),
1353 &d); 1352 &d);
1354 req.set_method("POST"); 1353 req.set_method("POST");
1355 req.set_upload(CreateSimpleUploadData(kData).get()); 1354 req.set_upload(CreateSimpleUploadData(kData).get());
1356 req.SetExtraRequestHeaders( 1355 req.SetExtraRequestHeaders(
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
1902 1901
1903 int64 file_size = 0; 1902 int64 file_size = 0;
1904 file_util::GetFileSize(app_path, &file_size); 1903 file_util::GetFileSize(app_path, &file_size);
1905 1904
1906 EXPECT_FALSE(r.is_pending()); 1905 EXPECT_FALSE(r.is_pending());
1907 EXPECT_EQ(1, d.response_started_count()); 1906 EXPECT_EQ(1, d.response_started_count());
1908 EXPECT_FALSE(d.received_data_before_response()); 1907 EXPECT_FALSE(d.received_data_before_response());
1909 EXPECT_EQ(d.bytes_received(), 0); 1908 EXPECT_EQ(d.bytes_received(), 0);
1910 } 1909 }
1911 } 1910 }
OLDNEW
« no previous file with comments | « net/url_request/url_request.cc ('k') | net\data\url_request_unittest\redirect307-to-echo » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698