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

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

Issue 116543010: Remove the Value class names from the global namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 years 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 | Annotate | Revision Log
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/callbacks.h" 5 #include "tools/json_schema_compiler/test/callbacks.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 using namespace test::api::callbacks; 9 using namespace test::api::callbacks;
10 10
11 TEST(JsonSchemaCompilerCallbacksTest, ReturnsObjectResultCreate) { 11 TEST(JsonSchemaCompilerCallbacksTest, ReturnsObjectResultCreate) {
12 ReturnsObject::Results::SomeObject some_object; 12 ReturnsObject::Results::SomeObject some_object;
13 some_object.state = ReturnsObject::Results::SomeObject::STATE_FOO; 13 some_object.state = ReturnsObject::Results::SomeObject::STATE_FOO;
14 scoped_ptr<ListValue> results = ReturnsObject::Results::Create(some_object); 14 scoped_ptr<base::ListValue> results =
15 ReturnsObject::Results::Create(some_object);
15 16
16 DictionaryValue* expected_dict = new DictionaryValue(); 17 base::DictionaryValue* expected_dict = new base::DictionaryValue();
17 expected_dict->SetString("state", "foo"); 18 expected_dict->SetString("state", "foo");
18 ListValue expected; 19 base::ListValue expected;
19 expected.Append(expected_dict); 20 expected.Append(expected_dict);
20 EXPECT_TRUE(results->Equals(&expected)); 21 EXPECT_TRUE(results->Equals(&expected));
21 } 22 }
22 23
23 TEST(JsonSchemaCompilerCallbacksTest, ReturnsMultipleResultCreate) { 24 TEST(JsonSchemaCompilerCallbacksTest, ReturnsMultipleResultCreate) {
24 ReturnsMultiple::Results::SomeObject some_object; 25 ReturnsMultiple::Results::SomeObject some_object;
25 some_object.state = ReturnsMultiple::Results::SomeObject::STATE_FOO; 26 some_object.state = ReturnsMultiple::Results::SomeObject::STATE_FOO;
26 scoped_ptr<ListValue> results = 27 scoped_ptr<base::ListValue> results =
27 ReturnsMultiple::Results::Create(5, some_object); 28 ReturnsMultiple::Results::Create(5, some_object);
28 29
29 DictionaryValue* expected_dict = new DictionaryValue(); 30 base::DictionaryValue* expected_dict = new base::DictionaryValue();
30 expected_dict->SetString("state", "foo"); 31 expected_dict->SetString("state", "foo");
31 ListValue expected; 32 base::ListValue expected;
32 expected.Append(Value::CreateIntegerValue(5)); 33 expected.Append(base::Value::CreateIntegerValue(5));
33 expected.Append(expected_dict); 34 expected.Append(expected_dict);
34 EXPECT_TRUE(results->Equals(&expected)); 35 EXPECT_TRUE(results->Equals(&expected));
35 } 36 }
OLDNEW
« no previous file with comments | « tools/json_schema_compiler/test/arrays_unittest.cc ('k') | tools/json_schema_compiler/test/choices_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698