diff options
Diffstat (limited to 'third_party/chromium/base/json/json_writer_unittest.cc')
-rw-r--r-- | third_party/chromium/base/json/json_writer_unittest.cc | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/third_party/chromium/base/json/json_writer_unittest.cc b/third_party/chromium/base/json/json_writer_unittest.cc index 7aaa78b..ca99f4d 100644 --- a/third_party/chromium/base/json/json_writer_unittest.cc +++ b/third_party/chromium/base/json/json_writer_unittest.cc @@ -6,7 +6,6 @@ #include <gtest/gtest.h> -#include "base/memory/ptr_util.h" #include "base/values.h" #include "build/build_config.h" @@ -58,11 +57,11 @@ TEST(JSONWriterTest, NestedTypes) { // Writer unittests like empty list/dict nesting, // list list nesting, etc. DictionaryValue root_dict; - std::unique_ptr<ListValue> list(new ListValue()); - std::unique_ptr<DictionaryValue> inner_dict(new DictionaryValue()); + scoped_ptr<ListValue> list(new ListValue()); + scoped_ptr<DictionaryValue> inner_dict(new DictionaryValue()); inner_dict->SetInteger("inner int", 10); list->Append(std::move(inner_dict)); - list->Append(WrapUnique(new ListValue())); + list->Append(make_scoped_ptr(new ListValue())); list->AppendBoolean(true); root_dict.Set("list", std::move(list)); @@ -94,7 +93,7 @@ TEST(JSONWriterTest, KeysWithPeriods) { DictionaryValue period_dict; period_dict.SetIntegerWithoutPathExpansion("a.b", 3); period_dict.SetIntegerWithoutPathExpansion("c", 2); - std::unique_ptr<DictionaryValue> period_dict2(new DictionaryValue()); + scoped_ptr<DictionaryValue> period_dict2(new DictionaryValue()); period_dict2->SetIntegerWithoutPathExpansion("g.h.i.j", 1); period_dict.SetWithoutPathExpansion("d.e.f", std::move(period_dict2)); EXPECT_TRUE(JSONWriter::Write(period_dict, &output_js)); @@ -112,7 +111,7 @@ TEST(JSONWriterTest, BinaryValues) { // Binary values should return errors unless suppressed via the // OPTIONS_OMIT_BINARY_VALUES flag. - std::unique_ptr<Value> root(BinaryValue::CreateWithCopiedBuffer("asdf", 4)); + scoped_ptr<Value> root(BinaryValue::CreateWithCopiedBuffer("asdf", 4)); EXPECT_FALSE(JSONWriter::Write(*root, &output_js)); EXPECT_TRUE(JSONWriter::WriteWithOptions( *root, JSONWriter::OPTIONS_OMIT_BINARY_VALUES, &output_js)); @@ -120,9 +119,9 @@ TEST(JSONWriterTest, BinaryValues) { ListValue binary_list; binary_list.Append(BinaryValue::CreateWithCopiedBuffer("asdf", 4)); - binary_list.Append(WrapUnique(new FundamentalValue(5))); + binary_list.Append(make_scoped_ptr(new FundamentalValue(5))); binary_list.Append(BinaryValue::CreateWithCopiedBuffer("asdf", 4)); - binary_list.Append(WrapUnique(new FundamentalValue(2))); + binary_list.Append(make_scoped_ptr(new FundamentalValue(2))); binary_list.Append(BinaryValue::CreateWithCopiedBuffer("asdf", 4)); EXPECT_FALSE(JSONWriter::Write(binary_list, &output_js)); EXPECT_TRUE(JSONWriter::WriteWithOptions( @@ -131,13 +130,13 @@ TEST(JSONWriterTest, BinaryValues) { DictionaryValue binary_dict; binary_dict.Set( - "a", WrapUnique(BinaryValue::CreateWithCopiedBuffer("asdf", 4))); + "a", make_scoped_ptr(BinaryValue::CreateWithCopiedBuffer("asdf", 4))); binary_dict.SetInteger("b", 5); binary_dict.Set( - "c", WrapUnique(BinaryValue::CreateWithCopiedBuffer("asdf", 4))); + "c", make_scoped_ptr(BinaryValue::CreateWithCopiedBuffer("asdf", 4))); binary_dict.SetInteger("d", 2); binary_dict.Set( - "e", WrapUnique(BinaryValue::CreateWithCopiedBuffer("asdf", 4))); + "e", make_scoped_ptr(BinaryValue::CreateWithCopiedBuffer("asdf", 4))); EXPECT_FALSE(JSONWriter::Write(binary_dict, &output_js)); EXPECT_TRUE(JSONWriter::WriteWithOptions( binary_dict, JSONWriter::OPTIONS_OMIT_BINARY_VALUES, &output_js)); |