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

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

Issue 2889033002: Better header value parsing for Server-Timing. (Closed)
Patch Set: init duration as 0.0 Created 3 years, 6 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 c4b37f672c695172756405d8957f929c233b2506..bd61d015edc28601138d3930d0b327b50508c1ab 100644
--- a/third_party/WebKit/Source/platform/network/HTTPParsersTest.cpp
+++ b/third_party/WebKit/Source/platform/network/HTTPParsersTest.cpp
@@ -477,18 +477,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 =
@@ -974,6 +962,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