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

Unified Diff: base/json/json_writer_unittest.cc

Issue 7649006: more changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix another typo Created 9 years, 4 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_reader.cc ('k') | base/value_conversions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « base/json/json_reader.cc ('k') | base/value_conversions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698