summaryrefslogtreecommitdiffstats
path: root/base/json/json_writer_unittest.cc
diff options
context:
space:
mode:
authorrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-15 03:24:05 +0000
committerrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-15 03:24:05 +0000
commit113d72413bc2424a795a544980f80d49fcf1f302 (patch)
tree9c5aae6171770025aeaf8523d33e96459f4baab3 /base/json/json_writer_unittest.cc
parentcfff9eb8c2dad715a8d4a7be088d82a9e0fada22 (diff)
downloadchromium_src-113d72413bc2424a795a544980f80d49fcf1f302.zip
chromium_src-113d72413bc2424a795a544980f80d49fcf1f302.tar.gz
chromium_src-113d72413bc2424a795a544980f80d49fcf1f302.tar.bz2
Revert 110021 - Broke CrOS compile
Allow JSONWriter and JSONValueSerializer to ignore binary values when instructed to do so. Design discussion is available here: http://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/967eb64325c24f9c BUG=None TEST=base_unittests Review URL: http://codereview.chromium.org/8505033 TBR=ericdingle@chromium.org Review URL: http://codereview.chromium.org/8528051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110027 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/json/json_writer_unittest.cc')
-rw-r--r--base/json/json_writer_unittest.cc28
1 files changed, 1 insertions, 27 deletions
diff --git a/base/json/json_writer_unittest.cc b/base/json/json_writer_unittest.cc
index 5d44c02..6d7714b 100644
--- a/base/json/json_writer_unittest.cc
+++ b/base/json/json_writer_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -93,32 +93,6 @@ TEST(JSONWriterTest, Writing) {
period_dict3.SetWithoutPathExpansion("a.b", Value::CreateIntegerValue(1));
JSONWriter::Write(&period_dict3, false, &output_js);
ASSERT_EQ("{\"a\":{\"b\":2},\"a.b\":1}", output_js);
-
- // Test ignoring binary values.
- root = BinaryValue::CreateWithCopiedBuffer("asdf", 4);
- JSONWriter::WriteWithOptions(root, false,
- JSONWriter::OPTIONS_OMIT_BINARY_VALUES,
- &output_js);
- ASSERT_TRUE(output_js.empty());
- delete root;
-
- ListValue binary_list;
- binary_list.Append(Value::CreateIntegerValue(5));
- binary_list.Append(BinaryValue::CreateWithCopiedBuffer("asdf", 4));
- binary_list.Append(Value::CreateIntegerValue(2));
- JSONWriter::WriteWithOptions(&binary_list, false,
- JSONWriter::OPTIONS_OMIT_BINARY_VALUES,
- &output_js);
- ASSERT_EQ("[5,2]", output_js);
-
- DictionaryValue binary_dict;
- binary_dict.Set("a", Value::CreateIntegerValue(5));
- binary_dict.Set("b", BinaryValue::CreateWithCopiedBuffer("asdf", 4));
- binary_dict.Set("c", Value::CreateIntegerValue(2));
- JSONWriter::WriteWithOptions(&binary_dict, false,
- JSONWriter::OPTIONS_OMIT_BINARY_VALUES,
- &output_js);
- ASSERT_EQ("{\"a\":5,\"c\":2}", output_js);
}
} // namespace base