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

Unified Diff: net/http/http_util_unittest.cc

Issue 17340: Add q-values to languages in Accept-Language HTTP header to be compatible wit... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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
« net/http/http_util.h ('K') | « net/http/http_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_util_unittest.cc
===================================================================
--- net/http/http_util_unittest.cc (revision 7989)
+++ net/http/http_util_unittest.cc (working copy)
@@ -326,7 +326,7 @@
// Unterminated status line.
{
"HTTP/1.0 200 OK",
-
+
"HTTP/1.0 200 OK||"
},
@@ -475,3 +475,19 @@
EXPECT_EQ(expected_path, HttpUtil::PathForRequest(url));
}
}
+
+TEST(HttpUtilTest, GenerateAcceptLanguageHeader) {
+ EXPECT_EQ(std::string("en-US,fr;q=0.8,de;q=0.6"),
+ HttpUtil::GenerateAcceptLanguageHeader("en-US,fr,de"));
+ EXPECT_EQ(std::string("en-US,fr;q=0.8,de;q=0.6,ko;q=0.4,zh-CN;q=0.2,"
+ "ja;q=0.2"),
+ HttpUtil::GenerateAcceptLanguageHeader("en-US,fr,de,ko,zh-CN,ja"));
+}
+
+TEST(HttpUtilTest, GenerateAcceptCharsetHeader) {
+ EXPECT_EQ(std::string("utf-8,*;q=0.5"),
+ HttpUtil::GenerateAcceptCharsetHeader("utf-8"));
+ EXPECT_EQ(std::string("EUC-JP,utf-8;q=0.7,*;q=0.3"),
+ HttpUtil::GenerateAcceptCharsetHeader("EUC-JP"));
+}
+
« net/http/http_util.h ('K') | « net/http/http_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698