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

Unified Diff: Source/platform/network/HTTPParsersTest.cpp

Issue 1018903002: Show deprecation warnings for header values in XHR according to RFC 7230 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 | « Source/platform/network/HTTPParsers.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/network/HTTPParsersTest.cpp
diff --git a/Source/platform/network/HTTPParsersTest.cpp b/Source/platform/network/HTTPParsersTest.cpp
index 0431b3f13dbc59bf322202c750f3e0d3df0a0573..ab57dfc66e04e3e99d1576e4e3f854f608e3ebe7 100644
--- a/Source/platform/network/HTTPParsersTest.cpp
+++ b/Source/platform/network/HTTPParsersTest.cpp
@@ -239,5 +239,29 @@ TEST(HTTPParsersTest, CommaDelimitedHeaderSet)
EXPECT_TRUE(set2.contains("fo\to"));
}
+TEST(HTTPParsersTest, HTTPFieldContent)
+{
+ const UChar hiraganaA[2] = { 0x3042, 0 };
+
+ EXPECT_TRUE(blink::isValidHTTPFieldContentRFC7230("\xd0\xa1"));
+ EXPECT_TRUE(blink::isValidHTTPFieldContentRFC7230("t t"));
+ EXPECT_TRUE(blink::isValidHTTPFieldContentRFC7230("t\tt"));
+ EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230(" "));
+ EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230(""));
+ EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230("\x7f"));
+ EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230("t\rt"));
+ EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230("t\nt"));
+ EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230("t\bt"));
+ EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230("t\vt"));
+ EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230(" t"));
+ EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230("t "));
+ EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230(String("t\0t", 3)));
+ EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230(String("\0", 1)));
+ EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230(String("test \0, 6")));
+ EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230(String("test ")));
+ EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230("test\r\n data"));
+ EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230(String(hiraganaA)));
+}
+
} // namespace blink
« no previous file with comments | « Source/platform/network/HTTPParsers.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698