| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "tools/json_schema_compiler/test/functions_on_types.h" | 5 #include "tools/json_schema_compiler/test/functions_on_types.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 ASSERT_TRUE(params); | 34 ASSERT_TRUE(params); |
| 35 ASSERT_TRUE(params->keys); | 35 ASSERT_TRUE(params->keys); |
| 36 EXPECT_EQ("test", *params->keys->as_string); | 36 EXPECT_EQ("test", *params->keys->as_string); |
| 37 } | 37 } |
| 38 { | 38 { |
| 39 std::unique_ptr<base::DictionaryValue> keys_object_value( | 39 std::unique_ptr<base::DictionaryValue> keys_object_value( |
| 40 new base::DictionaryValue()); | 40 new base::DictionaryValue()); |
| 41 keys_object_value->SetInteger("integer", 5); | 41 keys_object_value->SetInteger("integer", 5); |
| 42 keys_object_value->SetString("string", "string"); | 42 keys_object_value->SetString("string", "string"); |
| 43 std::unique_ptr<base::ListValue> params_value(new base::ListValue()); | 43 std::unique_ptr<base::ListValue> params_value(new base::ListValue()); |
| 44 params_value->Append(keys_object_value->DeepCopy()); | 44 params_value->Append(keys_object_value->CreateDeepCopy()); |
| 45 std::unique_ptr<StorageArea::Get::Params> params( | 45 std::unique_ptr<StorageArea::Get::Params> params( |
| 46 StorageArea::Get::Params::Create(*params_value)); | 46 StorageArea::Get::Params::Create(*params_value)); |
| 47 ASSERT_TRUE(params); | 47 ASSERT_TRUE(params); |
| 48 ASSERT_TRUE(params->keys); | 48 ASSERT_TRUE(params->keys); |
| 49 EXPECT_TRUE(keys_object_value->Equals( | 49 EXPECT_TRUE(keys_object_value->Equals( |
| 50 ¶ms->keys->as_object->additional_properties)); | 50 ¶ms->keys->as_object->additional_properties)); |
| 51 } | 51 } |
| 52 } | 52 } |
| 53 | 53 |
| 54 TEST(JsonSchemaCompilerFunctionsOnTypesTest, StorageAreaGetResultCreate) { | 54 TEST(JsonSchemaCompilerFunctionsOnTypesTest, StorageAreaGetResultCreate) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 66 std::unique_ptr<base::DictionaryValue> details_value( | 66 std::unique_ptr<base::DictionaryValue> details_value( |
| 67 new base::DictionaryValue()); | 67 new base::DictionaryValue()); |
| 68 details_value->SetBoolean("incognito", true); | 68 details_value->SetBoolean("incognito", true); |
| 69 std::unique_ptr<base::ListValue> params_value(new base::ListValue()); | 69 std::unique_ptr<base::ListValue> params_value(new base::ListValue()); |
| 70 params_value->Append(std::move(details_value)); | 70 params_value->Append(std::move(details_value)); |
| 71 std::unique_ptr<ChromeSetting::Get::Params> params( | 71 std::unique_ptr<ChromeSetting::Get::Params> params( |
| 72 ChromeSetting::Get::Params::Create(*params_value)); | 72 ChromeSetting::Get::Params::Create(*params_value)); |
| 73 EXPECT_TRUE(params.get()); | 73 EXPECT_TRUE(params.get()); |
| 74 EXPECT_TRUE(*params->details.incognito); | 74 EXPECT_TRUE(*params->details.incognito); |
| 75 } | 75 } |
| OLD | NEW |