summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/prefs/scoped_user_pref_update.cc2
-rw-r--r--base/prefs/scoped_user_pref_update_unittest.cc12
-rw-r--r--base/values.h11
-rw-r--r--chrome/browser/extensions/external_pref_loader.cc23
-rw-r--r--chrome/browser/prefs/pref_hash_calculator.cc2
-rw-r--r--chrome/browser/prefs/pref_hash_calculator_unittest.cc22
-rw-r--r--chrome/browser/prefs/pref_hash_store_impl.cc4
-rw-r--r--chrome/browser/prefs/pref_hash_store_impl_unittest.cc12
-rw-r--r--chrome/renderer/extensions/cast_streaming_native_handler.cc4
-rw-r--r--content/renderer/v8_value_converter_impl.cc4
-rw-r--r--extensions/browser/event_router.cc4
-rw-r--r--extensions/browser/event_router_unittest.cc8
-rw-r--r--sync/internal_api/public/change_record_unittest.cc2
-rw-r--r--tools/json_schema_compiler/test/additional_properties_unittest.cc21
-rw-r--r--tools/json_schema_compiler/test/any_unittest.cc20
-rw-r--r--tools/json_schema_compiler/test/arrays_unittest.cc114
-rw-r--r--tools/json_schema_compiler/test/callbacks_unittest.cc15
-rw-r--r--tools/json_schema_compiler/test/choices_unittest.cc46
-rw-r--r--tools/json_schema_compiler/test/crossref_unittest.cc61
-rw-r--r--tools/json_schema_compiler/test/enums_unittest.cc122
-rw-r--r--tools/json_schema_compiler/test/error_generation_unittest.cc34
-rw-r--r--tools/json_schema_compiler/test/functions_as_parameters_unittest.cc32
-rw-r--r--tools/json_schema_compiler/test/functions_on_types_unittest.cc24
-rw-r--r--tools/json_schema_compiler/test/idl_schemas_unittest.cc56
-rw-r--r--tools/json_schema_compiler/test/objects_unittest.cc38
-rw-r--r--tools/json_schema_compiler/test/simple_api_unittest.cc88
-rw-r--r--tools/json_schema_compiler/util.cc18
-rw-r--r--tools/json_schema_compiler/util.h2
28 files changed, 409 insertions, 392 deletions
diff --git a/base/prefs/scoped_user_pref_update.cc b/base/prefs/scoped_user_pref_update.cc
index c86b163..41b654c 100644
--- a/base/prefs/scoped_user_pref_update.cc
+++ b/base/prefs/scoped_user_pref_update.cc
@@ -20,7 +20,7 @@ ScopedUserPrefUpdateBase::~ScopedUserPrefUpdateBase() {
Notify();
}
-Value* ScopedUserPrefUpdateBase::GetValueOfType(base::Value::Type type) {
+base::Value* ScopedUserPrefUpdateBase::GetValueOfType(base::Value::Type type) {
if (!value_)
value_ = service_->GetMutableUserPref(path_.c_str(), type);
return value_;
diff --git a/base/prefs/scoped_user_pref_update_unittest.cc b/base/prefs/scoped_user_pref_update_unittest.cc
index 505526c..dfe20747 100644
--- a/base/prefs/scoped_user_pref_update_unittest.cc
+++ b/base/prefs/scoped_user_pref_update_unittest.cc
@@ -40,13 +40,13 @@ const char ScopedUserPrefUpdateTest::kValue[] = "value";
TEST_F(ScopedUserPrefUpdateTest, RegularUse) {
// Dictionary that will be expected to be set at the end.
- DictionaryValue expected_dictionary;
+ base::DictionaryValue expected_dictionary;
expected_dictionary.SetString(kKey, kValue);
{
EXPECT_CALL(observer_, OnPreferenceChanged(_)).Times(0);
DictionaryPrefUpdate update(&prefs_, kPref);
- DictionaryValue* value = update.Get();
+ base::DictionaryValue* value = update.Get();
ASSERT_TRUE(value);
value->SetString(kKey, kValue);
@@ -55,7 +55,7 @@ TEST_F(ScopedUserPrefUpdateTest, RegularUse) {
Mock::VerifyAndClearExpectations(&observer_);
// Modifications happen online and are instantly visible, though.
- const DictionaryValue* current_value = prefs_.GetDictionary(kPref);
+ const base::DictionaryValue* current_value = prefs_.GetDictionary(kPref);
ASSERT_TRUE(current_value);
EXPECT_TRUE(expected_dictionary.Equals(current_value));
@@ -64,18 +64,18 @@ TEST_F(ScopedUserPrefUpdateTest, RegularUse) {
}
Mock::VerifyAndClearExpectations(&observer_);
- const DictionaryValue* current_value = prefs_.GetDictionary(kPref);
+ const base::DictionaryValue* current_value = prefs_.GetDictionary(kPref);
ASSERT_TRUE(current_value);
EXPECT_TRUE(expected_dictionary.Equals(current_value));
}
TEST_F(ScopedUserPrefUpdateTest, NeverTouchAnything) {
- const DictionaryValue* old_value = prefs_.GetDictionary(kPref);
+ const base::DictionaryValue* old_value = prefs_.GetDictionary(kPref);
EXPECT_CALL(observer_, OnPreferenceChanged(_)).Times(0);
{
DictionaryPrefUpdate update(&prefs_, kPref);
}
- const DictionaryValue* new_value = prefs_.GetDictionary(kPref);
+ const base::DictionaryValue* new_value = prefs_.GetDictionary(kPref);
EXPECT_EQ(old_value, new_value);
Mock::VerifyAndClearExpectations(&observer_);
}
diff --git a/base/values.h b/base/values.h
index 6512180..8caf835 100644
--- a/base/values.h
+++ b/base/values.h
@@ -31,11 +31,6 @@
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
-// This file declares "using base::Value", etc. at the bottom, so that
-// current code can use these classes without the base namespace. In
-// new code, please always use base::Value, etc. or add your own
-// "using" declaration.
-// http://crbug.com/88666
namespace base {
class DictionaryValue;
@@ -528,10 +523,4 @@ BASE_EXPORT inline std::ostream& operator<<(std::ostream& out,
} // namespace base
-// http://crbug.com/88666
-using base::DictionaryValue;
-using base::ListValue;
-using base::StringValue;
-using base::Value;
-
#endif // BASE_VALUES_H_
diff --git a/chrome/browser/extensions/external_pref_loader.cc b/chrome/browser/extensions/external_pref_loader.cc
index 567fdb2..81b68e6 100644
--- a/chrome/browser/extensions/external_pref_loader.cc
+++ b/chrome/browser/extensions/external_pref_loader.cc
@@ -67,23 +67,23 @@ std::set<base::FilePath> GetPrefsCandidateFilesFromFolder(
// occurs). An empty dictionary is returned in case of failure (e.g. invalid
// path or json content).
// Caller takes ownership of the returned dictionary.
-DictionaryValue* ExtractExtensionPrefs(base::ValueSerializer* serializer,
- const base::FilePath& path) {
+base::DictionaryValue* ExtractExtensionPrefs(base::ValueSerializer* serializer,
+ const base::FilePath& path) {
std::string error_msg;
- Value* extensions = serializer->Deserialize(NULL, &error_msg);
+ base::Value* extensions = serializer->Deserialize(NULL, &error_msg);
if (!extensions) {
LOG(WARNING) << "Unable to deserialize json data: " << error_msg
<< " in file " << path.value() << ".";
- return new DictionaryValue;
+ return new base::DictionaryValue;
}
- DictionaryValue* ext_dictionary = NULL;
+ base::DictionaryValue* ext_dictionary = NULL;
if (extensions->GetAsDictionary(&ext_dictionary))
return ext_dictionary;
LOG(WARNING) << "Expected a JSON dictionary in file "
<< path.value() << ".";
- return new DictionaryValue;
+ return new base::DictionaryValue;
}
} // namespace
@@ -112,7 +112,7 @@ void ExternalPrefLoader::StartLoading() {
void ExternalPrefLoader::LoadOnFileThread() {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
- scoped_ptr<DictionaryValue> prefs(new DictionaryValue);
+ scoped_ptr<base::DictionaryValue> prefs(new base::DictionaryValue);
// TODO(skerner): Some values of base_path_id_ will cause
// PathService::Get() to return false, because the path does
@@ -150,7 +150,8 @@ void ExternalPrefLoader::LoadOnFileThread() {
base::Bind(&ExternalPrefLoader::LoadFinished, this));
}
-void ExternalPrefLoader::ReadExternalExtensionPrefFile(DictionaryValue* prefs) {
+void ExternalPrefLoader::ReadExternalExtensionPrefFile(
+ base::DictionaryValue* prefs) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
CHECK(NULL != prefs);
@@ -181,14 +182,14 @@ void ExternalPrefLoader::ReadExternalExtensionPrefFile(DictionaryValue* prefs) {
}
JSONFileValueSerializer serializer(json_file);
- scoped_ptr<DictionaryValue> ext_prefs(
+ scoped_ptr<base::DictionaryValue> ext_prefs(
ExtractExtensionPrefs(&serializer, json_file));
if (ext_prefs)
prefs->MergeDictionary(ext_prefs.get());
}
void ExternalPrefLoader::ReadStandaloneExtensionPrefFiles(
- DictionaryValue* prefs) {
+ base::DictionaryValue* prefs) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
CHECK(NULL != prefs);
@@ -219,7 +220,7 @@ void ExternalPrefLoader::ReadStandaloneExtensionPrefFiles(
<< extension_candidate_path.LossyDisplayName().c_str();
JSONFileValueSerializer serializer(extension_candidate_path);
- scoped_ptr<DictionaryValue> ext_prefs(
+ scoped_ptr<base::DictionaryValue> ext_prefs(
ExtractExtensionPrefs(&serializer, extension_candidate_path));
if (ext_prefs) {
DVLOG(1) << "Adding extension with id: " << id;
diff --git a/chrome/browser/prefs/pref_hash_calculator.cc b/chrome/browser/prefs/pref_hash_calculator.cc
index 4a787a8..e2468f8 100644
--- a/chrome/browser/prefs/pref_hash_calculator.cc
+++ b/chrome/browser/prefs/pref_hash_calculator.cc
@@ -22,7 +22,7 @@ std::string ValueAsString(const base::Value* value) {
// Dictionary values may contain empty lists and sub-dictionaries. Make a
// deep copy with those removed to make the hash more stable.
const base::DictionaryValue* dict_value;
- scoped_ptr<DictionaryValue> canonical_dict_value;
+ scoped_ptr<base::DictionaryValue> canonical_dict_value;
if (value && value->GetAsDictionary(&dict_value)) {
canonical_dict_value.reset(dict_value->DeepCopyWithoutEmptyChildren());
value = canonical_dict_value.get();
diff --git a/chrome/browser/prefs/pref_hash_calculator_unittest.cc b/chrome/browser/prefs/pref_hash_calculator_unittest.cc
index 1f5ad7c..c3386e0 100644
--- a/chrome/browser/prefs/pref_hash_calculator_unittest.cc
+++ b/chrome/browser/prefs/pref_hash_calculator_unittest.cc
@@ -14,7 +14,7 @@ TEST(PrefHashCalculatorTest, TestCurrentAlgorithm) {
base::StringValue string_value_2("string value 2");
base::DictionaryValue dictionary_value_1;
dictionary_value_1.SetInteger("int value", 1);
- dictionary_value_1.Set("nested empty map", new DictionaryValue);
+ dictionary_value_1.Set("nested empty map", new base::DictionaryValue);
base::DictionaryValue dictionary_value_1_equivalent;
dictionary_value_1_equivalent.SetInteger("int value", 1);
base::DictionaryValue dictionary_value_2;
@@ -91,11 +91,11 @@ TEST(PrefHashCalculatorTest, CatchHashChanges) {
static const char kExpectedValue[] =
"A50FE7EB31BFBC32B8A27E71730AF15421178A9B5815644ACE174B18966735B9";
- DictionaryValue dict;
- dict.Set("a", new StringValue("foo"));
- dict.Set("d", new StringValue("bad"));
- dict.Set("b", new StringValue("bar"));
- dict.Set("c", new StringValue("baz"));
+ base::DictionaryValue dict;
+ dict.Set("a", new base::StringValue("foo"));
+ dict.Set("d", new base::StringValue("bad"));
+ dict.Set("b", new base::StringValue("bar"));
+ dict.Set("c", new base::StringValue("baz"));
// 32 NULL bytes is the seed that was used to generate the hash in old
// tests. Use it again to ensure that we haven't altered the algorithm.
@@ -110,11 +110,11 @@ TEST(PrefHashCalculatorTest, TestLegacyAlgorithm) {
"C503FB7C65EEFD5C07185F616A0AA67923C069909933F362022B1F187E73E9A2";
const char* kDeviceId = "deviceid";
- DictionaryValue dict;
- dict.Set("a", new StringValue("foo"));
- dict.Set("d", new StringValue("bad"));
- dict.Set("b", new StringValue("bar"));
- dict.Set("c", new StringValue("baz"));
+ base::DictionaryValue dict;
+ dict.Set("a", new base::StringValue("foo"));
+ dict.Set("d", new base::StringValue("bad"));
+ dict.Set("b", new base::StringValue("bar"));
+ dict.Set("c", new base::StringValue("baz"));
// 32 NULL bytes is the seed that was used to generate the legacy hash.
EXPECT_EQ(PrefHashCalculator::VALID_LEGACY,
diff --git a/chrome/browser/prefs/pref_hash_store_impl.cc b/chrome/browser/prefs/pref_hash_store_impl.cc
index 0d08c55..ef698fc 100644
--- a/chrome/browser/prefs/pref_hash_store_impl.cc
+++ b/chrome/browser/prefs/pref_hash_store_impl.cc
@@ -57,13 +57,13 @@ void PrefHashStoreImpl::StoreHash(
const std::string& path, const base::Value* new_value) {
{
DictionaryPrefUpdate update(local_state_, prefs::kProfilePreferenceHashes);
- DictionaryValue* child_dictionary = NULL;
+ base::DictionaryValue* child_dictionary = NULL;
// Get the dictionary corresponding to the profile name, which may have a
// '.'
if (!update->GetDictionaryWithoutPathExpansion(hash_store_id_,
&child_dictionary)) {
- child_dictionary = new DictionaryValue;
+ child_dictionary = new base::DictionaryValue;
update->SetWithoutPathExpansion(hash_store_id_, child_dictionary);
}
diff --git a/chrome/browser/prefs/pref_hash_store_impl_unittest.cc b/chrome/browser/prefs/pref_hash_store_impl_unittest.cc
index 330879a..c6e3aee 100644
--- a/chrome/browser/prefs/pref_hash_store_impl_unittest.cc
+++ b/chrome/browser/prefs/pref_hash_store_impl_unittest.cc
@@ -37,15 +37,15 @@ TEST(PrefHashStoreImplTest, TestCase) {
ASSERT_EQ(PrefHashStore::CHANGED,
pref_hash_store.CheckValue("path1", &string_2));
- DictionaryValue dict;
- dict.Set("a", new StringValue("foo"));
- dict.Set("d", new StringValue("bad"));
- dict.Set("b", new StringValue("bar"));
- dict.Set("c", new StringValue("baz"));
+ base::DictionaryValue dict;
+ dict.Set("a", new base::StringValue("foo"));
+ dict.Set("d", new base::StringValue("bad"));
+ dict.Set("b", new base::StringValue("bar"));
+ dict.Set("c", new base::StringValue("baz"));
// Manually shove in a legacy hash.
DictionaryPrefUpdate update(&local_state, prefs::kProfilePreferenceHashes);
- DictionaryValue* child_dictionary = NULL;
+ base::DictionaryValue* child_dictionary = NULL;
ASSERT_TRUE(update->GetDictionary("store_id", &child_dictionary));
child_dictionary->SetString(
"path1",
diff --git a/chrome/renderer/extensions/cast_streaming_native_handler.cc b/chrome/renderer/extensions/cast_streaming_native_handler.cc
index a7532e8..55d0a69 100644
--- a/chrome/renderer/extensions/cast_streaming_native_handler.cc
+++ b/chrome/renderer/extensions/cast_streaming_native_handler.cc
@@ -262,7 +262,7 @@ void CastStreamingNativeHandler::StartCastRtpStream(
return;
scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create());
- scoped_ptr<Value> params_value(
+ scoped_ptr<base::Value> params_value(
converter->FromV8Value(args[1], context()->v8_context()));
if (!params_value) {
args.GetIsolate()->ThrowException(v8::Exception::TypeError(
@@ -316,7 +316,7 @@ void CastStreamingNativeHandler::StartCastUdpTransport(
return;
scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create());
- scoped_ptr<Value> udp_params_value(
+ scoped_ptr<base::Value> udp_params_value(
converter->FromV8Value(args[1], context()->v8_context()));
if (!udp_params_value) {
args.GetIsolate()->ThrowException(v8::Exception::TypeError(
diff --git a/content/renderer/v8_value_converter_impl.cc b/content/renderer/v8_value_converter_impl.cc
index d5f3883..3b14bd5 100644
--- a/content/renderer/v8_value_converter_impl.cc
+++ b/content/renderer/v8_value_converter_impl.cc
@@ -119,7 +119,7 @@ v8::Handle<v8::Value> V8ValueConverterImpl::ToV8Value(
return handle_scope.Escape(ToV8ValueImpl(context->GetIsolate(), value));
}
-Value* V8ValueConverterImpl::FromV8Value(
+base::Value* V8ValueConverterImpl::FromV8Value(
v8::Handle<v8::Value> val,
v8::Handle<v8::Context> context) const {
v8::Context::Scope context_scope(context);
@@ -231,7 +231,7 @@ v8::Handle<v8::Value> V8ValueConverterImpl::ToArrayBuffer(
return buffer.toV8Value();
}
-Value* V8ValueConverterImpl::FromV8ValueImpl(
+base::Value* V8ValueConverterImpl::FromV8ValueImpl(
v8::Handle<v8::Value> val,
FromV8ValueState* state,
v8::Isolate* isolate) const {
diff --git a/extensions/browser/event_router.cc b/extensions/browser/event_router.cc
index 6105572..5daabf0 100644
--- a/extensions/browser/event_router.cc
+++ b/extensions/browser/event_router.cc
@@ -122,7 +122,7 @@ void EventRouter::DispatchExtensionMessage(IPC::Sender* ipc_sender,
// DispatchExtensionMessage does _not_ take ownership of event_args, so we
// must ensure that the destruction of args does not attempt to free it.
- scoped_ptr<Value> removed_event_args;
+ scoped_ptr<base::Value> removed_event_args;
args.Remove(1, &removed_event_args);
ignore_result(removed_event_args.release());
}
@@ -356,7 +356,7 @@ void EventRouter::SetRegisteredEvents(const std::string& extension_id,
ListValue* events_value = new ListValue;
for (std::set<std::string>::const_iterator iter = events.begin();
iter != events.end(); ++iter) {
- events_value->Append(new StringValue(*iter));
+ events_value->Append(new base::StringValue(*iter));
}
extension_prefs_->UpdateExtensionPref(
extension_id, kRegisteredEvents, events_value);
diff --git a/extensions/browser/event_router_unittest.cc b/extensions/browser/event_router_unittest.cc
index ba5fed3..c47b7f2 100644
--- a/extensions/browser/event_router_unittest.cc
+++ b/extensions/browser/event_router_unittest.cc
@@ -69,7 +69,7 @@ TEST_F(EventRouterTest, GetBaseEventName) {
TEST_F(EventRouterTest, EventRouterObserver) {
EventRouter router(NULL, NULL);
EventListener listener(
- "event_name", "extension_id", NULL, scoped_ptr<DictionaryValue>());
+ "event_name", "extension_id", NULL, scoped_ptr<base::DictionaryValue>());
// Add/remove works without any observers.
router.OnListenerAdded(&listener);
@@ -104,8 +104,10 @@ TEST_F(EventRouterTest, EventRouterObserver) {
// Adding a listener with a sub-event notifies the main observer with
// proper details.
matching_observer.Reset();
- EventListener sub_event_listener(
- "event_name/1", "extension_id", NULL, scoped_ptr<DictionaryValue>());
+ EventListener sub_event_listener("event_name/1",
+ "extension_id",
+ NULL,
+ scoped_ptr<base::DictionaryValue>());
router.OnListenerAdded(&sub_event_listener);
EXPECT_EQ(1, matching_observer.listener_added_count());
EXPECT_EQ(0, matching_observer.listener_removed_count());
diff --git a/sync/internal_api/public/change_record_unittest.cc b/sync/internal_api/public/change_record_unittest.cc
index 201ed65..3d532d6 100644
--- a/sync/internal_api/public/change_record_unittest.cc
+++ b/sync/internal_api/public/change_record_unittest.cc
@@ -58,7 +58,7 @@ void CheckChangeRecordValue(
const base::Value* extra_value = NULL;
EXPECT_EQ(record.extra.get() != NULL,
value.Get("extra", &extra_value));
- EXPECT_TRUE(Value::Equals(extra_value, expected_extra_value.get()));
+ EXPECT_TRUE(base::Value::Equals(extra_value, expected_extra_value.get()));
scoped_ptr<base::DictionaryValue> expected_specifics_value(
EntitySpecificsToValue(record.specifics));
diff --git a/tools/json_schema_compiler/test/additional_properties_unittest.cc b/tools/json_schema_compiler/test/additional_properties_unittest.cc
index 5e08d5e..ac0a0f2 100644
--- a/tools/json_schema_compiler/test/additional_properties_unittest.cc
+++ b/tools/json_schema_compiler/test/additional_properties_unittest.cc
@@ -10,10 +10,10 @@ using namespace test::api::additional_properties;
TEST(JsonSchemaCompilerAdditionalPropertiesTest,
AdditionalPropertiesTypePopulate) {
{
- scoped_ptr<ListValue> list_value(new ListValue());
- list_value->Append(Value::CreateStringValue("asdf"));
- list_value->Append(Value::CreateIntegerValue(4));
- scoped_ptr<DictionaryValue> type_value(new DictionaryValue());
+ scoped_ptr<base::ListValue> list_value(new base::ListValue());
+ list_value->Append(base::Value::CreateStringValue("asdf"));
+ list_value->Append(base::Value::CreateIntegerValue(4));
+ scoped_ptr<base::DictionaryValue> type_value(new base::DictionaryValue());
type_value->SetString("string", "value");
type_value->SetInteger("other", 9);
type_value->Set("another", list_value.release());
@@ -22,7 +22,7 @@ TEST(JsonSchemaCompilerAdditionalPropertiesTest,
EXPECT_TRUE(type->additional_properties.Equals(type_value.get()));
}
{
- scoped_ptr<DictionaryValue> type_value(new DictionaryValue());
+ scoped_ptr<base::DictionaryValue> type_value(new base::DictionaryValue());
type_value->SetInteger("string", 3);
scoped_ptr<AdditionalPropertiesType> type(new AdditionalPropertiesType());
EXPECT_FALSE(AdditionalPropertiesType::Populate(*type_value, type.get()));
@@ -31,10 +31,11 @@ TEST(JsonSchemaCompilerAdditionalPropertiesTest,
TEST(JsonSchemaCompilerAdditionalPropertiesTest,
AdditionalPropertiesParamsCreate) {
- scoped_ptr<DictionaryValue> param_object_value(new DictionaryValue());
+ scoped_ptr<base::DictionaryValue> param_object_value(
+ new base::DictionaryValue());
param_object_value->SetString("str", "a");
param_object_value->SetInteger("num", 1);
- scoped_ptr<ListValue> params_value(new ListValue());
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
params_value->Append(param_object_value->DeepCopy());
scoped_ptr<AdditionalProperties::Params> params(
AdditionalProperties::Params::Create(*params_value));
@@ -49,15 +50,15 @@ TEST(JsonSchemaCompilerAdditionalPropertiesTest,
result_object.integer = 5;
result_object.additional_properties["key"] = "value";
- ListValue expected;
+ base::ListValue expected;
{
- DictionaryValue* dict = new DictionaryValue();
+ base::DictionaryValue* dict = new base::DictionaryValue();
dict->SetInteger("integer", 5);
dict->SetString("key", "value");
expected.Append(dict);
}
- EXPECT_TRUE(Value::Equals(
+ EXPECT_TRUE(base::Value::Equals(
ReturnAdditionalProperties::Results::Create(result_object).get(),
&expected));
}
diff --git a/tools/json_schema_compiler/test/any_unittest.cc b/tools/json_schema_compiler/test/any_unittest.cc
index 81fd681..7e3215f 100644
--- a/tools/json_schema_compiler/test/any_unittest.cc
+++ b/tools/json_schema_compiler/test/any_unittest.cc
@@ -10,33 +10,35 @@ using namespace test::api::any;
TEST(JsonSchemaCompilerAnyTest, AnyTypePopulate) {
{
AnyType any_type;
- scoped_ptr<DictionaryValue> any_type_value(new DictionaryValue());
+ scoped_ptr<base::DictionaryValue> any_type_value(
+ new base::DictionaryValue());
any_type_value->SetString("any", "value");
EXPECT_TRUE(AnyType::Populate(*any_type_value, &any_type));
- scoped_ptr<Value> any_type_to_value(any_type.ToValue());
+ scoped_ptr<base::Value> any_type_to_value(any_type.ToValue());
EXPECT_TRUE(any_type_value->Equals(any_type_to_value.get()));
}
{
AnyType any_type;
- scoped_ptr<DictionaryValue> any_type_value(new DictionaryValue());
+ scoped_ptr<base::DictionaryValue> any_type_value(
+ new base::DictionaryValue());
any_type_value->SetInteger("any", 5);
EXPECT_TRUE(AnyType::Populate(*any_type_value, &any_type));
- scoped_ptr<Value> any_type_to_value(any_type.ToValue());
+ scoped_ptr<base::Value> any_type_to_value(any_type.ToValue());
EXPECT_TRUE(any_type_value->Equals(any_type_to_value.get()));
}
}
TEST(JsonSchemaCompilerAnyTest, OptionalAnyParamsCreate) {
{
- scoped_ptr<ListValue> params_value(new ListValue());
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
scoped_ptr<OptionalAny::Params> params(
OptionalAny::Params::Create(*params_value));
EXPECT_TRUE(params.get());
EXPECT_FALSE(params->any_name.get());
}
{
- scoped_ptr<ListValue> params_value(new ListValue());
- scoped_ptr<Value> param(Value::CreateStringValue("asdf"));
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ scoped_ptr<base::Value> param(base::Value::CreateStringValue("asdf"));
params_value->Append(param->DeepCopy());
scoped_ptr<OptionalAny::Params> params(
OptionalAny::Params::Create(*params_value));
@@ -45,8 +47,8 @@ TEST(JsonSchemaCompilerAnyTest, OptionalAnyParamsCreate) {
EXPECT_TRUE(params->any_name->Equals(param.get()));
}
{
- scoped_ptr<ListValue> params_value(new ListValue());
- scoped_ptr<Value> param(Value::CreateBooleanValue(true));
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ scoped_ptr<base::Value> param(base::Value::CreateBooleanValue(true));
params_value->Append(param->DeepCopy());
scoped_ptr<OptionalAny::Params> params(
OptionalAny::Params::Create(*params_value));
diff --git a/tools/json_schema_compiler/test/arrays_unittest.cc b/tools/json_schema_compiler/test/arrays_unittest.cc
index e480c8e..f3fb058 100644
--- a/tools/json_schema_compiler/test/arrays_unittest.cc
+++ b/tools/json_schema_compiler/test/arrays_unittest.cc
@@ -11,32 +11,32 @@ using namespace test::api::arrays;
namespace {
// TODO(calamity): Change to AppendString etc once kalman's patch goes through
-static scoped_ptr<DictionaryValue> CreateBasicArrayTypeDictionary() {
- DictionaryValue* value = new DictionaryValue();
- ListValue* strings_value = new ListValue();
- strings_value->Append(Value::CreateStringValue("a"));
- strings_value->Append(Value::CreateStringValue("b"));
- strings_value->Append(Value::CreateStringValue("c"));
- strings_value->Append(Value::CreateStringValue("it's easy as"));
- ListValue* integers_value = new ListValue();
- integers_value->Append(Value::CreateIntegerValue(1));
- integers_value->Append(Value::CreateIntegerValue(2));
- integers_value->Append(Value::CreateIntegerValue(3));
- ListValue* booleans_value = new ListValue();
- booleans_value->Append(Value::CreateBooleanValue(false));
- booleans_value->Append(Value::CreateBooleanValue(true));
- ListValue* numbers_value = new ListValue();
- numbers_value->Append(Value::CreateDoubleValue(6.1));
+static scoped_ptr<base::DictionaryValue> CreateBasicArrayTypeDictionary() {
+ base::DictionaryValue* value = new base::DictionaryValue();
+ base::ListValue* strings_value = new base::ListValue();
+ strings_value->Append(base::Value::CreateStringValue("a"));
+ strings_value->Append(base::Value::CreateStringValue("b"));
+ strings_value->Append(base::Value::CreateStringValue("c"));
+ strings_value->Append(base::Value::CreateStringValue("it's easy as"));
+ base::ListValue* integers_value = new base::ListValue();
+ integers_value->Append(base::Value::CreateIntegerValue(1));
+ integers_value->Append(base::Value::CreateIntegerValue(2));
+ integers_value->Append(base::Value::CreateIntegerValue(3));
+ base::ListValue* booleans_value = new base::ListValue();
+ booleans_value->Append(base::Value::CreateBooleanValue(false));
+ booleans_value->Append(base::Value::CreateBooleanValue(true));
+ base::ListValue* numbers_value = new base::ListValue();
+ numbers_value->Append(base::Value::CreateDoubleValue(6.1));
value->Set("numbers", numbers_value);
value->Set("booleans", booleans_value);
value->Set("strings", strings_value);
value->Set("integers", integers_value);
- return scoped_ptr<DictionaryValue>(value);
+ return scoped_ptr<base::DictionaryValue>(value);
}
-static Value* CreateItemValue(int val) {
- DictionaryValue* value(new DictionaryValue());
- value->Set("val", Value::CreateIntegerValue(val));
+static base::Value* CreateItemValue(int val) {
+ base::DictionaryValue* value(new base::DictionaryValue());
+ value->Set("val", base::Value::CreateIntegerValue(val));
return value;
}
@@ -44,7 +44,7 @@ static Value* CreateItemValue(int val) {
TEST(JsonSchemaCompilerArrayTest, BasicArrayType) {
{
- scoped_ptr<DictionaryValue> value = CreateBasicArrayTypeDictionary();
+ scoped_ptr<base::DictionaryValue> value = CreateBasicArrayTypeDictionary();
scoped_ptr<BasicArrayType> basic_array_type(new BasicArrayType());
ASSERT_TRUE(BasicArrayType::Populate(*value, basic_array_type.get()));
EXPECT_TRUE(value->Equals(basic_array_type->ToValue().get()));
@@ -57,11 +57,11 @@ TEST(JsonSchemaCompilerArrayTest, EnumArrayType) {
enums.push_back(EnumArrayType::TYPES_TYPE_TWO);
enums.push_back(EnumArrayType::TYPES_TYPE_THREE);
- scoped_ptr<ListValue> types(new ListValue());
+ scoped_ptr<base::ListValue> types(new base::ListValue());
for (size_t i = 0; i < enums.size(); ++i)
types->Append(new base::StringValue(EnumArrayType::ToString(enums[i])));
- DictionaryValue value;
+ base::DictionaryValue value;
value.Set("types", types.release());
EnumArrayType enum_array_type;
@@ -76,13 +76,13 @@ TEST(JsonSchemaCompilerArrayTest, OptionalEnumArrayType) {
enums.push_back(OptionalEnumArrayType::TYPES_TYPE_TWO);
enums.push_back(OptionalEnumArrayType::TYPES_TYPE_THREE);
- scoped_ptr<ListValue> types(new ListValue());
+ scoped_ptr<base::ListValue> types(new base::ListValue());
for (size_t i = 0; i < enums.size(); ++i) {
types->Append(new base::StringValue(
OptionalEnumArrayType::ToString(enums[i])));
}
- DictionaryValue value;
+ base::DictionaryValue value;
value.Set("types", types.release());
OptionalEnumArrayType enum_array_type;
@@ -90,9 +90,9 @@ TEST(JsonSchemaCompilerArrayTest, OptionalEnumArrayType) {
EXPECT_EQ(enums, *enum_array_type.types);
}
{
- DictionaryValue value;
- scoped_ptr<ListValue> enum_array(new ListValue());
- enum_array->Append(Value::CreateStringValue("invalid"));
+ base::DictionaryValue value;
+ scoped_ptr<base::ListValue> enum_array(new base::ListValue());
+ enum_array->Append(base::Value::CreateStringValue("invalid"));
value.Set("types", enum_array.release());
OptionalEnumArrayType enum_array_type;
@@ -103,8 +103,8 @@ TEST(JsonSchemaCompilerArrayTest, OptionalEnumArrayType) {
TEST(JsonSchemaCompilerArrayTest, RefArrayType) {
{
- scoped_ptr<DictionaryValue> value(new DictionaryValue());
- scoped_ptr<ListValue> ref_array(new ListValue());
+ scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ scoped_ptr<base::ListValue> ref_array(new base::ListValue());
ref_array->Append(CreateItemValue(1));
ref_array->Append(CreateItemValue(2));
ref_array->Append(CreateItemValue(3));
@@ -117,10 +117,10 @@ TEST(JsonSchemaCompilerArrayTest, RefArrayType) {
EXPECT_EQ(3, ref_array_type->refs[2]->val);
}
{
- scoped_ptr<DictionaryValue> value(new DictionaryValue());
- scoped_ptr<ListValue> not_ref_array(new ListValue());
+ scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ scoped_ptr<base::ListValue> not_ref_array(new base::ListValue());
not_ref_array->Append(CreateItemValue(1));
- not_ref_array->Append(Value::CreateIntegerValue(3));
+ not_ref_array->Append(base::Value::CreateIntegerValue(3));
value->Set("refs", not_ref_array.release());
scoped_ptr<RefArrayType> ref_array_type(new RefArrayType());
EXPECT_FALSE(RefArrayType::Populate(*value, ref_array_type.get()));
@@ -128,11 +128,11 @@ TEST(JsonSchemaCompilerArrayTest, RefArrayType) {
}
TEST(JsonSchemaCompilerArrayTest, IntegerArrayParamsCreate) {
- scoped_ptr<ListValue> params_value(new ListValue());
- scoped_ptr<ListValue> integer_array(new ListValue());
- integer_array->Append(Value::CreateIntegerValue(2));
- integer_array->Append(Value::CreateIntegerValue(4));
- integer_array->Append(Value::CreateIntegerValue(8));
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ scoped_ptr<base::ListValue> integer_array(new base::ListValue());
+ integer_array->Append(base::Value::CreateIntegerValue(2));
+ integer_array->Append(base::Value::CreateIntegerValue(4));
+ integer_array->Append(base::Value::CreateIntegerValue(8));
params_value->Append(integer_array.release());
scoped_ptr<IntegerArray::Params> params(
IntegerArray::Params::Create(*params_value));
@@ -144,10 +144,10 @@ TEST(JsonSchemaCompilerArrayTest, IntegerArrayParamsCreate) {
}
TEST(JsonSchemaCompilerArrayTest, AnyArrayParamsCreate) {
- scoped_ptr<ListValue> params_value(new ListValue());
- scoped_ptr<ListValue> any_array(new ListValue());
- any_array->Append(Value::CreateIntegerValue(1));
- any_array->Append(Value::CreateStringValue("test"));
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ scoped_ptr<base::ListValue> any_array(new base::ListValue());
+ any_array->Append(base::Value::CreateIntegerValue(1));
+ any_array->Append(base::Value::CreateStringValue("test"));
any_array->Append(CreateItemValue(2));
params_value->Append(any_array.release());
scoped_ptr<AnyArray::Params> params(
@@ -160,8 +160,8 @@ TEST(JsonSchemaCompilerArrayTest, AnyArrayParamsCreate) {
}
TEST(JsonSchemaCompilerArrayTest, ObjectArrayParamsCreate) {
- scoped_ptr<ListValue> params_value(new ListValue());
- scoped_ptr<ListValue> item_array(new ListValue());
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ scoped_ptr<base::ListValue> item_array(new base::ListValue());
item_array->Append(CreateItemValue(1));
item_array->Append(CreateItemValue(2));
params_value->Append(item_array.release());
@@ -174,8 +174,8 @@ TEST(JsonSchemaCompilerArrayTest, ObjectArrayParamsCreate) {
}
TEST(JsonSchemaCompilerArrayTest, RefArrayParamsCreate) {
- scoped_ptr<ListValue> params_value(new ListValue());
- scoped_ptr<ListValue> item_array(new ListValue());
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ scoped_ptr<base::ListValue> item_array(new base::ListValue());
item_array->Append(CreateItemValue(1));
item_array->Append(CreateItemValue(2));
params_value->Append(item_array.release());
@@ -191,12 +191,13 @@ TEST(JsonSchemaCompilerArrayTest, ReturnIntegerArrayResultCreate) {
std::vector<int> integers;
integers.push_back(1);
integers.push_back(2);
- scoped_ptr<ListValue> results = ReturnIntegerArray::Results::Create(integers);
+ scoped_ptr<base::ListValue> results =
+ ReturnIntegerArray::Results::Create(integers);
- ListValue expected;
- ListValue* expected_argument = new ListValue();
- expected_argument->Append(Value::CreateIntegerValue(1));
- expected_argument->Append(Value::CreateIntegerValue(2));
+ base::ListValue expected;
+ base::ListValue* expected_argument = new base::ListValue();
+ expected_argument->Append(base::Value::CreateIntegerValue(1));
+ expected_argument->Append(base::Value::CreateIntegerValue(2));
expected.Append(expected_argument);
EXPECT_TRUE(results->Equals(&expected));
}
@@ -207,14 +208,15 @@ TEST(JsonSchemaCompilerArrayTest, ReturnRefArrayResultCreate) {
items.push_back(linked_ptr<Item>(new Item()));
items[0]->val = 1;
items[1]->val = 2;
- scoped_ptr<ListValue> results = ReturnRefArray::Results::Create(items);
+ scoped_ptr<base::ListValue> results =
+ ReturnRefArray::Results::Create(items);
- ListValue expected;
- ListValue* expected_argument = new ListValue();
- DictionaryValue* first = new DictionaryValue();
+ base::ListValue expected;
+ base::ListValue* expected_argument = new base::ListValue();
+ base::DictionaryValue* first = new base::DictionaryValue();
first->SetInteger("val", 1);
expected_argument->Append(first);
- DictionaryValue* second = new DictionaryValue();
+ base::DictionaryValue* second = new base::DictionaryValue();
second->SetInteger("val", 2);
expected_argument->Append(second);
expected.Append(expected_argument);
diff --git a/tools/json_schema_compiler/test/callbacks_unittest.cc b/tools/json_schema_compiler/test/callbacks_unittest.cc
index 163a6c0..e69289e 100644
--- a/tools/json_schema_compiler/test/callbacks_unittest.cc
+++ b/tools/json_schema_compiler/test/callbacks_unittest.cc
@@ -11,11 +11,12 @@ using namespace test::api::callbacks;
TEST(JsonSchemaCompilerCallbacksTest, ReturnsObjectResultCreate) {
ReturnsObject::Results::SomeObject some_object;
some_object.state = ReturnsObject::Results::SomeObject::STATE_FOO;
- scoped_ptr<ListValue> results = ReturnsObject::Results::Create(some_object);
+ scoped_ptr<base::ListValue> results =
+ ReturnsObject::Results::Create(some_object);
- DictionaryValue* expected_dict = new DictionaryValue();
+ base::DictionaryValue* expected_dict = new base::DictionaryValue();
expected_dict->SetString("state", "foo");
- ListValue expected;
+ base::ListValue expected;
expected.Append(expected_dict);
EXPECT_TRUE(results->Equals(&expected));
}
@@ -23,13 +24,13 @@ TEST(JsonSchemaCompilerCallbacksTest, ReturnsObjectResultCreate) {
TEST(JsonSchemaCompilerCallbacksTest, ReturnsMultipleResultCreate) {
ReturnsMultiple::Results::SomeObject some_object;
some_object.state = ReturnsMultiple::Results::SomeObject::STATE_FOO;
- scoped_ptr<ListValue> results =
+ scoped_ptr<base::ListValue> results =
ReturnsMultiple::Results::Create(5, some_object);
- DictionaryValue* expected_dict = new DictionaryValue();
+ base::DictionaryValue* expected_dict = new base::DictionaryValue();
expected_dict->SetString("state", "foo");
- ListValue expected;
- expected.Append(Value::CreateIntegerValue(5));
+ base::ListValue expected;
+ expected.Append(base::Value::CreateIntegerValue(5));
expected.Append(expected_dict);
EXPECT_TRUE(results->Equals(&expected));
}
diff --git a/tools/json_schema_compiler/test/choices_unittest.cc b/tools/json_schema_compiler/test/choices_unittest.cc
index fec9c88..5be117c3 100644
--- a/tools/json_schema_compiler/test/choices_unittest.cc
+++ b/tools/json_schema_compiler/test/choices_unittest.cc
@@ -19,21 +19,21 @@ using json_schema_compiler::test_util::Vector;
TEST(JsonSchemaCompilerChoicesTest, TakesIntegersParamsCreate) {
{
scoped_ptr<TakesIntegers::Params> params(TakesIntegers::Params::Create(
- *List(Value::CreateBooleanValue(true))));
+ *List(base::Value::CreateBooleanValue(true))));
EXPECT_FALSE(params);
}
{
scoped_ptr<TakesIntegers::Params> params(TakesIntegers::Params::Create(
- *List(Value::CreateIntegerValue(6))));
+ *List(base::Value::CreateIntegerValue(6))));
ASSERT_TRUE(params);
EXPECT_FALSE(params->nums.as_integers);
EXPECT_EQ(6, *params->nums.as_integer);
}
{
scoped_ptr<TakesIntegers::Params> params(TakesIntegers::Params::Create(
- *List(List(Value::CreateIntegerValue(2),
- Value::CreateIntegerValue(6),
- Value::CreateIntegerValue(8)).release())));
+ *List(List(base::Value::CreateIntegerValue(2),
+ base::Value::CreateIntegerValue(6),
+ base::Value::CreateIntegerValue(8)).release())));
ASSERT_TRUE(params);
ASSERT_TRUE(params->nums.as_integers);
EXPECT_EQ(Vector(2, 6, 8), *params->nums.as_integers);
@@ -69,32 +69,32 @@ TEST(JsonSchemaCompilerChoicesTest, ObjectWithChoicesParamsCreate) {
TEST(JsonSchemaCompilerChoicesTest, ObjectWithChoicesParamsCreateFail) {
{
- scoped_ptr<DictionaryValue> object_param(new DictionaryValue());
+ scoped_ptr<base::DictionaryValue> object_param(new base::DictionaryValue());
object_param->SetWithoutPathExpansion("strings",
- Value::CreateIntegerValue(5));
- scoped_ptr<ListValue> params_value(new ListValue());
+ base::Value::CreateIntegerValue(5));
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
params_value->Append(object_param.release());
scoped_ptr<ObjectWithChoices::Params> params(
ObjectWithChoices::Params::Create(*params_value));
EXPECT_FALSE(params.get());
}
{
- scoped_ptr<DictionaryValue> object_param(new DictionaryValue());
+ scoped_ptr<base::DictionaryValue> object_param(new base::DictionaryValue());
object_param->SetWithoutPathExpansion("strings",
- Value::CreateStringValue("asdf"));
+ base::Value::CreateStringValue("asdf"));
object_param->SetWithoutPathExpansion("integers",
- Value::CreateStringValue("asdf"));
- scoped_ptr<ListValue> params_value(new ListValue());
+ base::Value::CreateStringValue("asdf"));
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
params_value->Append(object_param.release());
scoped_ptr<ObjectWithChoices::Params> params(
ObjectWithChoices::Params::Create(*params_value));
EXPECT_FALSE(params.get());
}
{
- scoped_ptr<DictionaryValue> object_param(new DictionaryValue());
+ scoped_ptr<base::DictionaryValue> object_param(new base::DictionaryValue());
object_param->SetWithoutPathExpansion("integers",
- Value::CreateIntegerValue(6));
- scoped_ptr<ListValue> params_value(new ListValue());
+ base::Value::CreateIntegerValue(6));
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
params_value->Append(object_param.release());
scoped_ptr<ObjectWithChoices::Params> params(
ObjectWithChoices::Params::Create(*params_value));
@@ -107,11 +107,11 @@ TEST(JsonSchemaCompilerChoicesTest, PopulateChoiceType) {
std::string("of"),
std::string("strings"));
- ListValue* strings_value = new ListValue();
+ base::ListValue* strings_value = new base::ListValue();
for (size_t i = 0; i < strings.size(); ++i)
- strings_value->Append(Value::CreateStringValue(strings[i]));
+ strings_value->Append(base::Value::CreateStringValue(strings[i]));
- DictionaryValue value;
+ base::DictionaryValue value;
value.SetInteger("integers", 4);
value.Set("strings", strings_value);
@@ -127,12 +127,12 @@ TEST(JsonSchemaCompilerChoicesTest, PopulateChoiceType) {
}
TEST(JsonSchemaCompilerChoicesTest, ChoiceTypeToValue) {
- ListValue* strings_value = new ListValue();
- strings_value->Append(Value::CreateStringValue("list"));
- strings_value->Append(Value::CreateStringValue("of"));
- strings_value->Append(Value::CreateStringValue("strings"));
+ base::ListValue* strings_value = new base::ListValue();
+ strings_value->Append(base::Value::CreateStringValue("list"));
+ strings_value->Append(base::Value::CreateStringValue("of"));
+ strings_value->Append(base::Value::CreateStringValue("strings"));
- DictionaryValue value;
+ base::DictionaryValue value;
value.SetInteger("integers", 5);
value.Set("strings", strings_value);
diff --git a/tools/json_schema_compiler/test/crossref_unittest.cc b/tools/json_schema_compiler/test/crossref_unittest.cc
index d2747fd..df91b2d2 100644
--- a/tools/json_schema_compiler/test/crossref_unittest.cc
+++ b/tools/json_schema_compiler/test/crossref_unittest.cc
@@ -11,20 +11,22 @@ using namespace test::api::crossref;
namespace {
-static scoped_ptr<DictionaryValue> CreateTestTypeDictionary() {
- DictionaryValue* value(new DictionaryValue());
- value->SetWithoutPathExpansion("number", Value::CreateDoubleValue(1.1));
- value->SetWithoutPathExpansion("integer", Value::CreateIntegerValue(4));
- value->SetWithoutPathExpansion("string", Value::CreateStringValue("bling"));
- value->SetWithoutPathExpansion("boolean", Value::CreateBooleanValue(true));
- return scoped_ptr<DictionaryValue>(value);
+static scoped_ptr<base::DictionaryValue> CreateTestTypeDictionary() {
+ base::DictionaryValue* value(new base::DictionaryValue());
+ value->SetWithoutPathExpansion("number", base::Value::CreateDoubleValue(1.1));
+ value->SetWithoutPathExpansion("integer", base::Value::CreateIntegerValue(4));
+ value->SetWithoutPathExpansion("string",
+ base::Value::CreateStringValue("bling"));
+ value->SetWithoutPathExpansion("boolean",
+ base::Value::CreateBooleanValue(true));
+ return scoped_ptr<base::DictionaryValue>(value);
}
} // namespace
TEST(JsonSchemaCompilerCrossrefTest, CrossrefTypePopulate) {
scoped_ptr<CrossrefType> crossref_type(new CrossrefType());
- scoped_ptr<DictionaryValue> value(new DictionaryValue());
+ scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
value->Set("testType", CreateTestTypeDictionary().release());
EXPECT_TRUE(CrossrefType::Populate(*value, crossref_type.get()));
EXPECT_TRUE(crossref_type->test_type.get());
@@ -34,7 +36,7 @@ TEST(JsonSchemaCompilerCrossrefTest, CrossrefTypePopulate) {
}
TEST(JsonSchemaCompilerCrossrefTest, TestTypeOptionalParamCreate) {
- scoped_ptr<ListValue> params_value(new ListValue());
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
params_value->Append(CreateTestTypeDictionary().release());
scoped_ptr<TestTypeOptionalParam::Params> params(
TestTypeOptionalParam::Params::Create(*params_value));
@@ -45,8 +47,9 @@ TEST(JsonSchemaCompilerCrossrefTest, TestTypeOptionalParamCreate) {
}
TEST(JsonSchemaCompilerCrossrefTest, TestTypeOptionalParamFail) {
- scoped_ptr<ListValue> params_value(new ListValue());
- scoped_ptr<DictionaryValue> test_type_value = CreateTestTypeDictionary();
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ scoped_ptr<base::DictionaryValue> test_type_value =
+ CreateTestTypeDictionary();
test_type_value->RemoveWithoutPathExpansion("number", NULL);
params_value->Append(test_type_value.release());
scoped_ptr<TestTypeOptionalParam::Params> params(
@@ -55,24 +58,26 @@ TEST(JsonSchemaCompilerCrossrefTest, TestTypeOptionalParamFail) {
}
TEST(JsonSchemaCompilerCrossrefTest, GetTestType) {
- scoped_ptr<DictionaryValue> value = CreateTestTypeDictionary();
+ scoped_ptr<base::DictionaryValue> value = CreateTestTypeDictionary();
scoped_ptr<test::api::simple_api::TestType> test_type(
new test::api::simple_api::TestType());
EXPECT_TRUE(
test::api::simple_api::TestType::Populate(*value, test_type.get()));
- scoped_ptr<ListValue> results = GetTestType::Results::Create(*test_type);
- DictionaryValue* result_dict = NULL;
+ scoped_ptr<base::ListValue> results =
+ GetTestType::Results::Create(*test_type);
+ base::DictionaryValue* result_dict = NULL;
results->GetDictionary(0, &result_dict);
EXPECT_TRUE(value->Equals(result_dict));
}
TEST(JsonSchemaCompilerCrossrefTest, TestTypeInObjectParamsCreate) {
{
- scoped_ptr<ListValue> params_value(new ListValue());
- scoped_ptr<DictionaryValue> param_object_value(new DictionaryValue());
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ scoped_ptr<base::DictionaryValue> param_object_value(
+ new base::DictionaryValue());
param_object_value->Set("testType", CreateTestTypeDictionary().release());
- param_object_value->Set("boolean", Value::CreateBooleanValue(true));
+ param_object_value->Set("boolean", base::Value::CreateBooleanValue(true));
params_value->Append(param_object_value.release());
scoped_ptr<TestTypeInObject::Params> params(
TestTypeInObject::Params::Create(*params_value));
@@ -83,9 +88,10 @@ TEST(JsonSchemaCompilerCrossrefTest, TestTypeInObjectParamsCreate) {
params->param_object.test_type->ToValue().get()));
}
{
- scoped_ptr<ListValue> params_value(new ListValue());
- scoped_ptr<DictionaryValue> param_object_value(new DictionaryValue());
- param_object_value->Set("boolean", Value::CreateBooleanValue(true));
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ scoped_ptr<base::DictionaryValue> param_object_value(
+ new base::DictionaryValue());
+ param_object_value->Set("boolean", base::Value::CreateBooleanValue(true));
params_value->Append(param_object_value.release());
scoped_ptr<TestTypeInObject::Params> params(
TestTypeInObject::Params::Create(*params_value));
@@ -94,18 +100,21 @@ TEST(JsonSchemaCompilerCrossrefTest, TestTypeInObjectParamsCreate) {
EXPECT_TRUE(params->param_object.boolean);
}
{
- scoped_ptr<ListValue> params_value(new ListValue());
- scoped_ptr<DictionaryValue> param_object_value(new DictionaryValue());
- param_object_value->Set("testType", Value::CreateStringValue("invalid"));
- param_object_value->Set("boolean", Value::CreateBooleanValue(true));
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ scoped_ptr<base::DictionaryValue> param_object_value(
+ new base::DictionaryValue());
+ param_object_value->Set("testType",
+ base::Value::CreateStringValue("invalid"));
+ param_object_value->Set("boolean", base::Value::CreateBooleanValue(true));
params_value->Append(param_object_value.release());
scoped_ptr<TestTypeInObject::Params> params(
TestTypeInObject::Params::Create(*params_value));
EXPECT_FALSE(params.get());
}
{
- scoped_ptr<ListValue> params_value(new ListValue());
- scoped_ptr<DictionaryValue> param_object_value(new DictionaryValue());
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ scoped_ptr<base::DictionaryValue> param_object_value(
+ new base::DictionaryValue());
param_object_value->Set("testType", CreateTestTypeDictionary().release());
params_value->Append(param_object_value.release());
scoped_ptr<TestTypeInObject::Params> params(
diff --git a/tools/json_schema_compiler/test/enums_unittest.cc b/tools/json_schema_compiler/test/enums_unittest.cc
index 144c3cc..be7a381 100644
--- a/tools/json_schema_compiler/test/enums_unittest.cc
+++ b/tools/json_schema_compiler/test/enums_unittest.cc
@@ -13,24 +13,24 @@ using json_schema_compiler::test_util::List;
TEST(JsonSchemaCompilerEnumsTest, EnumTypePopulate) {
{
EnumType enum_type;
- DictionaryValue value;
- value.Set("type", Value::CreateStringValue("one"));
+ base::DictionaryValue value;
+ value.Set("type", base::Value::CreateStringValue("one"));
EXPECT_TRUE(EnumType::Populate(value, &enum_type));
EXPECT_EQ(EnumType::TYPE_ONE, enum_type.type);
EXPECT_TRUE(value.Equals(enum_type.ToValue().get()));
}
{
EnumType enum_type;
- DictionaryValue value;
- value.Set("type", Value::CreateStringValue("invalid"));
+ base::DictionaryValue value;
+ value.Set("type", base::Value::CreateStringValue("invalid"));
EXPECT_FALSE(EnumType::Populate(value, &enum_type));
}
}
TEST(JsonSchemaCompilerEnumsTest, EnumsAsTypes) {
{
- ListValue args;
- args.Append(Value::CreateStringValue("one"));
+ base::ListValue args;
+ args.Append(base::Value::CreateStringValue("one"));
scoped_ptr<TakesEnumAsType::Params> params(
TakesEnumAsType::Params::Create(args));
@@ -42,14 +42,14 @@ TEST(JsonSchemaCompilerEnumsTest, EnumsAsTypes) {
}
{
HasEnumeration enumeration;
- DictionaryValue value;
+ base::DictionaryValue value;
ASSERT_FALSE(HasEnumeration::Populate(value, &enumeration));
- value.Set("enumeration", Value::CreateStringValue("one"));
+ value.Set("enumeration", base::Value::CreateStringValue("one"));
ASSERT_TRUE(HasEnumeration::Populate(value, &enumeration));
EXPECT_TRUE(value.Equals(enumeration.ToValue().get()));
- value.Set("optional_enumeration", Value::CreateStringValue("two"));
+ value.Set("optional_enumeration", base::Value::CreateStringValue("two"));
ASSERT_TRUE(HasEnumeration::Populate(value, &enumeration));
EXPECT_TRUE(value.Equals(enumeration.ToValue().get()));
}
@@ -57,9 +57,9 @@ TEST(JsonSchemaCompilerEnumsTest, EnumsAsTypes) {
TEST(JsonSchemaCompilerEnumsTest, EnumsArrayAsType) {
{
- ListValue params_value;
- params_value.Append(List(Value::CreateStringValue("one"),
- Value::CreateStringValue("two")).release());
+ base::ListValue params_value;
+ params_value.Append(List(base::Value::CreateStringValue("one"),
+ base::Value::CreateStringValue("two")).release());
scoped_ptr<TakesEnumArrayAsType::Params> params(
TakesEnumArrayAsType::Params::Create(params_value));
ASSERT_TRUE(params);
@@ -68,8 +68,9 @@ TEST(JsonSchemaCompilerEnumsTest, EnumsArrayAsType) {
EXPECT_EQ(ENUMERATION_TWO, params->values[1]);
}
{
- ListValue params_value;
- params_value.Append(List(Value::CreateStringValue("invalid")).release());
+ base::ListValue params_value;
+ params_value.Append(
+ List(base::Value::CreateStringValue("invalid")).release());
scoped_ptr<TakesEnumArrayAsType::Params> params(
TakesEnumArrayAsType::Params::Create(params_value));
EXPECT_FALSE(params);
@@ -79,28 +80,28 @@ TEST(JsonSchemaCompilerEnumsTest, EnumsArrayAsType) {
TEST(JsonSchemaCompilerEnumsTest, ReturnsEnumCreate) {
{
ReturnsEnum::Results::State state = ReturnsEnum::Results::STATE_FOO;
- scoped_ptr<Value> result(
+ scoped_ptr<base::Value> result(
new base::StringValue(ReturnsEnum::Results::ToString(state)));
- scoped_ptr<Value> expected(Value::CreateStringValue("foo"));
+ scoped_ptr<base::Value> expected(base::Value::CreateStringValue("foo"));
EXPECT_TRUE(result->Equals(expected.get()));
}
{
ReturnsEnum::Results::State state = ReturnsEnum::Results::STATE_FOO;
- scoped_ptr<ListValue> results = ReturnsEnum::Results::Create(state);
- ListValue expected;
- expected.Append(Value::CreateStringValue("foo"));
+ scoped_ptr<base::ListValue> results = ReturnsEnum::Results::Create(state);
+ base::ListValue expected;
+ expected.Append(base::Value::CreateStringValue("foo"));
EXPECT_TRUE(results->Equals(&expected));
}
}
TEST(JsonSchemaCompilerEnumsTest, ReturnsTwoEnumsCreate) {
{
- scoped_ptr<ListValue> results = ReturnsTwoEnums::Results::Create(
+ scoped_ptr<base::ListValue> results = ReturnsTwoEnums::Results::Create(
ReturnsTwoEnums::Results::FIRST_STATE_FOO,
ReturnsTwoEnums::Results::SECOND_STATE_HAM);
- ListValue expected;
- expected.Append(Value::CreateStringValue("foo"));
- expected.Append(Value::CreateStringValue("ham"));
+ base::ListValue expected;
+ expected.Append(base::Value::CreateStringValue("foo"));
+ expected.Append(base::Value::CreateStringValue("ham"));
EXPECT_TRUE(results->Equals(&expected));
}
}
@@ -108,39 +109,39 @@ TEST(JsonSchemaCompilerEnumsTest, ReturnsTwoEnumsCreate) {
TEST(JsonSchemaCompilerEnumsTest, OptionalEnumTypePopulate) {
{
OptionalEnumType enum_type;
- DictionaryValue value;
- value.Set("type", Value::CreateStringValue("two"));
+ base::DictionaryValue value;
+ value.Set("type", base::Value::CreateStringValue("two"));
EXPECT_TRUE(OptionalEnumType::Populate(value, &enum_type));
EXPECT_EQ(OptionalEnumType::TYPE_TWO, enum_type.type);
EXPECT_TRUE(value.Equals(enum_type.ToValue().get()));
}
{
OptionalEnumType enum_type;
- DictionaryValue value;
+ base::DictionaryValue value;
EXPECT_TRUE(OptionalEnumType::Populate(value, &enum_type));
EXPECT_EQ(OptionalEnumType::TYPE_NONE, enum_type.type);
EXPECT_TRUE(value.Equals(enum_type.ToValue().get()));
}
{
OptionalEnumType enum_type;
- DictionaryValue value;
- value.Set("type", Value::CreateStringValue("invalid"));
+ base::DictionaryValue value;
+ value.Set("type", base::Value::CreateStringValue("invalid"));
EXPECT_FALSE(OptionalEnumType::Populate(value, &enum_type));
}
}
TEST(JsonSchemaCompilerEnumsTest, TakesEnumParamsCreate) {
{
- ListValue params_value;
- params_value.Append(Value::CreateStringValue("baz"));
+ base::ListValue params_value;
+ params_value.Append(base::Value::CreateStringValue("baz"));
scoped_ptr<TakesEnum::Params> params(
TakesEnum::Params::Create(params_value));
EXPECT_TRUE(params.get());
EXPECT_EQ(TakesEnum::Params::STATE_BAZ, params->state);
}
{
- ListValue params_value;
- params_value.Append(Value::CreateStringValue("invalid"));
+ base::ListValue params_value;
+ params_value.Append(base::Value::CreateStringValue("invalid"));
scoped_ptr<TakesEnum::Params> params(
TakesEnum::Params::Create(params_value));
EXPECT_FALSE(params.get());
@@ -149,9 +150,9 @@ TEST(JsonSchemaCompilerEnumsTest, TakesEnumParamsCreate) {
TEST(JsonSchemaCompilerEnumsTest, TakesEnumArrayParamsCreate) {
{
- ListValue params_value;
- params_value.Append(List(Value::CreateStringValue("foo"),
- Value::CreateStringValue("bar")).release());
+ base::ListValue params_value;
+ params_value.Append(List(base::Value::CreateStringValue("foo"),
+ base::Value::CreateStringValue("bar")).release());
scoped_ptr<TakesEnumArray::Params> params(
TakesEnumArray::Params::Create(params_value));
ASSERT_TRUE(params);
@@ -160,8 +161,9 @@ TEST(JsonSchemaCompilerEnumsTest, TakesEnumArrayParamsCreate) {
EXPECT_EQ(TakesEnumArray::Params::VALUES_TYPE_BAR, params->values[1]);
}
{
- ListValue params_value;
- params_value.Append(List(Value::CreateStringValue("invalid")).release());
+ base::ListValue params_value;
+ params_value.Append(
+ List(base::Value::CreateStringValue("invalid")).release());
scoped_ptr<TakesEnumArray::Params> params(
TakesEnumArray::Params::Create(params_value));
EXPECT_FALSE(params);
@@ -170,23 +172,23 @@ TEST(JsonSchemaCompilerEnumsTest, TakesEnumArrayParamsCreate) {
TEST(JsonSchemaCompilerEnumsTest, TakesOptionalEnumParamsCreate) {
{
- ListValue params_value;
- params_value.Append(Value::CreateStringValue("baz"));
+ base::ListValue params_value;
+ params_value.Append(base::Value::CreateStringValue("baz"));
scoped_ptr<TakesOptionalEnum::Params> params(
TakesOptionalEnum::Params::Create(params_value));
EXPECT_TRUE(params.get());
EXPECT_EQ(TakesOptionalEnum::Params::STATE_BAZ, params->state);
}
{
- ListValue params_value;
+ base::ListValue params_value;
scoped_ptr<TakesOptionalEnum::Params> params(
TakesOptionalEnum::Params::Create(params_value));
EXPECT_TRUE(params.get());
EXPECT_EQ(TakesOptionalEnum::Params::STATE_NONE, params->state);
}
{
- ListValue params_value;
- params_value.Append(Value::CreateStringValue("invalid"));
+ base::ListValue params_value;
+ params_value.Append(base::Value::CreateStringValue("invalid"));
scoped_ptr<TakesOptionalEnum::Params> params(
TakesOptionalEnum::Params::Create(params_value));
EXPECT_FALSE(params.get());
@@ -195,9 +197,9 @@ TEST(JsonSchemaCompilerEnumsTest, TakesOptionalEnumParamsCreate) {
TEST(JsonSchemaCompilerEnumsTest, TakesMultipleOptionalEnumsParamsCreate) {
{
- ListValue params_value;
- params_value.Append(Value::CreateStringValue("foo"));
- params_value.Append(Value::CreateStringValue("foo"));
+ base::ListValue params_value;
+ params_value.Append(base::Value::CreateStringValue("foo"));
+ params_value.Append(base::Value::CreateStringValue("foo"));
scoped_ptr<TakesMultipleOptionalEnums::Params> params(
TakesMultipleOptionalEnums::Params::Create(params_value));
EXPECT_TRUE(params.get());
@@ -205,8 +207,8 @@ TEST(JsonSchemaCompilerEnumsTest, TakesMultipleOptionalEnumsParamsCreate) {
EXPECT_EQ(TakesMultipleOptionalEnums::Params::TYPE_FOO, params->type);
}
{
- ListValue params_value;
- params_value.Append(Value::CreateStringValue("foo"));
+ base::ListValue params_value;
+ params_value.Append(base::Value::CreateStringValue("foo"));
scoped_ptr<TakesMultipleOptionalEnums::Params> params(
TakesMultipleOptionalEnums::Params::Create(params_value));
EXPECT_TRUE(params.get());
@@ -214,7 +216,7 @@ TEST(JsonSchemaCompilerEnumsTest, TakesMultipleOptionalEnumsParamsCreate) {
EXPECT_EQ(TakesMultipleOptionalEnums::Params::TYPE_NONE, params->type);
}
{
- ListValue params_value;
+ base::ListValue params_value;
scoped_ptr<TakesMultipleOptionalEnums::Params> params(
TakesMultipleOptionalEnums::Params::Create(params_value));
EXPECT_TRUE(params.get());
@@ -222,9 +224,9 @@ TEST(JsonSchemaCompilerEnumsTest, TakesMultipleOptionalEnumsParamsCreate) {
EXPECT_EQ(TakesMultipleOptionalEnums::Params::TYPE_NONE, params->type);
}
{
- ListValue params_value;
- params_value.Append(Value::CreateStringValue("baz"));
- params_value.Append(Value::CreateStringValue("invalid"));
+ base::ListValue params_value;
+ params_value.Append(base::Value::CreateStringValue("baz"));
+ params_value.Append(base::Value::CreateStringValue("invalid"));
scoped_ptr<TakesMultipleOptionalEnums::Params> params(
TakesMultipleOptionalEnums::Params::Create(params_value));
EXPECT_FALSE(params.get());
@@ -234,28 +236,28 @@ TEST(JsonSchemaCompilerEnumsTest, TakesMultipleOptionalEnumsParamsCreate) {
TEST(JsonSchemaCompilerEnumsTest, OnEnumFiredCreate) {
{
OnEnumFired::SomeEnum some_enum = OnEnumFired::SOME_ENUM_FOO;
- scoped_ptr<Value> result(
+ scoped_ptr<base::Value> result(
new base::StringValue(OnEnumFired::ToString(some_enum)));
- scoped_ptr<Value> expected(Value::CreateStringValue("foo"));
+ scoped_ptr<base::Value> expected(base::Value::CreateStringValue("foo"));
EXPECT_TRUE(result->Equals(expected.get()));
}
{
OnEnumFired::SomeEnum some_enum = OnEnumFired::SOME_ENUM_FOO;
- scoped_ptr<ListValue> results(OnEnumFired::Create(some_enum));
- ListValue expected;
- expected.Append(Value::CreateStringValue("foo"));
+ scoped_ptr<base::ListValue> results(OnEnumFired::Create(some_enum));
+ base::ListValue expected;
+ expected.Append(base::Value::CreateStringValue("foo"));
EXPECT_TRUE(results->Equals(&expected));
}
}
TEST(JsonSchemaCompilerEnumsTest, OnTwoEnumsFiredCreate) {
{
- scoped_ptr<Value> results(OnTwoEnumsFired::Create(
+ scoped_ptr<base::Value> results(OnTwoEnumsFired::Create(
OnTwoEnumsFired::FIRST_ENUM_FOO,
OnTwoEnumsFired::SECOND_ENUM_HAM));
- ListValue expected;
- expected.Append(Value::CreateStringValue("foo"));
- expected.Append(Value::CreateStringValue("ham"));
+ base::ListValue expected;
+ expected.Append(base::Value::CreateStringValue("foo"));
+ expected.Append(base::Value::CreateStringValue("ham"));
EXPECT_TRUE(results->Equals(&expected));
}
}
diff --git a/tools/json_schema_compiler/test/error_generation_unittest.cc b/tools/json_schema_compiler/test/error_generation_unittest.cc
index baf7b51..f5a24fa 100644
--- a/tools/json_schema_compiler/test/error_generation_unittest.cc
+++ b/tools/json_schema_compiler/test/error_generation_unittest.cc
@@ -33,8 +33,8 @@ testing::AssertionResult EqualsUtf16(const std::string& expected,
TEST(JsonSchemaCompilerErrorTest, RequiredPropertyPopulate) {
{
- scoped_ptr<DictionaryValue> value = Dictionary(
- "string", new StringValue("bling"));
+ scoped_ptr<base::DictionaryValue> value = Dictionary(
+ "string", new base::StringValue("bling"));
EXPECT_TRUE(EqualsUtf16("", GetPopulateError<TestType>(*value)));
}
{
@@ -61,7 +61,7 @@ TEST(JsonSchemaCompilerErrorTest, UnexpectedTypePopulation) {
TEST(JsonSchemaCompilerErrorTest, TypeIsRequired) {
{
- scoped_ptr<DictionaryValue> value = Dictionary(
+ scoped_ptr<base::DictionaryValue> value = Dictionary(
"integers", new FundamentalValue(5));
EXPECT_TRUE(EqualsUtf16("", GetPopulateError<ChoiceType>(*value)));
}
@@ -100,7 +100,7 @@ TEST(JsonSchemaCompilerErrorTest, ParamIsRequired) {
}
{
scoped_ptr<base::ListValue> params_value = List(
- Value::CreateNullValue());
+ base::Value::CreateNullValue());
base::string16 error;
EXPECT_FALSE(TestFunction::Params::Create(*params_value, &error));
EXPECT_TRUE(EqualsUtf16("'num' is required", error));
@@ -111,12 +111,12 @@ TEST(JsonSchemaCompilerErrorTest, ParamIsRequired) {
TEST(JsonSchemaCompilerErrorTest, WrongPropertyValueType) {
{
- scoped_ptr<DictionaryValue> value = Dictionary(
- "string", new StringValue("yes"));
+ scoped_ptr<base::DictionaryValue> value = Dictionary(
+ "string", new base::StringValue("yes"));
EXPECT_TRUE(EqualsUtf16("", GetPopulateError<TestType>(*value)));
}
{
- scoped_ptr<DictionaryValue> value = Dictionary(
+ scoped_ptr<base::DictionaryValue> value = Dictionary(
"string", new FundamentalValue(1.1));
EXPECT_TRUE(EqualsUtf16("'string': expected string, got number",
GetPopulateError<TestType>(*value)));
@@ -126,7 +126,7 @@ TEST(JsonSchemaCompilerErrorTest, WrongPropertyValueType) {
TEST(JsonSchemaCompilerErrorTest, WrongParameterCreationType) {
{
scoped_ptr<base::ListValue> params_value = List(
- new StringValue("Yeah!"));
+ new base::StringValue("Yeah!"));
EXPECT_TRUE(TestString::Params::Create(*params_value));
}
{
@@ -145,7 +145,7 @@ TEST(JsonSchemaCompilerErrorTest, WrongTypeValueType) {
EXPECT_TRUE(EqualsUtf16("", GetPopulateError<ObjectType>(*value)));
}
{
- scoped_ptr<DictionaryValue> value = Dictionary(
+ scoped_ptr<base::DictionaryValue> value = Dictionary(
"otherType", new FundamentalValue(1.1));
EXPECT_TRUE(EqualsUtf16("'otherType': expected dictionary, got number",
GetPopulateError<ObjectType>(*value)));
@@ -170,12 +170,12 @@ TEST(JsonSchemaCompilerErrorTest, UnableToPopulateArray) {
TEST(JsonSchemaCompilerErrorTest, BinaryTypeExpected) {
{
- scoped_ptr<DictionaryValue> value = Dictionary(
+ scoped_ptr<base::DictionaryValue> value = Dictionary(
"data", new base::BinaryValue());
EXPECT_TRUE(EqualsUtf16("", GetPopulateError<BinaryData>(*value)));
}
{
- scoped_ptr<DictionaryValue> value = Dictionary(
+ scoped_ptr<base::DictionaryValue> value = Dictionary(
"data", new FundamentalValue(1.1));
EXPECT_TRUE(EqualsUtf16("'data': expected binary, got number",
GetPopulateError<BinaryData>(*value)));
@@ -184,12 +184,12 @@ TEST(JsonSchemaCompilerErrorTest, BinaryTypeExpected) {
TEST(JsonSchemaCompilerErrorTest, ListExpected) {
{
- scoped_ptr<DictionaryValue> value = Dictionary(
+ scoped_ptr<base::DictionaryValue> value = Dictionary(
"TheArray", new base::ListValue());
EXPECT_TRUE(EqualsUtf16("", GetPopulateError<ArrayObject>(*value)));
}
{
- scoped_ptr<DictionaryValue> value = Dictionary(
+ scoped_ptr<base::DictionaryValue> value = Dictionary(
"TheArray", new FundamentalValue(5));
EXPECT_TRUE(EqualsUtf16("'TheArray': expected list, got integer",
GetPopulateError<ArrayObject>(*value)));
@@ -200,13 +200,13 @@ TEST(JsonSchemaCompilerErrorTest, ListExpected) {
TEST(JsonSchemaCompilerErrorTest, BadEnumValue) {
{
- scoped_ptr<DictionaryValue> value = Dictionary(
- "enumeration", new StringValue("one"));
+ scoped_ptr<base::DictionaryValue> value = Dictionary(
+ "enumeration", new base::StringValue("one"));
EXPECT_TRUE(EqualsUtf16("", GetPopulateError<HasEnumeration>(*value)));
}
{
- scoped_ptr<DictionaryValue> value = Dictionary(
- "enumeration", new StringValue("bad sauce"));
+ scoped_ptr<base::DictionaryValue> value = Dictionary(
+ "enumeration", new base::StringValue("bad sauce"));
EXPECT_TRUE(EqualsUtf16("'enumeration': expected \"one\" or \"two\" "
"or \"three\", got \"bad sauce\"",
GetPopulateError<HasEnumeration>(*value)));
diff --git a/tools/json_schema_compiler/test/functions_as_parameters_unittest.cc b/tools/json_schema_compiler/test/functions_as_parameters_unittest.cc
index f53e434..ce7a2f9 100644
--- a/tools/json_schema_compiler/test/functions_as_parameters_unittest.cc
+++ b/tools/json_schema_compiler/test/functions_as_parameters_unittest.cc
@@ -12,13 +12,13 @@ TEST(JsonSchemaCompilerFunctionsAsParametersTest, PopulateRequiredFunction) {
// The expectation is that if any value is set for the function, then
// the function is "present".
{
- DictionaryValue empty_value;
+ base::DictionaryValue empty_value;
FunctionType out;
EXPECT_FALSE(FunctionType::Populate(empty_value, &out));
}
{
- DictionaryValue value;
- DictionaryValue function_dict;
+ base::DictionaryValue value;
+ base::DictionaryValue function_dict;
value.Set("event_callback", function_dict.DeepCopy());
FunctionType out;
ASSERT_TRUE(FunctionType::Populate(value, &out));
@@ -28,8 +28,8 @@ TEST(JsonSchemaCompilerFunctionsAsParametersTest, PopulateRequiredFunction) {
TEST(JsonSchemaCompilerFunctionsAsParametersTest, RequiredFunctionToValue) {
{
- DictionaryValue value;
- DictionaryValue function_dict;
+ base::DictionaryValue value;
+ base::DictionaryValue function_dict;
value.Set("event_callback", function_dict.DeepCopy());
FunctionType out;
@@ -37,9 +37,9 @@ TEST(JsonSchemaCompilerFunctionsAsParametersTest, RequiredFunctionToValue) {
EXPECT_TRUE(value.Equals(out.ToValue().get()));
}
{
- DictionaryValue value;
- DictionaryValue expected_value;
- DictionaryValue function_dict;
+ base::DictionaryValue value;
+ base::DictionaryValue expected_value;
+ base::DictionaryValue function_dict;
value.Set("event_callback", function_dict.DeepCopy());
expected_value.Set("event_callback", function_dict.DeepCopy());
@@ -51,22 +51,22 @@ TEST(JsonSchemaCompilerFunctionsAsParametersTest, RequiredFunctionToValue) {
TEST(JsonSchemaCompilerFunctionsAsParametersTest, PopulateOptionalFunction) {
{
- DictionaryValue empty_value;
+ base::DictionaryValue empty_value;
OptionalFunctionType out;
ASSERT_TRUE(OptionalFunctionType::Populate(empty_value, &out));
EXPECT_FALSE(out.event_callback.get());
}
{
- DictionaryValue value;
- DictionaryValue function_value;
+ base::DictionaryValue value;
+ base::DictionaryValue function_value;
value.Set("event_callback", function_value.DeepCopy());
OptionalFunctionType out;
ASSERT_TRUE(OptionalFunctionType::Populate(value, &out));
EXPECT_TRUE(out.event_callback.get());
}
{
- DictionaryValue value;
- DictionaryValue function_value;
+ base::DictionaryValue value;
+ base::DictionaryValue function_value;
value.Set("event_callback", function_value.DeepCopy());
OptionalFunctionType out;
ASSERT_TRUE(OptionalFunctionType::Populate(value, &out));
@@ -76,15 +76,15 @@ TEST(JsonSchemaCompilerFunctionsAsParametersTest, PopulateOptionalFunction) {
TEST(JsonSchemaCompilerFunctionsAsParametersTest, OptionalFunctionToValue) {
{
- DictionaryValue empty_value;
+ base::DictionaryValue empty_value;
OptionalFunctionType out;
ASSERT_TRUE(OptionalFunctionType::Populate(empty_value, &out));
// event_callback should not be set in the return from ToValue.
EXPECT_TRUE(empty_value.Equals(out.ToValue().get()));
}
{
- DictionaryValue value;
- DictionaryValue function_value;
+ base::DictionaryValue value;
+ base::DictionaryValue function_value;
value.Set("event_callback", function_value.DeepCopy());
OptionalFunctionType out;
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 6fe4526..f96a5f7 100644
--- a/tools/json_schema_compiler/test/functions_on_types_unittest.cc
+++ b/tools/json_schema_compiler/test/functions_on_types_unittest.cc
@@ -10,22 +10,22 @@ using namespace test::api::functions_on_types;
TEST(JsonSchemaCompilerFunctionsOnTypesTest, StorageAreaGetParamsCreate) {
{
- scoped_ptr<ListValue> params_value(new ListValue());
+ 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<ListValue> params_value(new ListValue());
- params_value->Append(Value::CreateIntegerValue(9));
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ params_value->Append(base::Value::CreateIntegerValue(9));
scoped_ptr<StorageArea::Get::Params> params(
StorageArea::Get::Params::Create(*params_value));
EXPECT_FALSE(params);
}
{
- scoped_ptr<ListValue> params_value(new ListValue());
- params_value->Append(Value::CreateStringValue("test"));
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ params_value->Append(base::Value::CreateStringValue("test"));
scoped_ptr<StorageArea::Get::Params> params(
StorageArea::Get::Params::Create(*params_value));
ASSERT_TRUE(params);
@@ -33,10 +33,11 @@ TEST(JsonSchemaCompilerFunctionsOnTypesTest, StorageAreaGetParamsCreate) {
EXPECT_EQ("test", *params->keys->as_string);
}
{
- scoped_ptr<DictionaryValue> keys_object_value(new DictionaryValue());
+ scoped_ptr<base::DictionaryValue> keys_object_value(
+ new base::DictionaryValue());
keys_object_value->SetInteger("integer", 5);
keys_object_value->SetString("string", "string");
- scoped_ptr<ListValue> params_value(new ListValue());
+ 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));
@@ -51,16 +52,17 @@ TEST(JsonSchemaCompilerFunctionsOnTypesTest, StorageAreaGetResultCreate) {
StorageArea::Get::Results::Items items;
items.additional_properties.SetDouble("asdf", 0.1);
items.additional_properties.SetString("sdfg", "zxcv");
- scoped_ptr<ListValue> results = StorageArea::Get::Results::Create(items);
- DictionaryValue* item_result = NULL;
+ 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<DictionaryValue> details_value(new DictionaryValue());
+ scoped_ptr<base::DictionaryValue> details_value(new base::DictionaryValue());
details_value->SetBoolean("incognito", true);
- scoped_ptr<ListValue> params_value(new ListValue());
+ 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));
diff --git a/tools/json_schema_compiler/test/idl_schemas_unittest.cc b/tools/json_schema_compiler/test/idl_schemas_unittest.cc
index 233c8d2..59e0d8b 100644
--- a/tools/json_schema_compiler/test/idl_schemas_unittest.cc
+++ b/tools/json_schema_compiler/test/idl_schemas_unittest.cc
@@ -29,21 +29,21 @@ TEST(IdlCompiler, Basics) {
MyType1 a;
a.x = 5;
a.y = std::string("foo");
- scoped_ptr<DictionaryValue> serialized = a.ToValue();
+ scoped_ptr<base::DictionaryValue> serialized = a.ToValue();
MyType1 b;
EXPECT_TRUE(MyType1::Populate(*serialized.get(), &b));
EXPECT_EQ(a.x, b.x);
EXPECT_EQ(a.y, b.y);
// Test Function2, which takes an integer parameter.
- ListValue list;
- list.Append(Value::CreateIntegerValue(5));
+ base::ListValue list;
+ list.Append(base::Value::CreateIntegerValue(5));
scoped_ptr<Function2::Params> f2_params = Function2::Params::Create(list);
EXPECT_EQ(5, f2_params->x);
// Test Function3, which takes a MyType1 parameter.
list.Clear();
- DictionaryValue* tmp = new DictionaryValue();
+ base::DictionaryValue* tmp = new base::DictionaryValue();
tmp->SetInteger("x", 17);
tmp->SetString("y", "hello");
tmp->SetString("z", "zstring");
@@ -57,17 +57,17 @@ TEST(IdlCompiler, Basics) {
// Test functions that take a callback function as a parameter, with varying
// callback signatures.
- scoped_ptr<ListValue> f4_results = Function4::Results::Create();
- ListValue expected;
+ scoped_ptr<base::ListValue> f4_results = Function4::Results::Create();
+ base::ListValue expected;
EXPECT_TRUE(f4_results->Equals(&expected));
- scoped_ptr<ListValue> f5_results(Function5::Results::Create(13));
- Value* f5_result_int = NULL;
+ scoped_ptr<base::ListValue> f5_results(Function5::Results::Create(13));
+ base::Value* f5_result_int = NULL;
ASSERT_TRUE(f5_results->Get(0, &f5_result_int));
- EXPECT_TRUE(f5_result_int->IsType(Value::TYPE_INTEGER));
+ EXPECT_TRUE(f5_result_int->IsType(base::Value::TYPE_INTEGER));
- scoped_ptr<ListValue> f6_results(Function6::Results::Create(a));
- Value* f6_result_dict = NULL;
+ scoped_ptr<base::ListValue> f6_results(Function6::Results::Create(a));
+ base::Value* f6_result_dict = NULL;
ASSERT_TRUE(f6_results->Get(0, &f6_result_dict));
MyType1 c;
EXPECT_TRUE(MyType1::Populate(*f6_result_dict, &c));
@@ -78,21 +78,21 @@ TEST(IdlCompiler, Basics) {
TEST(IdlCompiler, OptionalArguments) {
// Test a function that takes one optional argument, both without and with
// that argument.
- ListValue list;
+ base::ListValue list;
scoped_ptr<Function7::Params> f7_params = Function7::Params::Create(list);
EXPECT_EQ(NULL, f7_params->arg.get());
- list.Append(Value::CreateIntegerValue(7));
+ list.Append(base::Value::CreateIntegerValue(7));
f7_params = Function7::Params::Create(list);
EXPECT_EQ(7, *(f7_params->arg));
// Similar to above, but a function with one required and one optional
// argument.
list.Clear();
- list.Append(Value::CreateIntegerValue(8));
+ list.Append(base::Value::CreateIntegerValue(8));
scoped_ptr<Function8::Params> f8_params = Function8::Params::Create(list);
EXPECT_EQ(8, f8_params->arg1);
EXPECT_EQ(NULL, f8_params->arg2.get());
- list.Append(Value::CreateStringValue("foo"));
+ list.Append(base::Value::CreateStringValue("foo"));
f8_params = Function8::Params::Create(list);
EXPECT_EQ(8, f8_params->arg1);
EXPECT_EQ("foo", *(f8_params->arg2));
@@ -102,7 +102,7 @@ TEST(IdlCompiler, OptionalArguments) {
scoped_ptr<Function9::Params> f9_params = Function9::Params::Create(list);
EXPECT_EQ(NULL, f9_params->arg.get());
list.Clear();
- DictionaryValue* tmp = new DictionaryValue();
+ base::DictionaryValue* tmp = new base::DictionaryValue();
tmp->SetInteger("x", 17);
tmp->SetString("y", "hello");
tmp->SetString("z", "zstring");
@@ -120,9 +120,9 @@ TEST(IdlCompiler, OptionalArguments) {
TEST(IdlCompiler, ArrayTypes) {
// Tests of a function that takes an integer and an array of integers. First
// use an empty array.
- ListValue list;
- list.Append(Value::CreateIntegerValue(33));
- list.Append(new ListValue);
+ base::ListValue list;
+ list.Append(base::Value::CreateIntegerValue(33));
+ list.Append(new base::ListValue);
scoped_ptr<Function10::Params> f10_params = Function10::Params::Create(list);
ASSERT_TRUE(f10_params != NULL);
EXPECT_EQ(33, f10_params->x);
@@ -130,10 +130,10 @@ TEST(IdlCompiler, ArrayTypes) {
// Same function, but this time with 2 values in the array.
list.Clear();
- list.Append(Value::CreateIntegerValue(33));
- ListValue* sublist = new ListValue;
- sublist->Append(Value::CreateIntegerValue(34));
- sublist->Append(Value::CreateIntegerValue(35));
+ list.Append(base::Value::CreateIntegerValue(33));
+ base::ListValue* sublist = new base::ListValue;
+ sublist->Append(base::Value::CreateIntegerValue(34));
+ sublist->Append(base::Value::CreateIntegerValue(35));
list.Append(sublist);
f10_params = Function10::Params::Create(list);
ASSERT_TRUE(f10_params != NULL);
@@ -150,7 +150,7 @@ TEST(IdlCompiler, ArrayTypes) {
b.x = 6;
a.y = std::string("foo");
b.y = std::string("bar");
- ListValue* sublist2 = new ListValue;
+ base::ListValue* sublist2 = new base::ListValue;
sublist2->Append(a.ToValue().release());
sublist2->Append(b.ToValue().release());
list.Append(sublist2);
@@ -167,7 +167,7 @@ TEST(IdlCompiler, ObjectTypes) {
// Test the FooType type.
FooType f1;
f1.x = 3;
- scoped_ptr<DictionaryValue> serialized_foo = f1.ToValue();
+ scoped_ptr<base::DictionaryValue> serialized_foo = f1.ToValue();
FooType f2;
EXPECT_TRUE(FooType::Populate(*serialized_foo.get(), &f2));
EXPECT_EQ(f1.x, f2.x);
@@ -175,7 +175,7 @@ TEST(IdlCompiler, ObjectTypes) {
// Test the BarType type.
BarType b1;
b1.x.reset(new base::FundamentalValue(7));
- scoped_ptr<DictionaryValue> serialized_bar = b1.ToValue();
+ scoped_ptr<base::DictionaryValue> serialized_bar = b1.ToValue();
BarType b2;
EXPECT_TRUE(BarType::Populate(*serialized_bar.get(), &b2));
int tmp_int = 0;
@@ -183,12 +183,12 @@ TEST(IdlCompiler, ObjectTypes) {
EXPECT_EQ(7, tmp_int);
// Test the params to the ObjectFunction1 function.
- scoped_ptr<DictionaryValue> icon_props(new DictionaryValue());
+ scoped_ptr<base::DictionaryValue> icon_props(new base::DictionaryValue());
icon_props->SetString("hello", "world");
ObjectFunction1::Params::Icon icon;
EXPECT_TRUE(ObjectFunction1::Params::Icon::Populate(*(icon_props.get()),
&icon));
- ListValue list;
+ base::ListValue list;
list.Append(icon_props.release());
scoped_ptr<ObjectFunction1::Params> params =
ObjectFunction1::Params::Create(list);
diff --git a/tools/json_schema_compiler/test/objects_unittest.cc b/tools/json_schema_compiler/test/objects_unittest.cc
index 5a4248d..c0af2e1 100644
--- a/tools/json_schema_compiler/test/objects_unittest.cc
+++ b/tools/json_schema_compiler/test/objects_unittest.cc
@@ -11,15 +11,15 @@ using namespace test::api::objects;
TEST(JsonSchemaCompilerObjectsTest, ObjectParamParamsCreate) {
{
- scoped_ptr<ListValue> strings(new ListValue());
- strings->Append(Value::CreateStringValue("one"));
- strings->Append(Value::CreateStringValue("two"));
- scoped_ptr<DictionaryValue> info_value(new DictionaryValue());
+ scoped_ptr<base::ListValue> strings(new base::ListValue());
+ strings->Append(base::Value::CreateStringValue("one"));
+ strings->Append(base::Value::CreateStringValue("two"));
+ scoped_ptr<base::DictionaryValue> info_value(new base::DictionaryValue());
info_value->Set("strings", strings.release());
- info_value->Set("integer", Value::CreateIntegerValue(5));
- info_value->Set("boolean", Value::CreateBooleanValue(true));
+ info_value->Set("integer", base::Value::CreateIntegerValue(5));
+ info_value->Set("boolean", base::Value::CreateBooleanValue(true));
- scoped_ptr<ListValue> params_value(new ListValue());
+ 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));
@@ -31,14 +31,14 @@ TEST(JsonSchemaCompilerObjectsTest, ObjectParamParamsCreate) {
EXPECT_TRUE(params->info.boolean);
}
{
- scoped_ptr<ListValue> strings(new ListValue());
- strings->Append(Value::CreateStringValue("one"));
- strings->Append(Value::CreateStringValue("two"));
- scoped_ptr<DictionaryValue> info_value(new DictionaryValue());
+ scoped_ptr<base::ListValue> strings(new base::ListValue());
+ strings->Append(base::Value::CreateStringValue("one"));
+ strings->Append(base::Value::CreateStringValue("two"));
+ scoped_ptr<base::DictionaryValue> info_value(new base::DictionaryValue());
info_value->Set("strings", strings.release());
- info_value->Set("integer", Value::CreateIntegerValue(5));
+ info_value->Set("integer", base::Value::CreateIntegerValue(5));
- scoped_ptr<ListValue> params_value(new ListValue());
+ 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));
@@ -49,11 +49,11 @@ TEST(JsonSchemaCompilerObjectsTest, ObjectParamParamsCreate) {
TEST(JsonSchemaCompilerObjectsTest, ReturnsObjectResultCreate) {
ReturnsObject::Results::Info info;
info.state = ReturnsObject::Results::Info::STATE_FOO;
- scoped_ptr<ListValue> results = ReturnsObject::Results::Create(info);
+ scoped_ptr<base::ListValue> results = ReturnsObject::Results::Create(info);
- DictionaryValue expected;
+ base::DictionaryValue expected;
expected.SetString("state", "foo");
- DictionaryValue* result = NULL;
+ base::DictionaryValue* result = NULL;
ASSERT_TRUE(results->GetDictionary(0, &result));
ASSERT_TRUE(result->Equals(&expected));
}
@@ -61,11 +61,11 @@ TEST(JsonSchemaCompilerObjectsTest, ReturnsObjectResultCreate) {
TEST(JsonSchemaCompilerObjectsTest, OnObjectFiredCreate) {
OnObjectFired::SomeObject object;
object.state = OnObjectFired::SomeObject::STATE_BAR;
- scoped_ptr<ListValue> results(OnObjectFired::Create(object));
+ scoped_ptr<base::ListValue> results(OnObjectFired::Create(object));
- DictionaryValue expected;
+ base::DictionaryValue expected;
expected.SetString("state", "bar");
- DictionaryValue* result = NULL;
+ base::DictionaryValue* result = NULL;
ASSERT_TRUE(results->GetDictionary(0, &result));
ASSERT_TRUE(result->Equals(&expected));
}
diff --git a/tools/json_schema_compiler/test/simple_api_unittest.cc b/tools/json_schema_compiler/test/simple_api_unittest.cc
index bce1838..f34b9fc 100644
--- a/tools/json_schema_compiler/test/simple_api_unittest.cc
+++ b/tools/json_schema_compiler/test/simple_api_unittest.cc
@@ -10,27 +10,31 @@ using namespace test::api::simple_api;
namespace {
-static scoped_ptr<DictionaryValue> CreateTestTypeDictionary() {
- scoped_ptr<DictionaryValue> value(new DictionaryValue());
- value->SetWithoutPathExpansion("number", Value::CreateDoubleValue(1.1));
- value->SetWithoutPathExpansion("integer", Value::CreateIntegerValue(4));
- value->SetWithoutPathExpansion("string", Value::CreateStringValue("bling"));
- value->SetWithoutPathExpansion("boolean", Value::CreateBooleanValue(true));
+static scoped_ptr<base::DictionaryValue> CreateTestTypeDictionary() {
+ scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ value->SetWithoutPathExpansion("number",
+ base::Value::CreateDoubleValue(1.1));
+ value->SetWithoutPathExpansion("integer",
+ base::Value::CreateIntegerValue(4));
+ value->SetWithoutPathExpansion("string",
+ base::Value::CreateStringValue("bling"));
+ value->SetWithoutPathExpansion("boolean",
+ base::Value::CreateBooleanValue(true));
return value.Pass();
}
} // namespace
TEST(JsonSchemaCompilerSimpleTest, IncrementIntegerResultCreate) {
- scoped_ptr<ListValue> results = IncrementInteger::Results::Create(5);
- ListValue expected;
- expected.Append(Value::CreateIntegerValue(5));
+ scoped_ptr<base::ListValue> results = IncrementInteger::Results::Create(5);
+ base::ListValue expected;
+ expected.Append(base::Value::CreateIntegerValue(5));
EXPECT_TRUE(results->Equals(&expected));
}
TEST(JsonSchemaCompilerSimpleTest, IncrementIntegerParamsCreate) {
- scoped_ptr<ListValue> params_value(new ListValue());
- params_value->Append(Value::CreateIntegerValue(6));
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ params_value->Append(base::Value::CreateIntegerValue(6));
scoped_ptr<IncrementInteger::Params> params(
IncrementInteger::Params::Create(*params_value));
EXPECT_TRUE(params.get());
@@ -39,15 +43,15 @@ TEST(JsonSchemaCompilerSimpleTest, IncrementIntegerParamsCreate) {
TEST(JsonSchemaCompilerSimpleTest, NumberOfParams) {
{
- scoped_ptr<ListValue> params_value(new ListValue());
- params_value->Append(Value::CreateStringValue("text"));
- params_value->Append(Value::CreateStringValue("text"));
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ params_value->Append(base::Value::CreateStringValue("text"));
+ params_value->Append(base::Value::CreateStringValue("text"));
scoped_ptr<OptionalString::Params> params(
OptionalString::Params::Create(*params_value));
EXPECT_FALSE(params.get());
}
{
- scoped_ptr<ListValue> params_value(new ListValue());
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
scoped_ptr<IncrementInteger::Params> params(
IncrementInteger::Params::Create(*params_value));
EXPECT_FALSE(params.get());
@@ -56,15 +60,15 @@ TEST(JsonSchemaCompilerSimpleTest, NumberOfParams) {
TEST(JsonSchemaCompilerSimpleTest, OptionalStringParamsCreate) {
{
- scoped_ptr<ListValue> params_value(new ListValue());
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
scoped_ptr<OptionalString::Params> params(
OptionalString::Params::Create(*params_value));
EXPECT_TRUE(params.get());
EXPECT_FALSE(params->str.get());
}
{
- scoped_ptr<ListValue> params_value(new ListValue());
- params_value->Append(Value::CreateStringValue("asdf"));
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ params_value->Append(base::Value::CreateStringValue("asdf"));
scoped_ptr<OptionalString::Params> params(
OptionalString::Params::Create(*params_value));
EXPECT_TRUE(params.get());
@@ -75,8 +79,8 @@ TEST(JsonSchemaCompilerSimpleTest, OptionalStringParamsCreate) {
TEST(JsonSchemaCompilerSimpleTest, OptionalParamsTakingNull) {
{
- scoped_ptr<ListValue> params_value(new ListValue());
- params_value->Append(Value::CreateNullValue());
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ params_value->Append(base::Value::CreateNullValue());
scoped_ptr<OptionalString::Params> params(
OptionalString::Params::Create(*params_value));
EXPECT_TRUE(params.get());
@@ -86,8 +90,8 @@ TEST(JsonSchemaCompilerSimpleTest, OptionalParamsTakingNull) {
TEST(JsonSchemaCompilerSimpleTest, OptionalStringParamsWrongType) {
{
- scoped_ptr<ListValue> params_value(new ListValue());
- params_value->Append(Value::CreateIntegerValue(5));
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ params_value->Append(base::Value::CreateIntegerValue(5));
scoped_ptr<OptionalString::Params> params(
OptionalString::Params::Create(*params_value));
EXPECT_FALSE(params.get());
@@ -96,9 +100,9 @@ TEST(JsonSchemaCompilerSimpleTest, OptionalStringParamsWrongType) {
TEST(JsonSchemaCompilerSimpleTest, OptionalBeforeRequired) {
{
- scoped_ptr<ListValue> params_value(new ListValue());
- params_value->Append(Value::CreateNullValue());
- params_value->Append(Value::CreateStringValue("asdf"));
+ scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ params_value->Append(base::Value::CreateNullValue());
+ params_value->Append(base::Value::CreateStringValue("asdf"));
scoped_ptr<OptionalBeforeRequired::Params> params(
OptionalBeforeRequired::Params::Create(*params_value));
EXPECT_TRUE(params.get());
@@ -108,15 +112,15 @@ TEST(JsonSchemaCompilerSimpleTest, OptionalBeforeRequired) {
}
TEST(JsonSchemaCompilerSimpleTest, NoParamsResultCreate) {
- scoped_ptr<ListValue> results = OptionalString::Results::Create();
- ListValue expected;
+ scoped_ptr<base::ListValue> results = OptionalString::Results::Create();
+ base::ListValue expected;
EXPECT_TRUE(results->Equals(&expected));
}
TEST(JsonSchemaCompilerSimpleTest, TestTypePopulate) {
{
scoped_ptr<TestType> test_type(new TestType());
- scoped_ptr<DictionaryValue> value = CreateTestTypeDictionary();
+ scoped_ptr<base::DictionaryValue> value = CreateTestTypeDictionary();
EXPECT_TRUE(TestType::Populate(*value, test_type.get()));
EXPECT_EQ("bling", test_type->string);
EXPECT_EQ(1.1, test_type->number);
@@ -126,7 +130,7 @@ TEST(JsonSchemaCompilerSimpleTest, TestTypePopulate) {
}
{
scoped_ptr<TestType> test_type(new TestType());
- scoped_ptr<DictionaryValue> value = CreateTestTypeDictionary();
+ scoped_ptr<base::DictionaryValue> value = CreateTestTypeDictionary();
value->Remove("number", NULL);
EXPECT_FALSE(TestType::Populate(*value, test_type.get()));
}
@@ -134,12 +138,13 @@ TEST(JsonSchemaCompilerSimpleTest, TestTypePopulate) {
TEST(JsonSchemaCompilerSimpleTest, GetTestType) {
{
- scoped_ptr<DictionaryValue> value = CreateTestTypeDictionary();
+ scoped_ptr<base::DictionaryValue> value = CreateTestTypeDictionary();
scoped_ptr<TestType> test_type(new TestType());
EXPECT_TRUE(TestType::Populate(*value, test_type.get()));
- scoped_ptr<ListValue> results = GetTestType::Results::Create(*test_type);
+ scoped_ptr<base::ListValue> results =
+ GetTestType::Results::Create(*test_type);
- DictionaryValue* result = NULL;
+ base::DictionaryValue* result = NULL;
results->GetDictionary(0, &result);
EXPECT_TRUE(result->Equals(value.get()));
}
@@ -147,18 +152,18 @@ TEST(JsonSchemaCompilerSimpleTest, GetTestType) {
TEST(JsonSchemaCompilerSimpleTest, OnIntegerFiredCreate) {
{
- scoped_ptr<ListValue> results(OnIntegerFired::Create(5));
- ListValue expected;
- expected.Append(Value::CreateIntegerValue(5));
+ scoped_ptr<base::ListValue> results(OnIntegerFired::Create(5));
+ base::ListValue expected;
+ expected.Append(base::Value::CreateIntegerValue(5));
EXPECT_TRUE(results->Equals(&expected));
}
}
TEST(JsonSchemaCompilerSimpleTest, OnStringFiredCreate) {
{
- scoped_ptr<ListValue> results(OnStringFired::Create("yo dawg"));
- ListValue expected;
- expected.Append(Value::CreateStringValue("yo dawg"));
+ scoped_ptr<base::ListValue> results(OnStringFired::Create("yo dawg"));
+ base::ListValue expected;
+ expected.Append(base::Value::CreateStringValue("yo dawg"));
EXPECT_TRUE(results->Equals(&expected));
}
}
@@ -166,14 +171,15 @@ TEST(JsonSchemaCompilerSimpleTest, OnStringFiredCreate) {
TEST(JsonSchemaCompilerSimpleTest, OnTestTypeFiredCreate) {
{
TestType some_test_type;
- scoped_ptr<DictionaryValue> expected = CreateTestTypeDictionary();
+ scoped_ptr<base::DictionaryValue> expected = CreateTestTypeDictionary();
ASSERT_TRUE(expected->GetDouble("number", &some_test_type.number));
ASSERT_TRUE(expected->GetString("string", &some_test_type.string));
ASSERT_TRUE(expected->GetInteger("integer", &some_test_type.integer));
ASSERT_TRUE(expected->GetBoolean("boolean", &some_test_type.boolean));
- scoped_ptr<ListValue> results(OnTestTypeFired::Create(some_test_type));
- DictionaryValue* result = NULL;
+ scoped_ptr<base::ListValue> results(
+ OnTestTypeFired::Create(some_test_type));
+ base::DictionaryValue* result = NULL;
results->GetDictionary(0, &result);
EXPECT_TRUE(result->Equals(expected.get()));
}
diff --git a/tools/json_schema_compiler/util.cc b/tools/json_schema_compiler/util.cc
index d0e7765..2806cfc 100644
--- a/tools/json_schema_compiler/util.cc
+++ b/tools/json_schema_compiler/util.cc
@@ -70,23 +70,23 @@ void AddItemToList(const linked_ptr<base::DictionaryValue>& from,
out->Append(static_cast<base::Value*>(from->DeepCopy()));
}
-std::string ValueTypeToString(Value::Type type) {
+std::string ValueTypeToString(base::Value::Type type) {
switch(type) {
- case Value::TYPE_NULL:
+ case base::Value::TYPE_NULL:
return "null";
- case Value::TYPE_BOOLEAN:
+ case base::Value::TYPE_BOOLEAN:
return "boolean";
- case Value::TYPE_INTEGER:
+ case base::Value::TYPE_INTEGER:
return "integer";
- case Value::TYPE_DOUBLE:
+ case base::Value::TYPE_DOUBLE:
return "number";
- case Value::TYPE_STRING:
+ case base::Value::TYPE_STRING:
return "string";
- case Value::TYPE_BINARY:
+ case base::Value::TYPE_BINARY:
return "binary";
- case Value::TYPE_DICTIONARY:
+ case base::Value::TYPE_DICTIONARY:
return "dictionary";
- case Value::TYPE_LIST:
+ case base::Value::TYPE_LIST:
return "list";
}
NOTREACHED();
diff --git a/tools/json_schema_compiler/util.h b/tools/json_schema_compiler/util.h
index b775be7..228eced 100644
--- a/tools/json_schema_compiler/util.h
+++ b/tools/json_schema_compiler/util.h
@@ -173,7 +173,7 @@ scoped_ptr<base::Value> CreateValueFromOptionalArray(
return scoped_ptr<base::Value>();
}
-std::string ValueTypeToString(Value::Type type);
+std::string ValueTypeToString(base::Value::Type type);
} // namespace util
} // namespace json_schema_compiler