Index: base/json/json_parser_unittest.cc |
diff --git a/base/json/json_parser_unittest.cc b/base/json/json_parser_unittest.cc |
index da86b332ea2afd846ea8f6960a8ac082802040d1..30255ca46126dd89ad0e8471f67eaa4d26bcf39a 100644 |
--- a/base/json/json_parser_unittest.cc |
+++ b/base/json/json_parser_unittest.cc |
@@ -6,8 +6,9 @@ |
#include <stddef.h> |
+#include <memory> |
+ |
#include "base/json/json_reader.h" |
-#include "base/memory/scoped_ptr.h" |
#include "base/values.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -34,7 +35,7 @@ class JSONParserTest : public testing::Test { |
TEST_F(JSONParserTest, NextChar) { |
std::string input("Hello world"); |
- scoped_ptr<JSONParser> parser(NewTestParser(input)); |
+ std::unique_ptr<JSONParser> parser(NewTestParser(input)); |
EXPECT_EQ('H', *parser->pos_); |
for (size_t i = 1; i < input.length(); ++i) { |
@@ -45,8 +46,8 @@ TEST_F(JSONParserTest, NextChar) { |
TEST_F(JSONParserTest, ConsumeString) { |
std::string input("\"test\",|"); |
- scoped_ptr<JSONParser> parser(NewTestParser(input)); |
- scoped_ptr<Value> value(parser->ConsumeString()); |
+ std::unique_ptr<JSONParser> parser(NewTestParser(input)); |
+ std::unique_ptr<Value> value(parser->ConsumeString()); |
EXPECT_EQ('"', *parser->pos_); |
TestLastThree(parser.get()); |
@@ -59,8 +60,8 @@ TEST_F(JSONParserTest, ConsumeString) { |
TEST_F(JSONParserTest, ConsumeList) { |
std::string input("[true, false],|"); |
- scoped_ptr<JSONParser> parser(NewTestParser(input)); |
- scoped_ptr<Value> value(parser->ConsumeList()); |
+ std::unique_ptr<JSONParser> parser(NewTestParser(input)); |
+ std::unique_ptr<Value> value(parser->ConsumeList()); |
EXPECT_EQ(']', *parser->pos_); |
TestLastThree(parser.get()); |
@@ -73,8 +74,8 @@ TEST_F(JSONParserTest, ConsumeList) { |
TEST_F(JSONParserTest, ConsumeDictionary) { |
std::string input("{\"abc\":\"def\"},|"); |
- scoped_ptr<JSONParser> parser(NewTestParser(input)); |
- scoped_ptr<Value> value(parser->ConsumeDictionary()); |
+ std::unique_ptr<JSONParser> parser(NewTestParser(input)); |
+ std::unique_ptr<Value> value(parser->ConsumeDictionary()); |
EXPECT_EQ('}', *parser->pos_); |
TestLastThree(parser.get()); |
@@ -90,8 +91,8 @@ TEST_F(JSONParserTest, ConsumeDictionary) { |
TEST_F(JSONParserTest, ConsumeLiterals) { |
// Literal |true|. |
std::string input("true,|"); |
- scoped_ptr<JSONParser> parser(NewTestParser(input)); |
- scoped_ptr<Value> value(parser->ConsumeLiteral()); |
+ std::unique_ptr<JSONParser> parser(NewTestParser(input)); |
+ std::unique_ptr<Value> value(parser->ConsumeLiteral()); |
EXPECT_EQ('e', *parser->pos_); |
TestLastThree(parser.get()); |
@@ -128,8 +129,8 @@ TEST_F(JSONParserTest, ConsumeLiterals) { |
TEST_F(JSONParserTest, ConsumeNumbers) { |
// Integer. |
std::string input("1234,|"); |
- scoped_ptr<JSONParser> parser(NewTestParser(input)); |
- scoped_ptr<Value> value(parser->ConsumeNumber()); |
+ std::unique_ptr<JSONParser> parser(NewTestParser(input)); |
+ std::unique_ptr<Value> value(parser->ConsumeNumber()); |
EXPECT_EQ('4', *parser->pos_); |
TestLastThree(parser.get()); |
@@ -205,7 +206,7 @@ TEST_F(JSONParserTest, ErrorMessages) { |
// Error strings should not be modified in case of success. |
std::string error_message; |
int error_code = 0; |
- scoped_ptr<Value> root = JSONReader::ReadAndReturnError( |
+ std::unique_ptr<Value> root = JSONReader::ReadAndReturnError( |
"[42]", JSON_PARSE_RFC, &error_code, &error_message); |
EXPECT_TRUE(error_message.empty()); |
EXPECT_EQ(0, error_code); |
@@ -309,7 +310,7 @@ TEST_F(JSONParserTest, Decode4ByteUtf8Char) { |
"[\"😇\",[],[],[],{\"google:suggesttype\":[]}]"; |
std::string error_message; |
int error_code = 0; |
- scoped_ptr<Value> root = JSONReader::ReadAndReturnError( |
+ std::unique_ptr<Value> root = JSONReader::ReadAndReturnError( |
kUtf8Data, JSON_PARSE_RFC, &error_code, &error_message); |
EXPECT_TRUE(root.get()) << error_message; |
} |