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

Unified Diff: tools/json_schema_compiler/test/functions_on_types_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 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
index 73a3cf20cb17f1d7906cfbaf0bfb14012b0039ed..6fe4526db507b18cd10f80fe015b5adeac2b4c87 100644
--- a/tools/json_schema_compiler/test/functions_on_types_unittest.cc
+++ b/tools/json_schema_compiler/test/functions_on_types_unittest.cc
@@ -2,9 +2,9 @@
// 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/functions_on_types.h"
-
+#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;
@@ -13,24 +13,24 @@ TEST(JsonSchemaCompilerFunctionsOnTypesTest, StorageAreaGetParamsCreate) {
scoped_ptr<ListValue> params_value(new ListValue());
scoped_ptr<StorageArea::Get::Params> params(
StorageArea::Get::Params::Create(*params_value));
- EXPECT_TRUE(params.get());
- EXPECT_EQ(StorageArea::Get::Params::KEYS_NONE, params->keys_type);
+ ASSERT_TRUE(params);
+ EXPECT_FALSE(params->keys);
}
{
scoped_ptr<ListValue> params_value(new ListValue());
params_value->Append(Value::CreateIntegerValue(9));
scoped_ptr<StorageArea::Get::Params> params(
StorageArea::Get::Params::Create(*params_value));
- EXPECT_FALSE(params.get());
+ EXPECT_FALSE(params);
}
{
scoped_ptr<ListValue> params_value(new ListValue());
params_value->Append(Value::CreateStringValue("test"));
scoped_ptr<StorageArea::Get::Params> params(
StorageArea::Get::Params::Create(*params_value));
- EXPECT_TRUE(params.get());
- EXPECT_EQ(StorageArea::Get::Params::KEYS_STRING, params->keys_type);
- EXPECT_EQ("test", *params->keys_string);
+ ASSERT_TRUE(params);
+ ASSERT_TRUE(params->keys);
+ EXPECT_EQ("test", *params->keys->as_string);
}
{
scoped_ptr<DictionaryValue> keys_object_value(new DictionaryValue());
@@ -40,10 +40,10 @@ TEST(JsonSchemaCompilerFunctionsOnTypesTest, StorageAreaGetParamsCreate) {
params_value->Append(keys_object_value->DeepCopy());
scoped_ptr<StorageArea::Get::Params> params(
StorageArea::Get::Params::Create(*params_value));
- EXPECT_TRUE(params.get());
- EXPECT_EQ(StorageArea::Get::Params::KEYS_OBJECT, params->keys_type);
- EXPECT_TRUE(
- keys_object_value->Equals(&params->keys_object->additional_properties));
+ ASSERT_TRUE(params);
+ ASSERT_TRUE(params->keys);
+ EXPECT_TRUE(keys_object_value->Equals(
+ &params->keys->as_object->additional_properties));
}
}
@@ -53,7 +53,7 @@ TEST(JsonSchemaCompilerFunctionsOnTypesTest, StorageAreaGetResultCreate) {
items.additional_properties.SetString("sdfg", "zxcv");
scoped_ptr<ListValue> results = StorageArea::Get::Results::Create(items);
DictionaryValue* item_result = NULL;
- results->GetDictionary(0, &item_result);
+ ASSERT_TRUE(results->GetDictionary(0, &item_result));
EXPECT_TRUE(item_result->Equals(&items.additional_properties));
}
« no previous file with comments | « tools/json_schema_compiler/test/enums_unittest.cc ('k') | tools/json_schema_compiler/test/idl_schemas_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698