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

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

Issue 11827026: Overhaul JSON Schema Compiler to support a number of features required to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 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 | 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/objects.h" 5 #include "tools/json_schema_compiler/test/objects.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 using namespace test::api::objects; 10 using namespace test::api::objects;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 TEST(JsonSchemaCompilerObjectsTest, OnObjectFiredCreate) { 61 TEST(JsonSchemaCompilerObjectsTest, OnObjectFiredCreate) {
62 OnObjectFired::SomeObject object; 62 OnObjectFired::SomeObject object;
63 object.state = OnObjectFired::SomeObject::STATE_BAR; 63 object.state = OnObjectFired::SomeObject::STATE_BAR;
64 scoped_ptr<ListValue> results(OnObjectFired::Create(object)); 64 scoped_ptr<ListValue> results(OnObjectFired::Create(object));
65 65
66 DictionaryValue expected; 66 DictionaryValue expected;
67 expected.SetString("state", "bar"); 67 expected.SetString("state", "bar");
68 DictionaryValue* result = NULL; 68 DictionaryValue* result = NULL;
69 ASSERT_TRUE(results->GetDictionary(0, &result)); 69 ASSERT_TRUE(results->GetDictionary(0, &result));
70 ASSERT_TRUE(result->Equals(&expected)); 70 ASSERT_TRUE(result->Equals(&expected));
71
72 std::string json1 = OnObjectFired::ToJson(object);
73 std::string json2;
74 base::JSONWriter::Write(results.get(), &json2);
75 ASSERT_EQ(json1, json2);
76 } 71 }
OLDNEW
« no previous file with comments | « tools/json_schema_compiler/test/idl_schemas_unittest.cc ('k') | tools/json_schema_compiler/util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698