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

Unified Diff: base/json/json_reader_unittest.cc

Issue 2823023002: Do not silently drop \u0000 in base::JSONReader (Closed)
Patch Set: Created 3 years, 8 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/json_parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_reader_unittest.cc
diff --git a/base/json/json_reader_unittest.cc b/base/json/json_reader_unittest.cc
index 1b00b1d9e9166387975dd0a63e2f1d387658f3db..8e05cae78c51a259978ce52c6e82b970a9d253cb 100644
--- a/base/json/json_reader_unittest.cc
+++ b/base/json/json_reader_unittest.cc
@@ -240,12 +240,12 @@ TEST(JSONReaderTest, Reading) {
{
// Test hex and unicode escapes including the null character.
std::unique_ptr<Value> root =
- JSONReader().ReadToValue("\"\\x41\\x00\\u1234\"");
+ JSONReader().ReadToValue("\"\\x41\\x00\\u1234\\u0000\"");
ASSERT_TRUE(root);
EXPECT_TRUE(root->IsType(Value::Type::STRING));
std::string str_val;
EXPECT_TRUE(root->GetAsString(&str_val));
- EXPECT_EQ(std::wstring(L"A\0\x1234", 3), UTF8ToWide(str_val));
+ EXPECT_EQ(std::wstring(L"A\0\x1234\0", 4), UTF8ToWide(str_val));
}
{
« no previous file with comments | « base/json/json_parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698