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

Unified Diff: tools/json_schema_compiler/test/functions_on_types_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
Index: tools/json_schema_compiler/test/functions_on_types_unittest.cc
diff --git a/tools/json_schema_compiler/test/functions_on_types_unittest.cc b/tools/json_schema_compiler/test/functions_on_types_unittest.cc
deleted file mode 100644
index 86ce492012929783e14c17bea0716773a2ce4a7c..0000000000000000000000000000000000000000
--- a/tools/json_schema_compiler/test/functions_on_types_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 "base/values.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "tools/json_schema_compiler/test/functions_on_types.h"
-
-using namespace test::api::functions_on_types;
-
-TEST(JsonSchemaCompilerFunctionsOnTypesTest, StorageAreaGetParamsCreate) {
- {
- scoped_ptr<base::ListValue> params_value(new base::ListValue());
- scoped_ptr<StorageArea::Get::Params> params(
- StorageArea::Get::Params::Create(*params_value));
- ASSERT_TRUE(params);
- EXPECT_FALSE(params->keys);
- }
- {
- scoped_ptr<base::ListValue> params_value(new base::ListValue());
- params_value->Append(new base::FundamentalValue(9));
- scoped_ptr<StorageArea::Get::Params> params(
- StorageArea::Get::Params::Create(*params_value));
- EXPECT_FALSE(params);
- }
- {
- scoped_ptr<base::ListValue> params_value(new base::ListValue());
- params_value->Append(new base::StringValue("test"));
- scoped_ptr<StorageArea::Get::Params> params(
- StorageArea::Get::Params::Create(*params_value));
- ASSERT_TRUE(params);
- ASSERT_TRUE(params->keys);
- EXPECT_EQ("test", *params->keys->as_string);
- }
- {
- scoped_ptr<base::DictionaryValue> keys_object_value(
- new base::DictionaryValue());
- keys_object_value->SetInteger("integer", 5);
- keys_object_value->SetString("string", "string");
- scoped_ptr<base::ListValue> params_value(new base::ListValue());
- params_value->Append(keys_object_value->DeepCopy());
- scoped_ptr<StorageArea::Get::Params> params(
- StorageArea::Get::Params::Create(*params_value));
- ASSERT_TRUE(params);
- ASSERT_TRUE(params->keys);
- EXPECT_TRUE(keys_object_value->Equals(
- &params->keys->as_object->additional_properties));
- }
-}
-
-TEST(JsonSchemaCompilerFunctionsOnTypesTest, StorageAreaGetResultCreate) {
- StorageArea::Get::Results::Items items;
- items.additional_properties.SetDouble("asdf", 0.1);
- items.additional_properties.SetString("sdfg", "zxcv");
- scoped_ptr<base::ListValue> results =
- StorageArea::Get::Results::Create(items);
- base::DictionaryValue* item_result = NULL;
- ASSERT_TRUE(results->GetDictionary(0, &item_result));
- EXPECT_TRUE(item_result->Equals(&items.additional_properties));
-}
-
-TEST(JsonSchemaCompilerFunctionsOnTypesTest, ChromeSettingGetParamsCreate) {
- scoped_ptr<base::DictionaryValue> details_value(new base::DictionaryValue());
- details_value->SetBoolean("incognito", true);
- scoped_ptr<base::ListValue> params_value(new base::ListValue());
- params_value->Append(details_value.release());
- scoped_ptr<ChromeSetting::Get::Params> params(
- ChromeSetting::Get::Params::Create(*params_value));
- EXPECT_TRUE(params.get());
- EXPECT_TRUE(*params->details.incognito);
-}
« no previous file with comments | « tools/json_schema_compiler/test/functions_on_types.json ('k') | tools/json_schema_compiler/test/idl_basics.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698