summaryrefslogtreecommitdiffstats
path: root/chrome/common/json_value_serializer_unittest.cc
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-29 00:21:49 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-29 00:21:49 +0000
commit94d126b3ce7e1f3100897240884a00f3b7e96575 (patch)
tree51306cea1e41d88f10ef3554f89c2208f5512583 /chrome/common/json_value_serializer_unittest.cc
parentad89a6dc97029138b9f7f04135f3e8e164491eb5 (diff)
downloadchromium_src-94d126b3ce7e1f3100897240884a00f3b7e96575.zip
chromium_src-94d126b3ce7e1f3100897240884a00f3b7e96575.tar.gz
chromium_src-94d126b3ce7e1f3100897240884a00f3b7e96575.tar.bz2
Update the JSONValueSerializer to have a flag to allow trailing commas. By default, we don't support this when deserializing JSON, but the user can enable this.
BUG=1295713 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/json_value_serializer_unittest.cc')
-rw-r--r--chrome/common/json_value_serializer_unittest.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/chrome/common/json_value_serializer_unittest.cc b/chrome/common/json_value_serializer_unittest.cc
index acb2903..a4e9d89 100644
--- a/chrome/common/json_value_serializer_unittest.cc
+++ b/chrome/common/json_value_serializer_unittest.cc
@@ -191,7 +191,7 @@ namespace {
void ValidateJsonList(const std::string& json) {
Value* root = NULL;
- ASSERT_TRUE(JSONReader::Read(json, &root));
+ ASSERT_TRUE(JSONReader::Read(json, &root, false));
ASSERT_TRUE(root && root->IsType(Value::TYPE_LIST));
ListValue* list = static_cast<ListValue*>(root);
ASSERT_EQ(1, list->GetSize());
@@ -215,7 +215,7 @@ TEST(JSONValueSerializerTest, JSONReaderComments) {
Value* root = NULL;
// It's ok to have a comment in a string.
- ASSERT_TRUE(JSONReader::Read("[\"// ok\\n /* foo */ \"]", &root));
+ ASSERT_TRUE(JSONReader::Read("[\"// ok\\n /* foo */ \"]", &root, false));
ASSERT_TRUE(root && root->IsType(Value::TYPE_LIST));
ListValue* list = static_cast<ListValue*>(root);
ASSERT_EQ(1, list->GetSize());
@@ -228,10 +228,10 @@ TEST(JSONValueSerializerTest, JSONReaderComments) {
root = NULL;
// You can't nest comments.
- ASSERT_FALSE(JSONReader::Read("/* /* inner */ outer */ [ 1 ]", &root));
+ ASSERT_FALSE(JSONReader::Read("/* /* inner */ outer */ [ 1 ]", &root, false));
// Not a open comment token.
- ASSERT_FALSE(JSONReader::Read("/ * * / [1]", &root));
+ ASSERT_FALSE(JSONReader::Read("/ * * / [1]", &root, false));
}
namespace {