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

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

Issue 2889033002: Better header value parsing for Server-Timing. (Closed)
Patch Set: test escaped double-quotes Created 3 years, 7 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
Index: third_party/WebKit/Source/platform/network/HTTPParsersTest.cpp
diff --git a/third_party/WebKit/Source/platform/network/HTTPParsersTest.cpp b/third_party/WebKit/Source/platform/network/HTTPParsersTest.cpp
index 8be3e53cec47f1c1b7f0d98589cb331c14938f09..6657b2559de71aea673361dc9271547d9f80a0d9 100644
--- a/third_party/WebKit/Source/platform/network/HTTPParsersTest.cpp
+++ b/third_party/WebKit/Source/platform/network/HTTPParsersTest.cpp
@@ -500,18 +500,6 @@ TEST(HTTPParsersTest, ParseMultipartHeadersContentCharset) {
EXPECT_EQ("utf-8", response.TextEncodingName());
}
-TEST(HTTPParsersTest, CheckDoubleQuotedString) {
- EXPECT_EQ(CheckDoubleQuotedString(""), "");
- EXPECT_EQ(CheckDoubleQuotedString("\""), "\"");
- EXPECT_EQ(CheckDoubleQuotedString("\"\""), "");
- EXPECT_EQ(CheckDoubleQuotedString("foo"), "foo");
- EXPECT_EQ(CheckDoubleQuotedString("\"foo"), "\"foo");
- EXPECT_EQ(CheckDoubleQuotedString("foo\""), "foo\"");
- EXPECT_EQ(CheckDoubleQuotedString("\"foo\""), "foo");
- EXPECT_EQ(CheckDoubleQuotedString("\"foo\"bar\""), "foo\"bar");
- EXPECT_EQ(CheckDoubleQuotedString("\"foo\\bar\""), "foobar");
-}
-
void testServerTimingHeader(const char* headerValue,
Vector<Vector<String>> expectedResults) {
std::unique_ptr<ServerTimingHeaderVector> results =
@@ -997,6 +985,13 @@ TEST(HTTPParsersTest, ParseServerTimingHeader) {
{{"metric1", "12.3", "description1"},
{"metric2", "45.6", "description2"},
{"metric3", "78.9", "description3"}});
+
+ // quoted-string
+ testServerTimingHeader("metric;\"\"", {{"metric", "0", ""}});
+ testServerTimingHeader("metric;\"\"\"", {{"metric", "0", ""}});
+ testServerTimingHeader("metric;\"\\\"\"", {{"metric", "0", "\""}});
+ testServerTimingHeader("metric;\"\\\\\"\"", {{"metric", "0", "\\"}});
+ testServerTimingHeader("metric;\"\\\\\\\"\"", {{"metric", "0", "\\\""}});
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698