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

Unified Diff: tools/json_schema_compiler/test/objects_unittest.cc

Issue 682493002: Remove the dependency on json schema compiler. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/json_schema_compiler/test/objects.json ('k') | tools/json_schema_compiler/test/permissions.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/test/objects_unittest.cc
diff --git a/tools/json_schema_compiler/test/objects_unittest.cc b/tools/json_schema_compiler/test/objects_unittest.cc
deleted file mode 100644
index 6dc2c4548d2e8c70f96ef0e618d117b8eb903b6f..0000000000000000000000000000000000000000
--- a/tools/json_schema_compiler/test/objects_unittest.cc
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "tools/json_schema_compiler/test/objects.h"
-
-#include "base/json/json_writer.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-using namespace test::api::objects;
-
-TEST(JsonSchemaCompilerObjectsTest, ObjectParamParamsCreate) {
- {
- scoped_ptr<base::ListValue> strings(new base::ListValue());
- strings->Append(new base::StringValue("one"));
- strings->Append(new base::StringValue("two"));
- scoped_ptr<base::DictionaryValue> info_value(new base::DictionaryValue());
- info_value->Set("strings", strings.release());
- info_value->Set("integer", new base::FundamentalValue(5));
- info_value->Set("boolean", new base::FundamentalValue(true));
-
- scoped_ptr<base::ListValue> params_value(new base::ListValue());
- params_value->Append(info_value.release());
- scoped_ptr<ObjectParam::Params> params(
- ObjectParam::Params::Create(*params_value));
- EXPECT_TRUE(params.get());
- EXPECT_EQ((size_t) 2, params->info.strings.size());
- EXPECT_EQ("one", params->info.strings[0]);
- EXPECT_EQ("two", params->info.strings[1]);
- EXPECT_EQ(5, params->info.integer);
- EXPECT_TRUE(params->info.boolean);
- }
- {
- scoped_ptr<base::ListValue> strings(new base::ListValue());
- strings->Append(new base::StringValue("one"));
- strings->Append(new base::StringValue("two"));
- scoped_ptr<base::DictionaryValue> info_value(new base::DictionaryValue());
- info_value->Set("strings", strings.release());
- info_value->Set("integer", new base::FundamentalValue(5));
-
- scoped_ptr<base::ListValue> params_value(new base::ListValue());
- params_value->Append(info_value.release());
- scoped_ptr<ObjectParam::Params> params(
- ObjectParam::Params::Create(*params_value));
- EXPECT_FALSE(params.get());
- }
-}
-
-TEST(JsonSchemaCompilerObjectsTest, ReturnsObjectResultCreate) {
- ReturnsObject::Results::Info info;
- info.state = ReturnsObject::Results::Info::STATE_FOO;
- scoped_ptr<base::ListValue> results = ReturnsObject::Results::Create(info);
-
- base::DictionaryValue expected;
- expected.SetString("state", "foo");
- base::DictionaryValue* result = NULL;
- ASSERT_TRUE(results->GetDictionary(0, &result));
- ASSERT_TRUE(result->Equals(&expected));
-}
-
-TEST(JsonSchemaCompilerObjectsTest, OnObjectFiredCreate) {
- OnObjectFired::SomeObject object;
- object.state = OnObjectFired::SomeObject::STATE_BAR;
- scoped_ptr<base::ListValue> results(OnObjectFired::Create(object));
-
- base::DictionaryValue expected;
- expected.SetString("state", "bar");
- base::DictionaryValue* result = NULL;
- ASSERT_TRUE(results->GetDictionary(0, &result));
- ASSERT_TRUE(result->Equals(&expected));
-}
« no previous file with comments | « tools/json_schema_compiler/test/objects.json ('k') | tools/json_schema_compiler/test/permissions.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698