| Index: base/json/json_writer_unittest.cc
|
| diff --git a/base/json/json_writer_unittest.cc b/base/json/json_writer_unittest.cc
|
| index 6d7714b5aad7fd4f964a2b5fa27839fbe18db51f..dcd30d9686f061d2acd779285320430055a4324a 100644
|
| --- a/base/json/json_writer_unittest.cc
|
| +++ b/base/json/json_writer_unittest.cc
|
| @@ -93,6 +93,29 @@ 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::Write(root, false, JSONWriter::OPTIONS_IGNORE_BINARY_VALUES,
|
| + &output_js);
|
| + ASSERT_EQ("", output_js);
|
| + 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::Write(&binary_list, false,
|
| + JSONWriter::OPTIONS_IGNORE_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::Write(&binary_dict, false,
|
| + JSONWriter::OPTIONS_IGNORE_BINARY_VALUES, &output_js);
|
| + ASSERT_EQ("{\"a\":5,\"c\":2}", output_js);
|
| }
|
|
|
| } // namespace base
|
|
|