| 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..c0c6da6623757af50101454be46870132a869878 100644
|
| --- a/base/json/json_writer_unittest.cc
|
| +++ b/base/json/json_writer_unittest.cc
|
| @@ -10,7 +10,7 @@ namespace base {
|
|
|
| TEST(JSONWriterTest, Writing) {
|
| // Test null
|
| - Value* root = Value::CreateNullValue();
|
| + Value* root = NullValue();
|
| std::string output_js;
|
| JSONWriter::Write(root, false, &output_js);
|
| ASSERT_EQ("null", output_js);
|
| @@ -29,19 +29,19 @@ TEST(JSONWriterTest, Writing) {
|
| delete root;
|
|
|
| // Test Real values should always have a decimal or an 'e'.
|
| - root = Value::CreateDoubleValue(1.0);
|
| + root = NumberValue::New(1.0);
|
| JSONWriter::Write(root, false, &output_js);
|
| ASSERT_EQ("1.0", output_js);
|
| delete root;
|
|
|
| // Test Real values in the the range (-1, 1) must have leading zeros
|
| - root = Value::CreateDoubleValue(0.2);
|
| + root = NumberValue::New(0.2);
|
| JSONWriter::Write(root, false, &output_js);
|
| ASSERT_EQ("0.2", output_js);
|
| delete root;
|
|
|
| // Test Real values in the the range (-1, 1) must have leading zeros
|
| - root = Value::CreateDoubleValue(-0.8);
|
| + root = NumberValue::New(-0.8);
|
| JSONWriter::Write(root, false, &output_js);
|
| ASSERT_EQ("-0.8", output_js);
|
| delete root;
|
| @@ -56,7 +56,7 @@ TEST(JSONWriterTest, Writing) {
|
| inner_dict->SetInteger("inner int", 10);
|
| ListValue* inner_list = new ListValue;
|
| list->Append(inner_list);
|
| - list->Append(Value::CreateBooleanValue(true));
|
| + list->Append(TrueValue());
|
|
|
| // Test the pretty-printer.
|
| JSONWriter::Write(&root_dict, false, &output_js);
|
| @@ -79,18 +79,18 @@ TEST(JSONWriterTest, Writing) {
|
|
|
| // Test keys with periods
|
| DictionaryValue period_dict;
|
| - period_dict.SetWithoutPathExpansion("a.b", Value::CreateIntegerValue(3));
|
| - period_dict.SetWithoutPathExpansion("c", Value::CreateIntegerValue(2));
|
| + period_dict.SetWithoutPathExpansion("a.b", NumberValue::New(3));
|
| + period_dict.SetWithoutPathExpansion("c", NumberValue::New(2));
|
| DictionaryValue* period_dict2 = new DictionaryValue;
|
| period_dict2->SetWithoutPathExpansion("g.h.i.j",
|
| - Value::CreateIntegerValue(1));
|
| + NumberValue::New(1));
|
| period_dict.SetWithoutPathExpansion("d.e.f", period_dict2);
|
| JSONWriter::Write(&period_dict, false, &output_js);
|
| ASSERT_EQ("{\"a.b\":3,\"c\":2,\"d.e.f\":{\"g.h.i.j\":1}}", output_js);
|
|
|
| DictionaryValue period_dict3;
|
| - period_dict3.Set("a.b", Value::CreateIntegerValue(2));
|
| - period_dict3.SetWithoutPathExpansion("a.b", Value::CreateIntegerValue(1));
|
| + period_dict3.Set("a.b", NumberValue::New(2));
|
| + period_dict3.SetWithoutPathExpansion("a.b", NumberValue::New(1));
|
| JSONWriter::Write(&period_dict3, false, &output_js);
|
| ASSERT_EQ("{\"a\":{\"b\":2},\"a.b\":1}", output_js);
|
| }
|
|
|