Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Side by Side Diff: tools/json_schema_compiler/test/simple_api_unittest.cc

Issue 2884933002: Remove raw base::DictionaryValue::SetWithoutPathExpansion (Closed)
Patch Set: Include Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/simple_api.h" 5 #include "tools/json_schema_compiler/test/simple_api.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/values.h"
8 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
9 10
10 using namespace test::api::simple_api; 11 using namespace test::api::simple_api;
11 12
12 namespace { 13 namespace {
13 14
14 static std::unique_ptr<base::DictionaryValue> CreateTestTypeDictionary() { 15 static std::unique_ptr<base::DictionaryValue> CreateTestTypeDictionary() {
15 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); 16 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
16 value->SetWithoutPathExpansion("number", new base::Value(1.1)); 17 value->SetDoubleWithoutPathExpansion("number", 1.1);
17 value->SetWithoutPathExpansion("integer", new base::Value(4)); 18 value->SetIntegerWithoutPathExpansion("integer", 4);
18 value->SetWithoutPathExpansion("string", new base::Value("bling")); 19 value->SetStringWithoutPathExpansion("string", "bling");
19 value->SetWithoutPathExpansion("boolean", new base::Value(true)); 20 value->SetBooleanWithoutPathExpansion("boolean", true);
20 return value; 21 return value;
21 } 22 }
22 23
23 } // namespace 24 } // namespace
24 25
25 TEST(JsonSchemaCompilerSimpleTest, IncrementIntegerResultCreate) { 26 TEST(JsonSchemaCompilerSimpleTest, IncrementIntegerResultCreate) {
26 std::unique_ptr<base::ListValue> results = 27 std::unique_ptr<base::ListValue> results =
27 IncrementInteger::Results::Create(5); 28 IncrementInteger::Results::Create(5);
28 base::ListValue expected; 29 base::ListValue expected;
29 expected.AppendInteger(5); 30 expected.AppendInteger(5);
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 ASSERT_TRUE(expected->GetInteger("integer", &some_test_type.integer)); 177 ASSERT_TRUE(expected->GetInteger("integer", &some_test_type.integer));
177 ASSERT_TRUE(expected->GetBoolean("boolean", &some_test_type.boolean)); 178 ASSERT_TRUE(expected->GetBoolean("boolean", &some_test_type.boolean));
178 179
179 std::unique_ptr<base::ListValue> results( 180 std::unique_ptr<base::ListValue> results(
180 OnTestTypeFired::Create(some_test_type)); 181 OnTestTypeFired::Create(some_test_type));
181 base::DictionaryValue* result = NULL; 182 base::DictionaryValue* result = NULL;
182 results->GetDictionary(0, &result); 183 results->GetDictionary(0, &result);
183 EXPECT_TRUE(result->Equals(expected.get())); 184 EXPECT_TRUE(result->Equals(expected.get()));
184 } 185 }
185 } 186 }
OLDNEW
« no previous file with comments | « tools/json_schema_compiler/test/error_generation_unittest.cc ('k') | tools/json_schema_compiler/test/test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698