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

Unified Diff: base/json/string_escape_unittest.cc

Issue 1325253002: Treat U+2028 as a special code point when escaping for JSON. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: U+2029 Created 5 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 | « base/json/string_escape.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/string_escape_unittest.cc
diff --git a/base/json/string_escape_unittest.cc b/base/json/string_escape_unittest.cc
index 100373fccd3ee7df36c8e11f89d06e04ab1734fa..f7ccafc9cb5f4ccd5704b6c0c5a429cc5b447b3b 100644
--- a/base/json/string_escape_unittest.cc
+++ b/base/json/string_escape_unittest.cc
@@ -21,6 +21,8 @@ TEST(JSONStringEscapeTest, EscapeUTF8) {
{"b\x0f\x7f\xf0\xff!", // \xf0\xff is not a valid UTF-8 unit.
"b\\u000F\x7F\xEF\xBF\xBD\xEF\xBF\xBD!"},
{"c<>d", "c\\u003C>d"},
+ {"Hello\xe2\x80\xa8world", "Hello\\u2028world"},
+ {"\xe2\x80\xa9purple", "\\u2029purple"},
};
for (size_t i = 0; i < arraysize(cases); ++i) {
@@ -79,6 +81,8 @@ TEST(JSONStringEscapeTest, EscapeUTF16) {
"a\\b\\f\\n\\r\\t\\u000B\\u0001\\\\.\\\"z"},
{L"b\x0f\x7f\xf0\xff!", "b\\u000F\x7F\xC3\xB0\xC3\xBF!"},
{L"c<>d", "c\\u003C>d"},
+ {L"Hello\u2028world", "Hello\\u2028world"},
+ {L"\u2029purple", "\\u2029purple"},
};
for (size_t i = 0; i < arraysize(cases); ++i) {
« no previous file with comments | « base/json/string_escape.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698