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

Unified Diff: net/url_request/url_request_data_job_unittest.cc

Issue 555383003: [Regression fix] [Data URI parser] Accept data URI with invalid mediatype data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit tests Created 6 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 | « net/base/data_url_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_data_job_unittest.cc
diff --git a/net/url_request/url_request_data_job_unittest.cc b/net/url_request/url_request_data_job_unittest.cc
index 81903be2516828c7772a99ea50afd0f760f16e61..49a7ecd92c3cbe80ed076497b0359324e98a3e84 100644
--- a/net/url_request/url_request_data_job_unittest.cc
+++ b/net/url_request/url_request_data_job_unittest.cc
@@ -63,12 +63,17 @@ TEST(BuildResponseTest, InvalidMimeType) {
scoped_refptr<net::HttpResponseHeaders> headers(
new net::HttpResponseHeaders(std::string()));
- // MIME type contains delimiters. Must be rejected.
+ // MIME type contains delimiters. Must be accepted but Content-Type header
+ // should be generated as if the mediatype was text/plain.
EXPECT_EQ(
- net::ERR_INVALID_URL,
+ net::OK,
URLRequestDataJob::BuildResponse(
GURL("data:f(o/b)r,test"),
&mime_type, &charset, &data, headers.get()));
+
+ std::string value;
+ EXPECT_TRUE(headers->GetNormalizedHeader("Content-Type", &value));
+ EXPECT_EQ(value, "text/plain;charset=US-ASCII");
}
TEST(BuildResponseTest, InvalidCharset) {
« no previous file with comments | « net/base/data_url_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698