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

Unified Diff: net/url_request/url_request_unittest.cc

Issue 12463021: Stop sending Accept-Charset HTTP header. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync (r188089) Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/url_request/url_request_test_util.cc ('k') | sync/internal_api/http_bridge.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_unittest.cc
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 8ef10a853c89da14750260253cc58b37c36f1406..24572a92a0989e6bd41469c00ac8d88e64fbec82 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -3919,7 +3919,7 @@ TEST_F(URLRequestTestHTTP, InterceptPost307RedirectPost) {
TEST_F(URLRequestTestHTTP, DefaultAcceptLanguage) {
ASSERT_TRUE(test_server_.Start());
- StaticHttpUserAgentSettings settings("en", EmptyString(), EmptyString());
+ StaticHttpUserAgentSettings settings("en", EmptyString());
TestNetworkDelegate network_delegate; // Must outlive URLRequests.
TestURLRequestContext context(true);
context.set_network_delegate(&network_delegate);
@@ -3938,8 +3938,7 @@ TEST_F(URLRequestTestHTTP, DefaultAcceptLanguage) {
TEST_F(URLRequestTestHTTP, EmptyAcceptLanguage) {
ASSERT_TRUE(test_server_.Start());
- StaticHttpUserAgentSettings settings(
- EmptyString(), EmptyString(), EmptyString());
+ StaticHttpUserAgentSettings settings(EmptyString(), EmptyString());
TestNetworkDelegate network_delegate; // Must outlive URLRequests.
TestURLRequestContext context(true);
context.set_network_delegate(&network_delegate);
@@ -4006,52 +4005,8 @@ TEST_F(URLRequestTestHTTP, OverrideAcceptEncoding) {
EXPECT_TRUE(ContainsString(d.data_received(), "identity"));
}
-// Check that default A-C header is sent.
-TEST_F(URLRequestTestHTTP, DefaultAcceptCharset) {
- ASSERT_TRUE(test_server_.Start());
-
- StaticHttpUserAgentSettings settings(EmptyString(), "en", EmptyString());
- TestNetworkDelegate network_delegate; // Must outlive URLRequests.
- TestURLRequestContext context(true);
- context.set_network_delegate(&network_delegate);
- context.set_http_user_agent_settings(&settings);
- context.Init();
-
- TestDelegate d;
- URLRequest req(test_server_.GetURL("echoheader?Accept-Charset"),
- &d,
- &context);
- req.Start();
- MessageLoop::current()->Run();
- EXPECT_EQ("en", d.data_received());
-}
-
-// Check that an empty A-C header is not sent. http://crbug.com/77365.
-TEST_F(URLRequestTestHTTP, EmptyAcceptCharset) {
- ASSERT_TRUE(test_server_.Start());
-
- StaticHttpUserAgentSettings settings(
- EmptyString(), EmptyString(), EmptyString());
- TestNetworkDelegate network_delegate; // Must outlive URLRequests.
- TestURLRequestContext context(true);
- context.set_network_delegate(&network_delegate);
- context.Init();
- // We override the accepted charset after initialization because empty
- // entries get overridden otherwise.
- context.set_http_user_agent_settings(&settings);
-
- TestDelegate d;
- URLRequest req(test_server_.GetURL("echoheader?Accept-Charset"),
- &d,
- &context);
- req.Start();
- MessageLoop::current()->Run();
- EXPECT_EQ("None", d.data_received());
-}
-
-// Check that if request overrides the A-C header, the default is not appended.
-// See http://crbug.com/20894
-TEST_F(URLRequestTestHTTP, OverrideAcceptCharset) {
+// Check that setting the A-C header sends the proper header.
+TEST_F(URLRequestTestHTTP, SetAcceptCharset) {
ASSERT_TRUE(test_server_.Start());
TestDelegate d;
« no previous file with comments | « net/url_request/url_request_test_util.cc ('k') | sync/internal_api/http_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698