Index: net/base/escape_unittest.cc |
diff --git a/net/base/escape_unittest.cc b/net/base/escape_unittest.cc |
index 98afb8cfb4373197a515cb8920499e7fe9ff5bd3..8ec90af28e8420f17246fc953e7d21ff208967cd 100644 |
--- a/net/base/escape_unittest.cc |
+++ b/net/base/escape_unittest.cc |
@@ -276,6 +276,34 @@ TEST(EscapeTest, UnescapeURLComponent) { |
UnescapeRule::NORMAL | UnescapeRule::CONTROL_CHARS, |
L"Some%20random text %25\xE2\x81\xA9OK"}, |
+ // Certain banned characters should not be unescaped unless explicitly told |
+ // to do so with UnescapeRule::CONTROL_CHARS. |
+ // U+1F50F LOCK WITH INK PEN |
+ {L"Some%20random text %25%F0%9F%94%8FOK", UnescapeRule::NORMAL, |
+ L"Some%20random text %25%F0%9F%94%8FOK"}, |
+ // U+1F510 CLOSED LOCK WITH KEY |
+ {L"Some%20random text %25%F0%9F%94%90OK", UnescapeRule::NORMAL, |
+ L"Some%20random text %25%F0%9F%94%90OK"}, |
+ // U+1F512 LOCK |
+ {L"Some%20random text %25%F0%9F%94%92OK", UnescapeRule::NORMAL, |
+ L"Some%20random text %25%F0%9F%94%92OK"}, |
+ // U+1F513 OPEN LOCK |
+ {L"Some%20random text %25%F0%9F%94%93OK", UnescapeRule::NORMAL, |
+ L"Some%20random text %25%F0%9F%94%93OK"}, |
+ // UnescapeRule::CONTROL_CHARS should unescape banned characters. |
+ {L"Some%20random text %25%F0%9F%94%8FOK", |
+ UnescapeRule::NORMAL | UnescapeRule::CONTROL_CHARS, |
+ L"Some%20random text %25\xF0\x9F\x94\x8FOK"}, |
+ {L"Some%20random text %25%F0%9F%94%90OK", |
+ UnescapeRule::NORMAL | UnescapeRule::CONTROL_CHARS, |
+ L"Some%20random text %25\xF0\x9F\x94\x90OK"}, |
+ {L"Some%20random text %25%F0%9F%94%92OK", |
+ UnescapeRule::NORMAL | UnescapeRule::CONTROL_CHARS, |
+ L"Some%20random text %25\xF0\x9F\x94\x92OK"}, |
+ {L"Some%20random text %25%F0%9F%94%93OK", |
+ UnescapeRule::NORMAL | UnescapeRule::CONTROL_CHARS, |
+ L"Some%20random text %25\xF0\x9F\x94\x93OK"}, |
+ |
{L"Some%20random text %25%2dOK", UnescapeRule::SPACES, |
L"Some random text %25-OK"}, |
{L"Some%20random text %25%2dOK", UnescapeRule::URL_SPECIAL_CHARS, |