Index: tools/json_schema_compiler/test/functions_as_parameters_unittest.cc |
diff --git a/tools/json_schema_compiler/test/functions_as_parameters_unittest.cc b/tools/json_schema_compiler/test/functions_as_parameters_unittest.cc |
index ce7a2f981659d16a6bf4cdf5fbe8902cb390db39..858f0528fdb1d3f47467097310f93956db7a6e9b 100644 |
--- a/tools/json_schema_compiler/test/functions_as_parameters_unittest.cc |
+++ b/tools/json_schema_compiler/test/functions_as_parameters_unittest.cc |
@@ -4,6 +4,8 @@ |
#include "tools/json_schema_compiler/test/functions_as_parameters.h" |
+#include "base/memory/ptr_util.h" |
+#include "base/values.h" |
#include "testing/gtest/include/gtest/gtest.h" |
using namespace test::api::functions_as_parameters; |
@@ -19,7 +21,7 @@ TEST(JsonSchemaCompilerFunctionsAsParametersTest, PopulateRequiredFunction) { |
{ |
base::DictionaryValue value; |
base::DictionaryValue function_dict; |
- value.Set("event_callback", function_dict.DeepCopy()); |
+ value.Set("event_callback", base::MakeUnique<base::Value>(function_dict)); |
FunctionType out; |
ASSERT_TRUE(FunctionType::Populate(value, &out)); |
EXPECT_TRUE(out.event_callback.empty()); |
@@ -30,7 +32,7 @@ TEST(JsonSchemaCompilerFunctionsAsParametersTest, RequiredFunctionToValue) { |
{ |
base::DictionaryValue value; |
base::DictionaryValue function_dict; |
- value.Set("event_callback", function_dict.DeepCopy()); |
+ value.Set("event_callback", base::MakeUnique<base::Value>(function_dict)); |
FunctionType out; |
ASSERT_TRUE(FunctionType::Populate(value, &out)); |
@@ -40,8 +42,9 @@ TEST(JsonSchemaCompilerFunctionsAsParametersTest, RequiredFunctionToValue) { |
base::DictionaryValue value; |
base::DictionaryValue expected_value; |
base::DictionaryValue function_dict; |
- value.Set("event_callback", function_dict.DeepCopy()); |
- expected_value.Set("event_callback", function_dict.DeepCopy()); |
+ value.Set("event_callback", base::MakeUnique<base::Value>(function_dict)); |
+ expected_value.Set("event_callback", |
+ base::MakeUnique<base::Value>(function_dict)); |
FunctionType out; |
ASSERT_TRUE(FunctionType::Populate(value, &out)); |
@@ -59,7 +62,7 @@ TEST(JsonSchemaCompilerFunctionsAsParametersTest, PopulateOptionalFunction) { |
{ |
base::DictionaryValue value; |
base::DictionaryValue function_value; |
- value.Set("event_callback", function_value.DeepCopy()); |
+ value.Set("event_callback", base::MakeUnique<base::Value>(function_value)); |
OptionalFunctionType out; |
ASSERT_TRUE(OptionalFunctionType::Populate(value, &out)); |
EXPECT_TRUE(out.event_callback.get()); |
@@ -67,7 +70,7 @@ TEST(JsonSchemaCompilerFunctionsAsParametersTest, PopulateOptionalFunction) { |
{ |
base::DictionaryValue value; |
base::DictionaryValue function_value; |
- value.Set("event_callback", function_value.DeepCopy()); |
+ value.Set("event_callback", base::MakeUnique<base::Value>(function_value)); |
OptionalFunctionType out; |
ASSERT_TRUE(OptionalFunctionType::Populate(value, &out)); |
EXPECT_TRUE(out.event_callback.get()); |
@@ -85,7 +88,7 @@ TEST(JsonSchemaCompilerFunctionsAsParametersTest, OptionalFunctionToValue) { |
{ |
base::DictionaryValue value; |
base::DictionaryValue function_value; |
- value.Set("event_callback", function_value.DeepCopy()); |
+ value.Set("event_callback", base::MakeUnique<base::Value>(function_value)); |
OptionalFunctionType out; |
ASSERT_TRUE(OptionalFunctionType::Populate(value, &out)); |