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

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

Issue 1129083003: More base::Values-related bare pointer -> scoped_ptr conversions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix bad merge Created 5 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
« no previous file with comments | « media/base/video_frame_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/error_generation.h" 5 #include "tools/json_schema_compiler/test/error_generation.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "tools/json_schema_compiler/test/test_util.h" 10 #include "tools/json_schema_compiler/test/test_util.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // GenerateFunctionParamsCreate errors 94 // GenerateFunctionParamsCreate errors
95 95
96 TEST(JsonSchemaCompilerErrorTest, ParamIsRequired) { 96 TEST(JsonSchemaCompilerErrorTest, ParamIsRequired) {
97 { 97 {
98 scoped_ptr<base::ListValue> params_value = List( 98 scoped_ptr<base::ListValue> params_value = List(
99 new FundamentalValue(5)); 99 new FundamentalValue(5));
100 base::string16 error; 100 base::string16 error;
101 EXPECT_TRUE(TestFunction::Params::Create(*params_value, &error)); 101 EXPECT_TRUE(TestFunction::Params::Create(*params_value, &error));
102 } 102 }
103 { 103 {
104 scoped_ptr<base::ListValue> params_value = List( 104 scoped_ptr<base::ListValue> params_value =
105 base::Value::CreateNullValue()); 105 List(base::Value::CreateNullValue().release());
106 base::string16 error; 106 base::string16 error;
107 EXPECT_FALSE(TestFunction::Params::Create(*params_value, &error)); 107 EXPECT_FALSE(TestFunction::Params::Create(*params_value, &error));
108 EXPECT_TRUE(EqualsUtf16("'num' is required", error)); 108 EXPECT_TRUE(EqualsUtf16("'num' is required", error));
109 } 109 }
110 } 110 }
111 111
112 // GeneratePopulateVariableFromValue errors 112 // GeneratePopulateVariableFromValue errors
113 113
114 TEST(JsonSchemaCompilerErrorTest, WrongPropertyValueType) { 114 TEST(JsonSchemaCompilerErrorTest, WrongPropertyValueType) {
115 { 115 {
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 EXPECT_TRUE(EqualsUtf16("", GetPopulateError<TestType>(*value))); 329 EXPECT_TRUE(EqualsUtf16("", GetPopulateError<TestType>(*value)));
330 } 330 }
331 { 331 {
332 scoped_ptr<base::DictionaryValue> value = Dictionary( 332 scoped_ptr<base::DictionaryValue> value = Dictionary(
333 "string", new base::StringValue("yes"), 333 "string", new base::StringValue("yes"),
334 "ohno", new base::StringValue("many values")); 334 "ohno", new base::StringValue("many values"));
335 EXPECT_TRUE(EqualsUtf16("found unexpected key 'ohno'", 335 EXPECT_TRUE(EqualsUtf16("found unexpected key 'ohno'",
336 GetPopulateError<TestType>(*value))); 336 GetPopulateError<TestType>(*value)));
337 } 337 }
338 } 338 }
OLDNEW
« no previous file with comments | « media/base/video_frame_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698