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

Unified Diff: net/base/data_url_unittest.cc

Issue 664803003: Update from chromium a8e7c94b1b79a0948d05a1fcfff53391d22ce37a (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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/PRESUBMIT.py ('k') | net/base/escape.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/data_url_unittest.cc
diff --git a/net/base/data_url_unittest.cc b/net/base/data_url_unittest.cc
index 3876301cad5ecb441630d1669bbbc8a6fcac8118..bcb2b49ad6c013ea88d7614a04089539c979cf67 100644
--- a/net/base/data_url_unittest.cc
+++ b/net/base/data_url_unittest.cc
@@ -184,6 +184,44 @@ TEST(DataURLTest, Parse) {
"",
"" },
+ // BiDi control characters should be unescaped and preserved as is, and
+ // should not be replaced with % versions. In the below case, \xE2\x80\x8F
+ // is the RTL mark and the parsed text should preserve it as is.
+ {
+ "data:text/plain;charset=utf-8,\xE2\x80\x8Ftest",
+ true,
+ "text/plain",
+ "utf-8",
+ "\xE2\x80\x8Ftest"},
+
+ // Same as above but with Arabic text after RTL mark.
+ {
+ "data:text/plain;charset=utf-8,"
+ "\xE2\x80\x8F\xD8\xA7\xD8\xAE\xD8\xAA\xD8\xA8\xD8\xA7\xD8\xB1",
+ true,
+ "text/plain",
+ "utf-8",
+ "\xE2\x80\x8F\xD8\xA7\xD8\xAE\xD8\xAA\xD8\xA8\xD8\xA7\xD8\xB1"},
+
+ // RTL mark encoded as %E2%80%8F should be unescaped too. Note that when
+ // wrapped in a GURL, this URL and the next effectively become the same as
+ // the previous two URLs.
+ {
+ "data:text/plain;charset=utf-8,%E2%80%8Ftest",
+ true,
+ "text/plain",
+ "utf-8",
+ "\xE2\x80\x8Ftest"},
+
+ // Same as above but with Arabic text after RTL mark.
+ {
+ "data:text/plain;charset=utf-8,"
+ "%E2%80%8F\xD8\xA7\xD8\xAE\xD8\xAA\xD8\xA8\xD8\xA7\xD8\xB1",
+ true,
+ "text/plain",
+ "utf-8",
+ "\xE2\x80\x8F\xD8\xA7\xD8\xAE\xD8\xAA\xD8\xA8\xD8\xA7\xD8\xB1"}
+
// TODO(darin): add more interesting tests
};
« no previous file with comments | « net/PRESUBMIT.py ('k') | net/base/escape.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698