Index: tools/json_schema_compiler/test/choices_unittest.cc |
diff --git a/tools/json_schema_compiler/test/choices_unittest.cc b/tools/json_schema_compiler/test/choices_unittest.cc |
index f86c97822cecdfc72687a682b0dcfc2060fe6be5..608ece981f1a294cf6ab7d3dc6c6ffac93112d53 100644 |
--- a/tools/json_schema_compiler/test/choices_unittest.cc |
+++ b/tools/json_schema_compiler/test/choices_unittest.cc |
@@ -20,22 +20,22 @@ using json_schema_compiler::test_util::Vector; |
TEST(JsonSchemaCompilerChoicesTest, TakesIntegersParamsCreate) { |
{ |
- scoped_ptr<TakesIntegers::Params> params( |
+ std::unique_ptr<TakesIntegers::Params> params( |
TakesIntegers::Params::Create(*List(new base::FundamentalValue(true)))); |
EXPECT_FALSE(params); |
} |
{ |
- scoped_ptr<TakesIntegers::Params> params( |
+ std::unique_ptr<TakesIntegers::Params> params( |
TakesIntegers::Params::Create(*List(new base::FundamentalValue(6)))); |
ASSERT_TRUE(params); |
EXPECT_FALSE(params->nums.as_integers); |
EXPECT_EQ(6, *params->nums.as_integer); |
} |
{ |
- scoped_ptr<TakesIntegers::Params> params(TakesIntegers::Params::Create( |
- *List(List(new base::FundamentalValue(2), |
- new base::FundamentalValue(6), |
- new base::FundamentalValue(8)).release()))); |
+ std::unique_ptr<TakesIntegers::Params> params(TakesIntegers::Params::Create( |
+ *List(List(new base::FundamentalValue(2), new base::FundamentalValue(6), |
+ new base::FundamentalValue(8)) |
+ .release()))); |
ASSERT_TRUE(params); |
ASSERT_TRUE(params->nums.as_integers); |
EXPECT_EQ(Vector(2, 6, 8), *params->nums.as_integers); |
@@ -44,7 +44,7 @@ TEST(JsonSchemaCompilerChoicesTest, TakesIntegersParamsCreate) { |
TEST(JsonSchemaCompilerChoicesTest, ObjectWithChoicesParamsCreate) { |
{ |
- scoped_ptr<ObjectWithChoices::Params> params( |
+ std::unique_ptr<ObjectWithChoices::Params> params( |
ObjectWithChoices::Params::Create(*List( |
Dictionary("strings", new base::StringValue("asdf")).release()))); |
ASSERT_TRUE(params); |
@@ -53,10 +53,11 @@ TEST(JsonSchemaCompilerChoicesTest, ObjectWithChoicesParamsCreate) { |
EXPECT_FALSE(params->string_info.integers); |
} |
{ |
- scoped_ptr<ObjectWithChoices::Params> params( |
- ObjectWithChoices::Params::Create(*List( |
- Dictionary("strings", new base::StringValue("asdf"), |
- "integers", new base::FundamentalValue(6)).release()))); |
+ std::unique_ptr<ObjectWithChoices::Params> params( |
+ ObjectWithChoices::Params::Create( |
+ *List(Dictionary("strings", new base::StringValue("asdf"), |
+ "integers", new base::FundamentalValue(6)) |
+ .release()))); |
ASSERT_TRUE(params); |
EXPECT_FALSE(params->string_info.strings.as_strings); |
EXPECT_EQ("asdf", *params->string_info.strings.as_string); |
@@ -71,34 +72,37 @@ TEST(JsonSchemaCompilerChoicesTest, ObjectWithChoicesParamsCreate) { |
TEST(JsonSchemaCompilerChoicesTest, ObjectWithChoicesParamsCreateFail) { |
{ |
- scoped_ptr<base::DictionaryValue> object_param(new base::DictionaryValue()); |
+ std::unique_ptr<base::DictionaryValue> object_param( |
+ new base::DictionaryValue()); |
object_param->SetWithoutPathExpansion("strings", |
new base::FundamentalValue(5)); |
- scoped_ptr<base::ListValue> params_value(new base::ListValue()); |
+ std::unique_ptr<base::ListValue> params_value(new base::ListValue()); |
params_value->Append(object_param.release()); |
- scoped_ptr<ObjectWithChoices::Params> params( |
+ std::unique_ptr<ObjectWithChoices::Params> params( |
ObjectWithChoices::Params::Create(*params_value)); |
EXPECT_FALSE(params.get()); |
} |
{ |
- scoped_ptr<base::DictionaryValue> object_param(new base::DictionaryValue()); |
+ std::unique_ptr<base::DictionaryValue> object_param( |
+ new base::DictionaryValue()); |
object_param->SetWithoutPathExpansion("strings", |
new base::StringValue("asdf")); |
object_param->SetWithoutPathExpansion("integers", |
new base::StringValue("asdf")); |
- scoped_ptr<base::ListValue> params_value(new base::ListValue()); |
+ std::unique_ptr<base::ListValue> params_value(new base::ListValue()); |
params_value->Append(object_param.release()); |
- scoped_ptr<ObjectWithChoices::Params> params( |
+ std::unique_ptr<ObjectWithChoices::Params> params( |
ObjectWithChoices::Params::Create(*params_value)); |
EXPECT_FALSE(params.get()); |
} |
{ |
- scoped_ptr<base::DictionaryValue> object_param(new base::DictionaryValue()); |
+ std::unique_ptr<base::DictionaryValue> object_param( |
+ new base::DictionaryValue()); |
object_param->SetWithoutPathExpansion("integers", |
new base::FundamentalValue(6)); |
- scoped_ptr<base::ListValue> params_value(new base::ListValue()); |
+ std::unique_ptr<base::ListValue> params_value(new base::ListValue()); |
params_value->Append(object_param.release()); |
- scoped_ptr<ObjectWithChoices::Params> params( |
+ std::unique_ptr<ObjectWithChoices::Params> params( |
ObjectWithChoices::Params::Create(*params_value)); |
EXPECT_FALSE(params.get()); |
} |
@@ -149,7 +153,7 @@ TEST(JsonSchemaCompilerChoicesTest, ReturnChoices) { |
ReturnChoices::Results::Result results; |
results.as_integers.reset(new std::vector<int>(Vector(1, 2))); |
- scoped_ptr<base::Value> results_value = results.ToValue(); |
+ std::unique_ptr<base::Value> results_value = results.ToValue(); |
ASSERT_TRUE(results_value); |
base::ListValue expected; |
@@ -162,7 +166,7 @@ TEST(JsonSchemaCompilerChoicesTest, ReturnChoices) { |
ReturnChoices::Results::Result results; |
results.as_integer.reset(new int(5)); |
- scoped_ptr<base::Value> results_value = results.ToValue(); |
+ std::unique_ptr<base::Value> results_value = results.ToValue(); |
ASSERT_TRUE(results_value); |
base::FundamentalValue expected(5); |
@@ -176,8 +180,8 @@ TEST(JsonSchemaCompilerChoicesTest, NestedChoices) { |
// NestedChoices. |
{ |
// The plain integer choice. |
- scoped_ptr<base::Value> value = ReadJson("42"); |
- scoped_ptr<NestedChoice> obj = NestedChoice::FromValue(*value); |
+ std::unique_ptr<base::Value> value = ReadJson("42"); |
+ std::unique_ptr<NestedChoice> obj = NestedChoice::FromValue(*value); |
ASSERT_TRUE(obj); |
ASSERT_TRUE(obj->as_integer); |
@@ -190,8 +194,8 @@ TEST(JsonSchemaCompilerChoicesTest, NestedChoices) { |
{ |
// The string choice within the first choice. |
- scoped_ptr<base::Value> value = ReadJson("\"foo\""); |
- scoped_ptr<NestedChoice> obj = NestedChoice::FromValue(*value); |
+ std::unique_ptr<base::Value> value = ReadJson("\"foo\""); |
+ std::unique_ptr<NestedChoice> obj = NestedChoice::FromValue(*value); |
ASSERT_TRUE(obj); |
EXPECT_FALSE(obj->as_integer); |
@@ -206,8 +210,8 @@ TEST(JsonSchemaCompilerChoicesTest, NestedChoices) { |
{ |
// The boolean choice within the first choice. |
- scoped_ptr<base::Value> value = ReadJson("true"); |
- scoped_ptr<NestedChoice> obj = NestedChoice::FromValue(*value); |
+ std::unique_ptr<base::Value> value = ReadJson("true"); |
+ std::unique_ptr<NestedChoice> obj = NestedChoice::FromValue(*value); |
ASSERT_TRUE(obj); |
EXPECT_FALSE(obj->as_integer); |
@@ -222,8 +226,8 @@ TEST(JsonSchemaCompilerChoicesTest, NestedChoices) { |
{ |
// The double choice within the second choice. |
- scoped_ptr<base::Value> value = ReadJson("42.0"); |
- scoped_ptr<NestedChoice> obj = NestedChoice::FromValue(*value); |
+ std::unique_ptr<base::Value> value = ReadJson("42.0"); |
+ std::unique_ptr<NestedChoice> obj = NestedChoice::FromValue(*value); |
ASSERT_TRUE(obj); |
EXPECT_FALSE(obj->as_integer); |
@@ -239,9 +243,9 @@ TEST(JsonSchemaCompilerChoicesTest, NestedChoices) { |
{ |
// The ChoiceType choice within the second choice. |
- scoped_ptr<base::Value> value = ReadJson( |
- "{\"integers\": [1, 2], \"strings\": \"foo\"}"); |
- scoped_ptr<NestedChoice> obj = NestedChoice::FromValue(*value); |
+ std::unique_ptr<base::Value> value = |
+ ReadJson("{\"integers\": [1, 2], \"strings\": \"foo\"}"); |
+ std::unique_ptr<NestedChoice> obj = NestedChoice::FromValue(*value); |
ASSERT_TRUE(obj); |
EXPECT_FALSE(obj->as_integer); |
@@ -266,12 +270,12 @@ TEST(JsonSchemaCompilerChoicesTest, NestedChoices) { |
{ |
// The array of ChoiceTypes within the second choice. |
- scoped_ptr<base::Value> value = ReadJson( |
+ std::unique_ptr<base::Value> value = ReadJson( |
"[" |
" {\"integers\": [1, 2], \"strings\": \"foo\"}," |
" {\"integers\": 3, \"strings\": [\"bar\", \"baz\"]}" |
"]"); |
- scoped_ptr<NestedChoice> obj = NestedChoice::FromValue(*value); |
+ std::unique_ptr<NestedChoice> obj = NestedChoice::FromValue(*value); |
ASSERT_TRUE(obj); |
EXPECT_FALSE(obj->as_integer); |