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

Unified Diff: net/base/escape_unittest.cc

Issue 181483008: Don't unescape BiDi control characters in URL components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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: net/base/escape_unittest.cc
diff --git a/net/base/escape_unittest.cc b/net/base/escape_unittest.cc
index 90c246a38abc7773d4a28d48c00b6f99d3b39eb2..766d4e4ea90191604f5a4f7dbb9fa5c1c59c15a4 100644
--- a/net/base/escape_unittest.cc
+++ b/net/base/escape_unittest.cc
@@ -218,6 +218,17 @@ TEST(EscapeTest, UnescapeURLComponent) {
L"Some%20random text %25%2dOK"},
{L"Some%20random text %25%2dOK", UnescapeRule::NORMAL,
L"Some%20random text %25-OK"},
+ {L"Some%20random text %25%E2%80%83OK", UnescapeRule::NORMAL,
+ L"Some%20random text %25\xE2\x80\x83OK"},
+
+ // BiDi Control characters should not be unescaped.
+ {L"Some%20random text %25%E2%80%8EOK", UnescapeRule::NORMAL,
+ L"Some%20random text %25%E2%80%8EOK"},
+ {L"Some%20random text %25%E2%80%AAOK", UnescapeRule::NORMAL,
+ L"Some%20random text %25%E2%80%AAOK"},
+ {L"Some%20random text %25%E2%80%ABOK", UnescapeRule::NORMAL,
+ L"Some%20random text %25%E2%80%ABOK"},
+
{L"Some%20random text %25%2dOK", UnescapeRule::SPACES,
L"Some random text %25-OK"},
{L"Some%20random text %25%2dOK", UnescapeRule::URL_SPECIAL_CHARS,
« net/base/escape.cc ('K') | « net/base/escape.cc ('k') | net/base/net_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698