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

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

Issue 2704153002: ParsedContentType refactoring (Closed)
Patch Set: fix Created 3 years, 10 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/ParsedContentTypeTest.cpp
diff --git a/third_party/WebKit/Source/platform/network/ParsedContentTypeTest.cpp b/third_party/WebKit/Source/platform/network/ParsedContentTypeTest.cpp
index 64ed0d18e5c1b125cfdbd2435def0b4b10279801..ca7326de24d294409cbadd5347d50fbb7245d8df 100644
--- a/third_party/WebKit/Source/platform/network/ParsedContentTypeTest.cpp
+++ b/third_party/WebKit/Source/platform/network/ParsedContentTypeTest.cpp
@@ -47,24 +47,25 @@ TEST(ParsedContentTypeTest, InvalidMimeTypeWithCharset) {
}
TEST(ParsedContentTypeTest, Validity) {
- EXPECT_TRUE(isValidContentType("text/plain"));
- EXPECT_TRUE(isValidContentType("text/plain; charset=utf-8"));
- EXPECT_TRUE(isValidContentType(" text/plain "));
- EXPECT_TRUE(isValidContentType(" text/plain;charset=utf-8 "));
- EXPECT_TRUE(isValidContentType("unknown/unknown"));
- EXPECT_TRUE(isValidContentType("unknown/unknown; charset=unknown"));
- EXPECT_TRUE(isValidContentType("x/y;\"z=\\\"q;t\"=\"ttx&r=z;;kd==\""));
-
- EXPECT_FALSE(isValidContentType("text/plain\r"));
- EXPECT_FALSE(isValidContentType("text/plain\n"));
- EXPECT_FALSE(isValidContentType(""));
- EXPECT_FALSE(isValidContentType(" "));
- EXPECT_FALSE(isValidContentType("text/plain;"));
- EXPECT_FALSE(isValidContentType("text/plain; "));
- EXPECT_FALSE(isValidContentType("text/plain; charset"));
- EXPECT_FALSE(isValidContentType("text/plain; charset;"));
- EXPECT_FALSE(isValidContentType("x/y;\"xx"));
- EXPECT_FALSE(isValidContentType("x/y;\"xx=y"));
+ EXPECT_TRUE(ParsedContentType::isValid("text/plain"));
+ EXPECT_TRUE(ParsedContentType::isValid("text/plain; charset=utf-8"));
+ EXPECT_TRUE(ParsedContentType::isValid(" text/plain "));
+ EXPECT_TRUE(ParsedContentType::isValid(" text/plain;charset=utf-8 "));
+ EXPECT_TRUE(ParsedContentType::isValid("unknown/unknown"));
+ EXPECT_TRUE(ParsedContentType::isValid("unknown/unknown; charset=unknown"));
+ EXPECT_TRUE(
+ ParsedContentType::isValid("x/y;\"z=\\\"q;t\"=\"ttx&r=z;;kd==\""));
+
+ EXPECT_FALSE(ParsedContentType::isValid("text/plain\r"));
+ EXPECT_FALSE(ParsedContentType::isValid("text/plain\n"));
+ EXPECT_FALSE(ParsedContentType::isValid(""));
+ EXPECT_FALSE(ParsedContentType::isValid(" "));
+ EXPECT_FALSE(ParsedContentType::isValid("text/plain;"));
+ EXPECT_FALSE(ParsedContentType::isValid("text/plain; "));
+ EXPECT_FALSE(ParsedContentType::isValid("text/plain; charset"));
+ EXPECT_FALSE(ParsedContentType::isValid("text/plain; charset;"));
+ EXPECT_FALSE(ParsedContentType::isValid("x/y;\"xx"));
+ EXPECT_FALSE(ParsedContentType::isValid("x/y;\"xx=y"));
// TODO(yhirano): Add tests for non-tokens. They are currently accepted.
}

Powered by Google App Engine
This is Rietveld 408576698