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

Unified Diff: chrome/common/json_value_serializer_unittest.cc

Issue 7661009: base: Add Is* functions to Value class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tony review Created 9 years, 4 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 | « chrome/common/json_schema_validator_unittest_base.cc ('k') | chrome/common/net/gaia/gaia_oauth_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/json_value_serializer_unittest.cc
diff --git a/chrome/common/json_value_serializer_unittest.cc b/chrome/common/json_value_serializer_unittest.cc
index 541ac8c130c5d8e1aa18b01a04f6c040e9a59d78..6439bfa3e91a806a9332ed8f645db63162492a12 100644
--- a/chrome/common/json_value_serializer_unittest.cc
+++ b/chrome/common/json_value_serializer_unittest.cc
@@ -22,14 +22,14 @@ TEST(JSONValueSerializerTest, Roundtrip) {
JSONStringValueSerializer serializer(original_serialization);
scoped_ptr<Value> root(serializer.Deserialize(NULL, NULL));
ASSERT_TRUE(root.get());
- ASSERT_TRUE(root->IsType(Value::TYPE_DICTIONARY));
+ ASSERT_TRUE(root->IsDictionary());
DictionaryValue* root_dict = static_cast<DictionaryValue*>(root.get());
Value* null_value = NULL;
ASSERT_TRUE(root_dict->Get("null", &null_value));
ASSERT_TRUE(null_value);
- ASSERT_TRUE(null_value->IsType(Value::TYPE_NULL));
+ ASSERT_TRUE(null_value->IsNull());
bool bool_value = false;
ASSERT_TRUE(root_dict->GetBoolean("bool", &bool_value));
@@ -195,7 +195,7 @@ namespace {
void ValidateJsonList(const std::string& json) {
scoped_ptr<Value> root(base::JSONReader::Read(json, false));
- ASSERT_TRUE(root.get() && root->IsType(Value::TYPE_LIST));
+ ASSERT_TRUE(root.get() && root->IsList());
ListValue* list = static_cast<ListValue*>(root.get());
ASSERT_EQ(1U, list->GetSize());
Value* elt = NULL;
@@ -219,7 +219,7 @@ TEST(JSONValueSerializerTest, JSONReaderComments) {
// It's ok to have a comment in a string.
root.reset(base::JSONReader::Read("[\"// ok\\n /* foo */ \"]", false));
- ASSERT_TRUE(root.get() && root->IsType(Value::TYPE_LIST));
+ ASSERT_TRUE(root.get() && root->IsList());
ListValue* list = static_cast<ListValue*>(root.get());
ASSERT_EQ(1U, list->GetSize());
Value* elt = NULL;
@@ -260,14 +260,14 @@ TEST_F(JSONFileValueSerializerTest, Roundtrip) {
root.reset(deserializer.Deserialize(NULL, NULL));
ASSERT_TRUE(root.get());
- ASSERT_TRUE(root->IsType(Value::TYPE_DICTIONARY));
+ ASSERT_TRUE(root->IsDictionary());
DictionaryValue* root_dict = static_cast<DictionaryValue*>(root.get());
Value* null_value = NULL;
ASSERT_TRUE(root_dict->Get("null", &null_value));
ASSERT_TRUE(null_value);
- ASSERT_TRUE(null_value->IsType(Value::TYPE_NULL));
+ ASSERT_TRUE(null_value->IsNull());
bool bool_value = false;
ASSERT_TRUE(root_dict->GetBoolean("bool", &bool_value));
« no previous file with comments | « chrome/common/json_schema_validator_unittest_base.cc ('k') | chrome/common/net/gaia/gaia_oauth_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698