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

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

Issue 10701012: JSON Schema Compiler: Added event compilation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Tested GetAllPossibleParameterLists better. Created 8 years, 5 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "tools/json_schema_compiler/test/callbacks.h"
6
7 #include "chrome/common/extensions/value_builder.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 using namespace test::api::callbacks;
11 using namespace extensions;
12
13 TEST(JsonSchemaCompilerCallbacksTest, ReturnsObjectResultCreate) {
14 ReturnsObject::Result::SomeObject some_object;
15 some_object.state = ReturnsObject::Result::SomeObject::STATE_FOO;
16 scoped_ptr<ListValue> results(ReturnsObject::Result::Create(some_object));
17
18 scoped_ptr<ListValue> expected_results(
19 ListBuilder().Append(DictionaryBuilder().Set("state", "foo")).Build());
20 EXPECT_TRUE(results->Equals(expected_results.get()));
21 }
22
23 TEST(JsonSchemaCompilerCallbacksTest, ReturnsMultipleResultCreate) {
24 ReturnsMultiple::Result::SomeObject some_object;
25 some_object.state = ReturnsMultiple::Result::SomeObject::STATE_FOO;
26 scoped_ptr<ListValue> results(
27 ReturnsMultiple::Result::Create(5, some_object));
28
29 scoped_ptr<ListValue> expected_results(
30 ListBuilder().Append(5)
31 .Append(DictionaryBuilder().Set("state", "foo")).Build());
32 EXPECT_TRUE(results->Equals(expected_results.get()));
33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698