diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-18 21:25:45 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-18 21:25:45 +0000 |
commit | 04be9805637fc59cf954c9c4f5ff0588a70d7479 (patch) | |
tree | 6f0166a3d7e8e82fd3484dc04b927bfcf5a58288 | |
parent | 434a6e8d165a0de16aff328af7ec988ec11928ff (diff) | |
download | chromium_src-04be9805637fc59cf954c9c4f5ff0588a70d7479.zip chromium_src-04be9805637fc59cf954c9c4f5ff0588a70d7479.tar.gz chromium_src-04be9805637fc59cf954c9c4f5ff0588a70d7479.tar.bz2 |
Get rid of the rest of CreateStringValue
BUG=160586
Review URL: https://codereview.chromium.org/388963002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284201 0039d316-1c4b-4281-b951-d872f2087c98
80 files changed, 656 insertions, 505 deletions
diff --git a/athena/virtual_keyboard/virtual_keyboard_bindings_impl.cc b/athena/virtual_keyboard/virtual_keyboard_bindings_impl.cc index a04520c..85fe5f5 100644 --- a/athena/virtual_keyboard/virtual_keyboard_bindings_impl.cc +++ b/athena/virtual_keyboard/virtual_keyboard_bindings_impl.cc @@ -143,11 +143,11 @@ class VKBindings : public gin::Wrappable<VKBindings> { return; } base::ListValue params; - params.Set(0, base::Value::CreateStringValue(event.event_type)); - params.Set(1, base::Value::CreateIntegerValue(event.char_value)); - params.Set(2, base::Value::CreateIntegerValue(event.key_code)); - params.Set(3, base::Value::CreateStringValue(event.key_name)); - params.Set(4, base::Value::CreateIntegerValue(event.modifiers)); + params.Set(0, new base::StringValue(event.event_type)); + params.Set(1, new base::FundamentalValue(event.char_value)); + params.Set(2, new base::FundamentalValue(event.key_code)); + params.Set(3, new base::StringValue(event.key_name)); + params.Set(4, new base::FundamentalValue(event.modifiers)); std::string params_json; JSONStringValueSerializer serializer(¶ms_json); diff --git a/cc/resources/tile_priority.cc b/cc/resources/tile_priority.cc index 425e4ed..18678d2 100644 --- a/cc/resources/tile_priority.cc +++ b/cc/resources/tile_priority.cc @@ -41,16 +41,15 @@ scoped_ptr<base::Value> TileResolutionAsValue( scoped_ptr<base::Value> TilePriorityBinAsValue(TilePriority::PriorityBin bin) { switch (bin) { case TilePriority::NOW: - return scoped_ptr<base::Value>(base::Value::CreateStringValue("NOW")); + return scoped_ptr<base::Value>(new base::StringValue("NOW")); case TilePriority::SOON: - return scoped_ptr<base::Value>(base::Value::CreateStringValue("SOON")); + return scoped_ptr<base::Value>(new base::StringValue("SOON")); case TilePriority::EVENTUALLY: - return scoped_ptr<base::Value>( - base::Value::CreateStringValue("EVENTUALLY")); + return scoped_ptr<base::Value>(new base::StringValue("EVENTUALLY")); } DCHECK(false) << "Unrecognized TilePriority::PriorityBin value " << bin; - return scoped_ptr<base::Value>(base::Value::CreateStringValue( - "<unknown TilePriority::PriorityBin value>")); + return scoped_ptr<base::Value>( + new base::StringValue("<unknown TilePriority::PriorityBin value>")); } scoped_ptr<base::Value> TilePriority::AsValue() const { diff --git a/chrome/browser/background/background_application_list_model_unittest.cc b/chrome/browser/background/background_application_list_model_unittest.cc index a8c8179..81da6eb 100644 --- a/chrome/browser/background/background_application_list_model_unittest.cc +++ b/chrome/browser/background/background_application_list_model_unittest.cc @@ -81,11 +81,11 @@ static scoped_refptr<Extension> CreateExtensionBase( base::ListValue* permissions = new base::ListValue(); manifest.Set(extensions::manifest_keys::kPermissions, permissions); if (background_permission) { - permissions->Append(base::Value::CreateStringValue("background")); + permissions->Append(new base::StringValue("background")); } if (push_messaging == PUSH_MESSAGING_PERMISSION || push_messaging == PUSH_MESSAGING_BUT_NOT_BACKGROUND) { - permissions->Append(base::Value::CreateStringValue("pushMessaging")); + permissions->Append(new base::StringValue("pushMessaging")); } std::string error; diff --git a/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc b/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc index 9550e15..303b177 100644 --- a/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc +++ b/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc @@ -118,7 +118,7 @@ class DeviceOAuth2TokenServiceTest : public testing::Test { void SetDeviceRefreshTokenInLocalState(const std::string& refresh_token) { scoped_testing_local_state_.Get()->SetUserPref( prefs::kDeviceRobotAnyApiRefreshToken, - base::Value::CreateStringValue(refresh_token)); + new base::StringValue(refresh_token)); } std::string GetValidTokenInfoResponse(const std::string email) { diff --git a/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc b/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc index 581094b..852b395 100644 --- a/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc +++ b/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc @@ -138,7 +138,7 @@ TEST_F(PolicyProviderTest, GettingManagedContentSettings) { TestingPrefServiceSyncable* prefs = profile.GetTestingPrefService(); base::ListValue* value = new base::ListValue(); - value->Append(base::Value::CreateStringValue("[*.]google.com")); + value->Append(new base::StringValue("[*.]google.com")); prefs->SetManagedPref(prefs::kManagedImagesBlockedForUrls, value); @@ -210,7 +210,7 @@ TEST_F(PolicyProviderTest, ResourceIdentifier) { TestingPrefServiceSyncable* prefs = profile.GetTestingPrefService(); base::ListValue* value = new base::ListValue(); - value->Append(base::Value::CreateStringValue("[*.]google.com")); + value->Append(new base::StringValue("[*.]google.com")); prefs->SetManagedPref(prefs::kManagedPluginsAllowedForUrls, value); @@ -263,8 +263,8 @@ TEST_F(PolicyProviderTest, AutoSelectCertificateList) { std::string pattern_str("\"pattern\":\"[*.]google.com\""); std::string filter_str("\"filter\":{\"ISSUER\":{\"CN\":\"issuer name\"}}"); base::ListValue* value = new base::ListValue(); - value->Append(base::Value::CreateStringValue( - "{" + pattern_str + "," + filter_str + "}")); + value->Append( + new base::StringValue("{" + pattern_str + "," + filter_str + "}")); prefs->SetManagedPref(prefs::kManagedAutoSelectCertificateForUrls, value); GURL youtube_url("https://www.youtube.com"); diff --git a/chrome/browser/download/download_dir_policy_handler_unittest.cc b/chrome/browser/download/download_dir_policy_handler_unittest.cc index fb8dc5f..fe9e2b6 100644 --- a/chrome/browser/download/download_dir_policy_handler_unittest.cc +++ b/chrome/browser/download/download_dir_policy_handler_unittest.cc @@ -71,7 +71,7 @@ TEST_F(DownloadDirPolicyHandlerTest, SetDownloadDirectory) { policy.Set(policy::key::kDownloadDirectory, policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, - base::Value::CreateStringValue(std::string()), + new base::StringValue(std::string()), NULL); UpdateProviderPolicy(policy); diff --git a/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc b/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc index ca12a24..76c3662 100644 --- a/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc +++ b/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc @@ -269,7 +269,7 @@ class ExtensionGCMAppHandlerTest : public testing::Test { manifest.SetString(manifest_keys::kVersion, "1.0.0.0"); manifest.SetString(manifest_keys::kName, kTestExtensionName); base::ListValue* permission_list = new base::ListValue; - permission_list->Append(base::Value::CreateStringValue("gcm")); + permission_list->Append(new base::StringValue("gcm")); manifest.Set(manifest_keys::kPermissions, permission_list); std::string error; diff --git a/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc b/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc index 5f206a0..54fadca 100644 --- a/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc +++ b/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc @@ -374,11 +374,10 @@ class ExtensionMessageBubbleTest : public testing::Test { base::Time::Now(), true, // is_enabled. false); // is_incognito_enabled. - extension_prefs_value_map->SetExtensionPref( - id, - prefs::kProxy, - kExtensionPrefsScopeRegular, - base::Value::CreateStringValue(id)); + extension_prefs_value_map->SetExtensionPref(id, + prefs::kProxy, + kExtensionPrefsScopeRegular, + new base::StringValue(id)); if (ExtensionRegistry::Get(profile())->enabled_extensions().GetByID(id)) return testing::AssertionSuccess(); diff --git a/chrome/browser/extensions/policy_handlers_unittest.cc b/chrome/browser/extensions/policy_handlers_unittest.cc index e163ab8..a7c1191 100644 --- a/chrome/browser/extensions/policy_handlers_unittest.cc +++ b/chrome/browser/extensions/policy_handlers_unittest.cc @@ -32,8 +32,7 @@ TEST(ExtensionListPolicyHandlerTest, CheckPolicySettings) { EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors)); EXPECT_TRUE(errors.empty()); - list.Append( - base::Value::CreateStringValue("abcdefghijklmnopabcdefghijklmnop")); + list.Append(new base::StringValue("abcdefghijklmnopabcdefghijklmnop")); policy_map.Set(policy::key::kExtensionInstallBlacklist, policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, @@ -43,7 +42,7 @@ TEST(ExtensionListPolicyHandlerTest, CheckPolicySettings) { EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors)); EXPECT_TRUE(errors.empty()); - list.Append(base::Value::CreateStringValue("*")); + list.Append(new base::StringValue("*")); policy_map.Set(policy::key::kExtensionInstallBlacklist, policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, @@ -53,7 +52,7 @@ TEST(ExtensionListPolicyHandlerTest, CheckPolicySettings) { EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors)); EXPECT_TRUE(errors.empty()); - list.Append(base::Value::CreateStringValue("invalid")); + list.Append(new base::StringValue("invalid")); policy_map.Set(policy::key::kExtensionInstallBlacklist, policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, @@ -75,10 +74,8 @@ TEST(ExtensionListPolicyHandlerTest, ApplyPolicySettings) { ExtensionListPolicyHandler handler( policy::key::kExtensionInstallBlacklist, kTestPref, false); - policy.Append( - base::Value::CreateStringValue("abcdefghijklmnopabcdefghijklmnop")); - expected.Append( - base::Value::CreateStringValue("abcdefghijklmnopabcdefghijklmnop")); + policy.Append(new base::StringValue("abcdefghijklmnopabcdefghijklmnop")); + expected.Append(new base::StringValue("abcdefghijklmnopabcdefghijklmnop")); policy_map.Set(policy::key::kExtensionInstallBlacklist, policy::POLICY_LEVEL_MANDATORY, @@ -89,7 +86,7 @@ TEST(ExtensionListPolicyHandlerTest, ApplyPolicySettings) { EXPECT_TRUE(prefs.GetValue(kTestPref, &value)); EXPECT_TRUE(base::Value::Equals(&expected, value)); - policy.Append(base::Value::CreateStringValue("invalid")); + policy.Append(new base::StringValue("invalid")); policy_map.Set(policy::key::kExtensionInstallBlacklist, policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, @@ -220,7 +217,7 @@ TEST(ExtensionURLPatternListPolicyHandlerTest, CheckPolicySettings) { EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors)); EXPECT_TRUE(errors.empty()); - list.Append(base::Value::CreateStringValue("http://*.google.com/*")); + list.Append(new base::StringValue("http://*.google.com/*")); policy_map.Set(policy::key::kExtensionInstallSources, policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, @@ -230,7 +227,7 @@ TEST(ExtensionURLPatternListPolicyHandlerTest, CheckPolicySettings) { EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors)); EXPECT_TRUE(errors.empty()); - list.Append(base::Value::CreateStringValue("<all_urls>")); + list.Append(new base::StringValue("<all_urls>")); policy_map.Set(policy::key::kExtensionInstallSources, policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, @@ -240,7 +237,7 @@ TEST(ExtensionURLPatternListPolicyHandlerTest, CheckPolicySettings) { EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors)); EXPECT_TRUE(errors.empty()); - list.Append(base::Value::CreateStringValue("invalid")); + list.Append(new base::StringValue("invalid")); policy_map.Set(policy::key::kExtensionInstallSources, policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, @@ -253,7 +250,7 @@ TEST(ExtensionURLPatternListPolicyHandlerTest, CheckPolicySettings) { // URLPattern syntax has a different way to express 'all urls'. Though '*' // would be compatible today, it would be brittle, so we disallow. - list.Append(base::Value::CreateStringValue("*")); + list.Append(new base::StringValue("*")); policy_map.Set(policy::key::kExtensionInstallSources, policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, @@ -273,7 +270,7 @@ TEST(ExtensionURLPatternListPolicyHandlerTest, ApplyPolicySettings) { ExtensionURLPatternListPolicyHandler handler( policy::key::kExtensionInstallSources, kTestPref); - list.Append(base::Value::CreateStringValue("https://corp.monkey.net/*")); + list.Append(new base::StringValue("https://corp.monkey.net/*")); policy_map.Set(policy::key::kExtensionInstallSources, policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, diff --git a/chrome/browser/media_galleries/media_galleries_test_util.cc b/chrome/browser/media_galleries/media_galleries_test_util.cc index 736fb30..e6108fb 100644 --- a/chrome/browser/media_galleries/media_galleries_test_util.cc +++ b/chrome/browser/media_galleries/media_galleries_test_util.cc @@ -44,15 +44,14 @@ scoped_refptr<extensions::Extension> AddMediaGalleriesApp( manifest->SetString(extensions::manifest_keys::kVersion, "0.1"); manifest->SetInteger(extensions::manifest_keys::kManifestVersion, 2); base::ListValue* background_script_list = new base::ListValue; - background_script_list->Append( - base::Value::CreateStringValue("background.js")); + background_script_list->Append(new base::StringValue("background.js")); manifest->Set(extensions::manifest_keys::kPlatformAppBackgroundScripts, background_script_list); base::ListValue* permission_detail_list = new base::ListValue; for (size_t i = 0; i < media_galleries_permissions.size(); i++) permission_detail_list->Append( - base::Value::CreateStringValue(media_galleries_permissions[i])); + new base::StringValue(media_galleries_permissions[i])); base::DictionaryValue* media_galleries_permission = new base::DictionaryValue(); media_galleries_permission->Set("mediaGalleries", permission_detail_list); diff --git a/chrome/browser/net/disk_cache_dir_policy_handler_unittest.cc b/chrome/browser/net/disk_cache_dir_policy_handler_unittest.cc index b8b1412..e89d32d 100644 --- a/chrome/browser/net/disk_cache_dir_policy_handler_unittest.cc +++ b/chrome/browser/net/disk_cache_dir_policy_handler_unittest.cc @@ -43,7 +43,7 @@ TEST_F(DiskCacheDirPolicyTest, SetPolicyValid) { policy_.Set(key::kDiskCacheDir, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(in), + new base::StringValue(in), NULL); handler_.ApplyPolicySettings(policy_, &prefs_); diff --git a/chrome/browser/policy/cloud/cloud_policy_browsertest.cc b/chrome/browser/policy/cloud/cloud_policy_browsertest.cc index 60795d2..c238659 100644 --- a/chrome/browser/policy/cloud/cloud_policy_browsertest.cc +++ b/chrome/browser/policy/cloud/cloud_policy_browsertest.cc @@ -138,9 +138,11 @@ std::string GetTestPolicy(const char* homepage, int key_version) { void GetExpectedDefaultPolicy(PolicyMap* policy_map) { #if defined(OS_CHROMEOS) - policy_map->Set( - key::kChromeOsMultiProfileUserBehavior, POLICY_LEVEL_MANDATORY, - POLICY_SCOPE_USER, base::Value::CreateStringValue("primary-only"), NULL); + policy_map->Set(key::kChromeOsMultiProfileUserBehavior, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("primary-only"), + NULL); #endif } @@ -161,13 +163,17 @@ void GetExpectedTestPolicy(PolicyMap* expected, const char* homepage) { expected->Set( key::kMaxInvalidationFetchDelay, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, base::Value::CreateIntegerValue(1000), NULL); - expected->Set( - key::kHomepageLocation, POLICY_LEVEL_RECOMMENDED, - POLICY_SCOPE_USER, base::Value::CreateStringValue(homepage), NULL); + expected->Set(key::kHomepageLocation, + POLICY_LEVEL_RECOMMENDED, + POLICY_SCOPE_USER, + new base::StringValue(homepage), + NULL); #if defined(OS_CHROMEOS) - expected->Set( - key::kChromeOsMultiProfileUserBehavior, POLICY_LEVEL_MANDATORY, - POLICY_SCOPE_USER, base::Value::CreateStringValue("primary-only"), NULL); + expected->Set(key::kChromeOsMultiProfileUserBehavior, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("primary-only"), + NULL); #endif } diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc index 1121e20..f6d2c87 100644 --- a/chrome/browser/policy/policy_browsertest.cc +++ b/chrome/browser/policy/policy_browsertest.cc @@ -753,9 +753,11 @@ class LocalePolicyTest : public PolicyTest { virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { PolicyTest::SetUpInProcessBrowserTestFixture(); PolicyMap policies; - policies.Set( - key::kApplicationLocaleValue, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("fr"), NULL); + policies.Set(key::kApplicationLocaleValue, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("fr"), + NULL); provider_.UpdateChromePolicy(policies); // The "en-US" ResourceBundle is always loaded before this step for tests, // but in this test we want the browser to load the bundle as it @@ -902,31 +904,39 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, DefaultSearchProvider) { new base::FundamentalValue(true), NULL); policies.Set(key::kDefaultSearchProviderKeyword, - POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(kKeyword), NULL); + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kKeyword), + NULL); policies.Set(key::kDefaultSearchProviderSearchURL, - POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(kSearchURL), NULL); + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kSearchURL), + NULL); base::ListValue* alternate_urls = new base::ListValue(); alternate_urls->AppendString(kAlternateURL0); alternate_urls->AppendString(kAlternateURL1); policies.Set(key::kDefaultSearchProviderAlternateURLs, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, alternate_urls, NULL); policies.Set(key::kDefaultSearchProviderSearchTermsReplacementKey, - POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(kSearchTermsReplacementKey), + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kSearchTermsReplacementKey), NULL); policies.Set(key::kDefaultSearchProviderImageURL, - POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(kImageURL), + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kImageURL), NULL); policies.Set(key::kDefaultSearchProviderImageURLPostParams, - POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(kImageURLPostParams), + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kImageURLPostParams), NULL); policies.Set(key::kDefaultSearchProviderNewTabURL, - POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(kNewTabURL), + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kNewTabURL), NULL); UpdateProviderPolicy(policies); default_search = service->GetDefaultSearchProvider(); @@ -1096,22 +1106,29 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, ReplaceSearchTerms) { new base::FundamentalValue(true), NULL); policies.Set(key::kDefaultSearchProviderKeyword, - POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(kKeyword), NULL); + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kKeyword), + NULL); policies.Set(key::kDefaultSearchProviderSearchURL, - POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(kSearchURL), NULL); + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kSearchURL), + NULL); policies.Set(key::kDefaultSearchProviderInstantURL, - POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(kInstantURL), NULL); + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kInstantURL), + NULL); base::ListValue* alternate_urls = new base::ListValue(); alternate_urls->AppendString(kAlternateURL0); alternate_urls->AppendString(kAlternateURL1); policies.Set(key::kDefaultSearchProviderAlternateURLs, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, alternate_urls, NULL); policies.Set(key::kDefaultSearchProviderSearchTermsReplacementKey, - POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(kSearchTermsReplacementKey), + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kSearchTermsReplacementKey), NULL); UpdateProviderPolicy(policies); default_search = service->GetDefaultSearchProvider(); @@ -1255,7 +1272,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, DisabledPlugins) { // Now disable it with a policy. base::ListValue disabled_plugins; - disabled_plugins.Append(base::Value::CreateStringValue("*Flash*")); + disabled_plugins.Append(new base::StringValue("*Flash*")); PolicyMap policies; policies.Set(key::kDisabledPlugins, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, disabled_plugins.DeepCopy(), NULL); @@ -1282,7 +1299,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, DisabledPluginsExceptions) { // Disable all plugins. base::ListValue disabled_plugins; - disabled_plugins.Append(base::Value::CreateStringValue("*")); + disabled_plugins.Append(new base::StringValue("*")); PolicyMap policies; policies.Set(key::kDisabledPlugins, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, disabled_plugins.DeepCopy(), NULL); @@ -1294,8 +1311,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, DisabledPluginsExceptions) { // Now open an exception for flash. base::ListValue disabled_plugins_exceptions; - disabled_plugins_exceptions.Append( - base::Value::CreateStringValue("*Flash*")); + disabled_plugins_exceptions.Append(new base::StringValue("*Flash*")); policies.Set(key::kDisabledPluginsExceptions, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, disabled_plugins_exceptions.DeepCopy(), NULL); UpdateProviderPolicy(policies); @@ -1323,7 +1339,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, EnabledPlugins) { EXPECT_TRUE(SetPluginEnabled(plugin_prefs, flash, false)); EXPECT_FALSE(plugin_prefs->IsPluginEnabled(*flash)); base::ListValue plugin_list; - plugin_list.Append(base::Value::CreateStringValue(content::kFlashPluginName)); + plugin_list.Append(new base::StringValue(content::kFlashPluginName)); PolicyMap policies; policies.Set(key::kEnabledPlugins, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, plugin_list.DeepCopy(), NULL); @@ -1484,9 +1500,11 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, DownloadDirectory) { base::ScopedTempDir forced_dir; ASSERT_TRUE(forced_dir.CreateUniqueTempDir()); PolicyMap policies; - policies.Set(key::kDownloadDirectory, POLICY_LEVEL_MANDATORY, + policies.Set(key::kDownloadDirectory, + POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(forced_dir.path().value()), NULL); + new base::StringValue(forced_dir.path().value()), + NULL); UpdateProviderPolicy(policies); DownloadAndVerifyFile(browser(), forced_dir.path(), file); // Verify that the first download location wasn't affected. @@ -1501,7 +1519,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, ASSERT_FALSE(service->GetExtensionById(kGoodCrxId, true)); ASSERT_FALSE(service->GetExtensionById(kAdBlockCrxId, true)); base::ListValue blacklist; - blacklist.Append(base::Value::CreateStringValue(kGoodCrxId)); + blacklist.Append(new base::StringValue(kGoodCrxId)); PolicyMap policies; policies.Set(key::kExtensionInstallBlacklist, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, blacklist.DeepCopy(), NULL); @@ -1532,7 +1550,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, MAYBE_ExtensionInstallBlacklistWildcard) { ASSERT_FALSE(service->GetExtensionById(kGoodCrxId, true)); ASSERT_TRUE(service->GetExtensionById(kAdBlockCrxId, true)); base::ListValue blacklist; - blacklist.Append(base::Value::CreateStringValue("*")); + blacklist.Append(new base::StringValue("*")); PolicyMap policies; policies.Set(key::kExtensionInstallBlacklist, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, blacklist.DeepCopy(), NULL); @@ -1554,9 +1572,9 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, ExtensionInstallWhitelist) { ASSERT_FALSE(service->GetExtensionById(kGoodCrxId, true)); ASSERT_FALSE(service->GetExtensionById(kAdBlockCrxId, true)); base::ListValue blacklist; - blacklist.Append(base::Value::CreateStringValue("*")); + blacklist.Append(new base::StringValue("*")); base::ListValue whitelist; - whitelist.Append(base::Value::CreateStringValue(kGoodCrxId)); + whitelist.Append(new base::StringValue(kGoodCrxId)); PolicyMap policies; policies.Set(key::kExtensionInstallBlacklist, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, blacklist.DeepCopy(), NULL); @@ -1590,8 +1608,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, ExtensionInstallForcelist) { // Setting the forcelist extension should install "good_v1.crx". base::ListValue forcelist; - forcelist.Append(base::Value::CreateStringValue(base::StringPrintf( - "%s;%s", kGoodCrxId, url.spec().c_str()))); + forcelist.Append(new base::StringValue( + base::StringPrintf("%s;%s", kGoodCrxId, url.spec().c_str()))); PolicyMap policies; policies.Set(key::kExtensionInstallForcelist, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, forcelist.DeepCopy(), NULL); @@ -1800,9 +1818,10 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, HomepageLocation) { // Now override with policy. PolicyMap policies; - policies.Set(key::kHomepageLocation, POLICY_LEVEL_MANDATORY, + policies.Set(key::kHomepageLocation, + POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(chrome::kChromeUICreditsURL), + new base::StringValue(chrome::kChromeUICreditsURL), NULL); UpdateProviderPolicy(policies); EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_HOME)); @@ -2030,7 +2049,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, URLBlacklist) { // Set a blacklist. base::ListValue blacklist; - blacklist.Append(base::Value::CreateStringValue("bbb.com")); + blacklist.Append(new base::StringValue("bbb.com")); PolicyMap policies; policies.Set(key::kURLBlacklist, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, blacklist.DeepCopy(), NULL); @@ -2043,8 +2062,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, URLBlacklist) { // Whitelist some sites of bbb.com. base::ListValue whitelist; - whitelist.Append(base::Value::CreateStringValue("sub.bbb.com")); - whitelist.Append(base::Value::CreateStringValue("bbb.com/policy")); + whitelist.Append(new base::StringValue("sub.bbb.com")); + whitelist.Append(new base::StringValue("bbb.com/policy")); policies.Set(key::kURLWhitelist, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, whitelist.DeepCopy(), NULL); UpdateProviderPolicy(policies); @@ -2080,7 +2099,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_FileURLBlacklist) { // Set a blacklist for all the files. base::ListValue blacklist; - blacklist.Append(base::Value::CreateStringValue("file://*")); + blacklist.Append(new base::StringValue("file://*")); PolicyMap policies; policies.Set(key::kURLBlacklist, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, blacklist.DeepCopy(), NULL); @@ -2103,7 +2122,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_FileURLBlacklist) { list_url->end()); base::ListValue disabledscheme; - disabledscheme.Append(base::Value::CreateStringValue("file")); + disabledscheme.Append(new base::StringValue("file")); policies.Set(key::kDisabledSchemes, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, disabledscheme.DeepCopy(), NULL); UpdateProviderPolicy(policies); @@ -2115,10 +2134,10 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_FileURLBlacklist) { // Whitelist one folder and blacklist an another just inside. base::ListValue whitelist; - whitelist.Append(base::Value::CreateStringValue(base_path)); + whitelist.Append(new base::StringValue(base_path)); policies.Set(key::kURLWhitelist, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, whitelist.DeepCopy(), NULL); - blacklist.Append(base::Value::CreateStringValue(folder_path)); + blacklist.Append(new base::StringValue(folder_path)); policies.Set(key::kURLBlacklist, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, blacklist.DeepCopy(), NULL); UpdateProviderPolicy(policies); @@ -2628,9 +2647,11 @@ class RestoreOnStartupPolicyTest POLICY_SCOPE_USER, new base::FundamentalValue(false), NULL); - policies.Set( - key::kHomepageLocation, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(kRestoredURLs[1]), NULL); + policies.Set(key::kHomepageLocation, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kRestoredURLs[1]), + NULL); provider_.UpdateChromePolicy(policies); expected_urls_.push_back(GURL(kRestoredURLs[1])); @@ -2659,7 +2680,7 @@ class RestoreOnStartupPolicyTest // Verifies that policy can set the startup pages to a list of URLs. base::ListValue urls; for (size_t i = 0; i < arraysize(kRestoredURLs); ++i) { - urls.Append(base::Value::CreateStringValue(kRestoredURLs[i])); + urls.Append(new base::StringValue(kRestoredURLs[i])); expected_urls_.push_back(GURL(kRestoredURLs[i])); } PolicyMap policies; @@ -2759,9 +2780,11 @@ class PolicyStatisticsCollectorTest : public PolicyTest { POLICY_SCOPE_USER, new base::FundamentalValue(false), NULL); - policies.Set( - key::kHomepageLocation, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("http://chromium.org"), NULL); + policies.Set(key::kHomepageLocation, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("http://chromium.org"), + NULL); provider_.UpdateChromePolicy(policies); } }; @@ -3037,12 +3060,11 @@ class PolicyVariationsServiceTest : public PolicyTest { virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { PolicyTest::SetUpInProcessBrowserTestFixture(); PolicyMap policies; - policies.Set( - key::kVariationsRestrictParameter, - POLICY_LEVEL_MANDATORY, - POLICY_SCOPE_USER, - base::Value::CreateStringValue("restricted"), - NULL); + policies.Set(key::kVariationsRestrictParameter, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("restricted"), + NULL); provider_.UpdateChromePolicy(policies); } }; @@ -3063,7 +3085,7 @@ IN_PROC_BROWSER_TEST_F(PolicyVariationsServiceTest, VariationsURLIsValid) { IN_PROC_BROWSER_TEST_F(PolicyTest, NativeMessagingBlacklistSelective) { base::ListValue blacklist; - blacklist.Append(base::Value::CreateStringValue("host.name")); + blacklist.Append(new base::StringValue("host.name")); PolicyMap policies; policies.Set(key::kNativeMessagingBlacklist, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, blacklist.DeepCopy(), NULL); @@ -3078,7 +3100,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, NativeMessagingBlacklistSelective) { IN_PROC_BROWSER_TEST_F(PolicyTest, NativeMessagingBlacklistWildcard) { base::ListValue blacklist; - blacklist.Append(base::Value::CreateStringValue("*")); + blacklist.Append(new base::StringValue("*")); PolicyMap policies; policies.Set(key::kNativeMessagingBlacklist, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, blacklist.DeepCopy(), NULL); @@ -3093,9 +3115,9 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, NativeMessagingBlacklistWildcard) { IN_PROC_BROWSER_TEST_F(PolicyTest, NativeMessagingWhitelist) { base::ListValue blacklist; - blacklist.Append(base::Value::CreateStringValue("*")); + blacklist.Append(new base::StringValue("*")); base::ListValue whitelist; - whitelist.Append(base::Value::CreateStringValue("host.name")); + whitelist.Append(new base::StringValue("host.name")); PolicyMap policies; policies.Set(key::kNativeMessagingBlacklist, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, blacklist.DeepCopy(), NULL); diff --git a/chrome/browser/prefs/chrome_pref_service_unittest.cc b/chrome/browser/prefs/chrome_pref_service_unittest.cc index 2940ce8..c1b1b2a 100644 --- a/chrome/browser/prefs/chrome_pref_service_unittest.cc +++ b/chrome/browser/prefs/chrome_pref_service_unittest.cc @@ -101,7 +101,7 @@ class ChromePrefServiceWebKitPrefs : public ChromeRenderViewHostTestHarness { TestingPrefServiceSyncable* pref_services = profile()->GetTestingPrefService(); pref_services->SetUserPref(prefs::kDefaultCharset, - base::Value::CreateStringValue("utf8")); + new base::StringValue("utf8")); pref_services->SetUserPref(prefs::kWebKitDefaultFontSize, base::Value::CreateIntegerValue(20)); pref_services->SetUserPref(prefs::kWebKitTextAreasAreResizable, @@ -109,7 +109,7 @@ class ChromePrefServiceWebKitPrefs : public ChromeRenderViewHostTestHarness { pref_services->SetUserPref(prefs::kWebKitUsesUniversalDetector, new base::FundamentalValue(true)); pref_services->SetUserPref("webkit.webprefs.foo", - base::Value::CreateStringValue("bar")); + new base::StringValue("bar")); } }; diff --git a/chrome/browser/prefs/pref_hash_calculator_unittest.cc b/chrome/browser/prefs/pref_hash_calculator_unittest.cc index 356cc56..34971ad 100644 --- a/chrome/browser/prefs/pref_hash_calculator_unittest.cc +++ b/chrome/browser/prefs/pref_hash_calculator_unittest.cc @@ -86,8 +86,8 @@ TEST(PrefHashCalculatorTest, CatchHashChanges) { base::Value::CreateIntegerValue(1234567890)); scoped_ptr<base::Value> double_value( new base::FundamentalValue(123.0987654321)); - scoped_ptr<base::Value> string_value(base::Value::CreateStringValue( - "testing with special chars:\n<>{}:^^@#$\\/")); + scoped_ptr<base::Value> string_value( + new base::StringValue("testing with special chars:\n<>{}:^^@#$\\/")); // For legacy reasons, we have to support pruning of empty lists/dictionaries // and nested empty ists/dicts in the hash generation algorithm. diff --git a/chrome/browser/prefs/pref_hash_filter_unittest.cc b/chrome/browser/prefs/pref_hash_filter_unittest.cc index cbf12b1..b9d0d22 100644 --- a/chrome/browser/prefs/pref_hash_filter_unittest.cc +++ b/chrome/browser/prefs/pref_hash_filter_unittest.cc @@ -465,7 +465,7 @@ TEST_P(PrefHashFilterTest, StampSuperMACAltersStore) { TEST_P(PrefHashFilterTest, FilterTrackedPrefUpdate) { base::DictionaryValue root_dict; // Ownership of |string_value| is transfered to |root_dict|. - base::Value* string_value = base::Value::CreateStringValue("string value"); + base::Value* string_value = new base::StringValue("string value"); root_dict.Set(kAtomicPref, string_value); // No path should be stored on FilterUpdate. @@ -546,7 +546,7 @@ TEST_P(PrefHashFilterTest, FilterSplitPrefUpdate) { TEST_P(PrefHashFilterTest, FilterUntrackedPrefUpdate) { base::DictionaryValue root_dict; - root_dict.Set("untracked", base::Value::CreateStringValue("some value")); + root_dict.Set("untracked", new base::StringValue("some value")); pref_hash_filter_->FilterUpdate("untracked"); // No paths should be stored on FilterUpdate. @@ -731,7 +731,7 @@ TEST_P(PrefHashFilterTest, InitialValueUnknown) { TEST_P(PrefHashFilterTest, InitialValueTrustedUnknown) { // Ownership of this value is transfered to |pref_store_contents_|. - base::Value* string_value = base::Value::CreateStringValue("test"); + base::Value* string_value = new base::StringValue("test"); pref_store_contents_->Set(kAtomicPref, string_value); base::DictionaryValue* dict_value = new base::DictionaryValue; @@ -906,7 +906,7 @@ TEST_P(PrefHashFilterTest, InitialValueMigrated) { // Ownership of this value is transfered to |pref_store_contents_|. base::ListValue* list_value = new base::ListValue; - list_value->Append(base::Value::CreateStringValue("test")); + list_value->Append(new base::StringValue("test")); pref_store_contents_->Set(kAtomicPref, list_value); ASSERT_TRUE(pref_store_contents_->Get(kAtomicPref, NULL)); diff --git a/chrome/browser/prefs/pref_model_associator_unittest.cc b/chrome/browser/prefs/pref_model_associator_unittest.cc index 0c9d45b..203e4a7 100644 --- a/chrome/browser/prefs/pref_model_associator_unittest.cc +++ b/chrome/browser/prefs/pref_model_associator_unittest.cc @@ -62,8 +62,8 @@ class ListPreferenceMergeTest : public AbstractPreferenceMergeTest { virtual void SetUp() { AbstractPreferenceMergeTest::SetUp(); - server_url_list_.Append(base::Value::CreateStringValue(server_url0_)); - server_url_list_.Append(base::Value::CreateStringValue(server_url1_)); + server_url_list_.Append(new base::StringValue(server_url0_)); + server_url_list_.Append(new base::StringValue(server_url1_)); } std::string server_url0_; @@ -77,8 +77,7 @@ TEST_F(ListPreferenceMergeTest, NotListOrDictionary) { pref_service_->SetString(prefs::kHomePage, local_url0_); const PrefService::Preference* pref = pref_service_->FindPreference(prefs::kHomePage); - scoped_ptr<base::Value> server_value( - base::Value::CreateStringValue(server_url0_)); + scoped_ptr<base::Value> server_value(new base::StringValue(server_url0_)); scoped_ptr<base::Value> merged_value( PrefModelAssociator::MergePreference(pref->name(), *pref->GetValue(), @@ -102,7 +101,7 @@ TEST_F(ListPreferenceMergeTest, ServerNull) { { ListPrefUpdate update(pref_service_, prefs::kURLsToRestoreOnStartup); base::ListValue* local_list_value = update.Get(); - local_list_value->Append(base::Value::CreateStringValue(local_url0_)); + local_list_value->Append(new base::StringValue(local_url0_)); } const PrefService::Preference* pref = @@ -121,7 +120,7 @@ TEST_F(ListPreferenceMergeTest, ServerEmpty) { { ListPrefUpdate update(pref_service_, prefs::kURLsToRestoreOnStartup); base::ListValue* local_list_value = update.Get(); - local_list_value->Append(base::Value::CreateStringValue(local_url0_)); + local_list_value->Append(new base::StringValue(local_url0_)); } const PrefService::Preference* pref = @@ -139,8 +138,8 @@ TEST_F(ListPreferenceMergeTest, Merge) { { ListPrefUpdate update(pref_service_, prefs::kURLsToRestoreOnStartup); base::ListValue* local_list_value = update.Get(); - local_list_value->Append(base::Value::CreateStringValue(local_url0_)); - local_list_value->Append(base::Value::CreateStringValue(local_url1_)); + local_list_value->Append(new base::StringValue(local_url0_)); + local_list_value->Append(new base::StringValue(local_url1_)); } const PrefService::Preference* pref = @@ -151,10 +150,10 @@ TEST_F(ListPreferenceMergeTest, Merge) { server_url_list_)); base::ListValue expected; - expected.Append(base::Value::CreateStringValue(server_url0_)); - expected.Append(base::Value::CreateStringValue(server_url1_)); - expected.Append(base::Value::CreateStringValue(local_url0_)); - expected.Append(base::Value::CreateStringValue(local_url1_)); + expected.Append(new base::StringValue(server_url0_)); + expected.Append(new base::StringValue(server_url1_)); + expected.Append(new base::StringValue(local_url0_)); + expected.Append(new base::StringValue(local_url1_)); EXPECT_TRUE(merged_value->Equals(&expected)); } @@ -162,9 +161,9 @@ TEST_F(ListPreferenceMergeTest, Duplicates) { { ListPrefUpdate update(pref_service_, prefs::kURLsToRestoreOnStartup); base::ListValue* local_list_value = update.Get(); - local_list_value->Append(base::Value::CreateStringValue(local_url0_)); - local_list_value->Append(base::Value::CreateStringValue(server_url0_)); - local_list_value->Append(base::Value::CreateStringValue(server_url1_)); + local_list_value->Append(new base::StringValue(local_url0_)); + local_list_value->Append(new base::StringValue(server_url0_)); + local_list_value->Append(new base::StringValue(server_url1_)); } const PrefService::Preference* pref = @@ -175,9 +174,9 @@ TEST_F(ListPreferenceMergeTest, Duplicates) { server_url_list_)); base::ListValue expected; - expected.Append(base::Value::CreateStringValue(server_url0_)); - expected.Append(base::Value::CreateStringValue(server_url1_)); - expected.Append(base::Value::CreateStringValue(local_url0_)); + expected.Append(new base::StringValue(server_url0_)); + expected.Append(new base::StringValue(server_url1_)); + expected.Append(new base::StringValue(local_url0_)); EXPECT_TRUE(merged_value->Equals(&expected)); } @@ -185,8 +184,8 @@ TEST_F(ListPreferenceMergeTest, Equals) { { ListPrefUpdate update(pref_service_, prefs::kURLsToRestoreOnStartup); base::ListValue* local_list_value = update.Get(); - local_list_value->Append(base::Value::CreateStringValue(server_url0_)); - local_list_value->Append(base::Value::CreateStringValue(server_url1_)); + local_list_value->Append(new base::StringValue(server_url0_)); + local_list_value->Append(new base::StringValue(server_url1_)); } scoped_ptr<base::Value> original(server_url_list_.DeepCopy()); @@ -369,7 +368,7 @@ class IndividualPreferenceMergeTest : public AbstractPreferenceMergeTest { virtual void SetUp() { AbstractPreferenceMergeTest::SetUp(); - server_url_list_.Append(base::Value::CreateStringValue(url0_)); + server_url_list_.Append(new base::StringValue(url0_)); SetContentPattern(&server_patterns_, expression0_, content_type0_, 1); } @@ -377,7 +376,7 @@ class IndividualPreferenceMergeTest : public AbstractPreferenceMergeTest { { ListPrefUpdate update(pref_service_, pref); base::ListValue* local_list_value = update.Get(); - local_list_value->Append(base::Value::CreateStringValue(url1_)); + local_list_value->Append(new base::StringValue(url1_)); } scoped_ptr<base::Value> merged_value(PrefModelAssociator::MergePreference( @@ -386,8 +385,8 @@ class IndividualPreferenceMergeTest : public AbstractPreferenceMergeTest { server_url_list_)); base::ListValue expected; - expected.Append(base::Value::CreateStringValue(url0_)); - expected.Append(base::Value::CreateStringValue(url1_)); + expected.Append(new base::StringValue(url0_)); + expected.Append(new base::StringValue(url1_)); return merged_value->Equals(&expected); } diff --git a/chrome/browser/prefs/proxy_policy_unittest.cc b/chrome/browser/prefs/proxy_policy_unittest.cc index 0111646..17bb21b 100644 --- a/chrome/browser/prefs/proxy_policy_unittest.cc +++ b/chrome/browser/prefs/proxy_policy_unittest.cc @@ -120,15 +120,21 @@ class ProxyPolicyTest : public testing::Test { TEST_F(ProxyPolicyTest, OverridesCommandLineOptions) { command_line_.AppendSwitchASCII(switches::kProxyBypassList, "123"); command_line_.AppendSwitchASCII(switches::kProxyServer, "789"); - base::Value* mode_name = base::Value::CreateStringValue( - ProxyPrefs::kFixedServersProxyModeName); + base::Value* mode_name = + new base::StringValue(ProxyPrefs::kFixedServersProxyModeName); PolicyMap policy; policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, mode_name, NULL); - policy.Set(key::kProxyBypassList, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("abc"), NULL); - policy.Set(key::kProxyServer, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("ghi"), NULL); + policy.Set(key::kProxyBypassList, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("abc"), + NULL); + policy.Set(key::kProxyServer, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("ghi"), + NULL); provider_.UpdateChromePolicy(policy); // First verify that command-line options are set correctly when @@ -154,8 +160,8 @@ TEST_F(ProxyPolicyTest, OverridesCommandLineOptions) { TEST_F(ProxyPolicyTest, OverridesUnrelatedCommandLineOptions) { command_line_.AppendSwitchASCII(switches::kProxyBypassList, "123"); command_line_.AppendSwitchASCII(switches::kProxyServer, "789"); - base::Value* mode_name = base::Value::CreateStringValue( - ProxyPrefs::kAutoDetectProxyModeName); + base::Value* mode_name = + new base::StringValue(ProxyPrefs::kAutoDetectProxyModeName); PolicyMap policy; policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, mode_name, NULL); @@ -181,8 +187,8 @@ TEST_F(ProxyPolicyTest, OverridesUnrelatedCommandLineOptions) { TEST_F(ProxyPolicyTest, OverridesCommandLineNoProxy) { command_line_.AppendSwitch(switches::kNoProxyServer); - base::Value* mode_name = base::Value::CreateStringValue( - ProxyPrefs::kAutoDetectProxyModeName); + base::Value* mode_name = + new base::StringValue(ProxyPrefs::kAutoDetectProxyModeName); PolicyMap policy; policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, mode_name, NULL); @@ -204,8 +210,8 @@ TEST_F(ProxyPolicyTest, OverridesCommandLineNoProxy) { TEST_F(ProxyPolicyTest, OverridesCommandLineAutoDetect) { command_line_.AppendSwitch(switches::kProxyAutoDetect); - base::Value* mode_name = base::Value::CreateStringValue( - ProxyPrefs::kDirectProxyModeName); + base::Value* mode_name = + new base::StringValue(ProxyPrefs::kDirectProxyModeName); PolicyMap policy; policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, mode_name, NULL); diff --git a/chrome/browser/prefs/session_startup_pref_unittest.cc b/chrome/browser/prefs/session_startup_pref_unittest.cc index 659b492..c43a67f 100644 --- a/chrome/browser/prefs/session_startup_pref_unittest.cc +++ b/chrome/browser/prefs/session_startup_pref_unittest.cc @@ -49,8 +49,8 @@ class SessionStartupPrefTest : public testing::Test { TEST_F(SessionStartupPrefTest, URLListIsFixedUp) { base::ListValue* url_pref_list = new base::ListValue; - url_pref_list->Set(0, base::Value::CreateStringValue("google.com")); - url_pref_list->Set(1, base::Value::CreateStringValue("chromium.org")); + url_pref_list->Set(0, new base::StringValue("google.com")); + url_pref_list->Set(1, new base::StringValue("chromium.org")); pref_service_->SetUserPref(prefs::kURLsToRestoreOnStartup, url_pref_list); SessionStartupPref result = @@ -62,13 +62,13 @@ TEST_F(SessionStartupPrefTest, URLListIsFixedUp) { TEST_F(SessionStartupPrefTest, URLListManagedOverridesUser) { base::ListValue* url_pref_list1 = new base::ListValue; - url_pref_list1->Set(0, base::Value::CreateStringValue("chromium.org")); + url_pref_list1->Set(0, new base::StringValue("chromium.org")); pref_service_->SetUserPref(prefs::kURLsToRestoreOnStartup, url_pref_list1); base::ListValue* url_pref_list2 = new base::ListValue; - url_pref_list2->Set(0, base::Value::CreateStringValue("chromium.org")); - url_pref_list2->Set(1, base::Value::CreateStringValue("chromium.org")); - url_pref_list2->Set(2, base::Value::CreateStringValue("chromium.org")); + url_pref_list2->Set(0, new base::StringValue("chromium.org")); + url_pref_list2->Set(1, new base::StringValue("chromium.org")); + url_pref_list2->Set(2, new base::StringValue("chromium.org")); pref_service_->SetManagedPref(prefs::kURLsToRestoreOnStartup, url_pref_list2); diff --git a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc index 8a0aa91..0d323bb 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc @@ -241,9 +241,9 @@ TEST_F(CloudPrintProxyPolicyTest, StartWithNoPolicyProxyDisabled) { MockServiceProcessControl::kServiceStateDisabled, false); TestingPrefServiceSyncable* prefs = profile_.GetTestingPrefService(); - prefs->SetUserPref(prefs::kCloudPrintEmail, - base::Value::CreateStringValue( - MockServiceProcessControl::EnabledUserId())); + prefs->SetUserPref( + prefs::kCloudPrintEmail, + new base::StringValue(MockServiceProcessControl::EnabledUserId())); service.Initialize(); @@ -258,7 +258,7 @@ TEST_F(CloudPrintProxyPolicyTest, StartWithNoPolicyProxyEnabled) { TestingPrefServiceSyncable* prefs = profile_.GetTestingPrefService(); prefs->SetUserPref(prefs::kCloudPrintEmail, - base::Value::CreateStringValue(std::string())); + new base::StringValue(std::string())); service.Initialize(); service.RefreshStatusFromService(); @@ -275,7 +275,7 @@ TEST_F(CloudPrintProxyPolicyTest, StartWithPolicySetProxyDisabled) { TestingPrefServiceSyncable* prefs = profile_.GetTestingPrefService(); prefs->SetUserPref(prefs::kCloudPrintEmail, - base::Value::CreateStringValue(std::string())); + new base::StringValue(std::string())); prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled, new base::FundamentalValue(false)); @@ -293,7 +293,7 @@ TEST_F(CloudPrintProxyPolicyTest, StartWithPolicySetProxyEnabled) { TestingPrefServiceSyncable* prefs = profile_.GetTestingPrefService(); prefs->SetUserPref(prefs::kCloudPrintEmail, - base::Value::CreateStringValue(std::string())); + new base::StringValue(std::string())); prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled, new base::FundamentalValue(false)); @@ -309,9 +309,9 @@ TEST_F(CloudPrintProxyPolicyTest, StartWithNoPolicyProxyDisabledThenSetPolicy) { MockServiceProcessControl::kServiceStateDisabled, false); TestingPrefServiceSyncable* prefs = profile_.GetTestingPrefService(); - prefs->SetUserPref(prefs::kCloudPrintEmail, - base::Value::CreateStringValue( - MockServiceProcessControl::EnabledUserId())); + prefs->SetUserPref( + prefs::kCloudPrintEmail, + new base::StringValue(MockServiceProcessControl::EnabledUserId())); service.Initialize(); @@ -331,7 +331,7 @@ TEST_F(CloudPrintProxyPolicyTest, StartWithNoPolicyProxyEnabledThenSetPolicy) { TestingPrefServiceSyncable* prefs = profile_.GetTestingPrefService(); prefs->SetUserPref(prefs::kCloudPrintEmail, - base::Value::CreateStringValue(std::string())); + new base::StringValue(std::string())); service.Initialize(); service.RefreshStatusFromService(); @@ -355,7 +355,7 @@ TEST_F(CloudPrintProxyPolicyTest, TestingPrefServiceSyncable* prefs = profile_.GetTestingPrefService(); prefs->SetUserPref(prefs::kCloudPrintEmail, - base::Value::CreateStringValue(std::string())); + new base::StringValue(std::string())); prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled, new base::FundamentalValue(false)); @@ -376,7 +376,7 @@ TEST_F(CloudPrintProxyPolicyTest, TestingPrefServiceSyncable* prefs = profile_.GetTestingPrefService(); prefs->SetUserPref(prefs::kCloudPrintEmail, - base::Value::CreateStringValue(std::string())); + new base::StringValue(std::string())); prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled, new base::FundamentalValue(false)); @@ -394,9 +394,9 @@ TEST_F(CloudPrintProxyPolicyTest, StartWithNoPolicyProxyDisabledThenEnable) { MockServiceProcessControl::kServiceStateDisabled, false); TestingPrefServiceSyncable* prefs = profile_.GetTestingPrefService(); - prefs->SetUserPref(prefs::kCloudPrintEmail, - base::Value::CreateStringValue( - MockServiceProcessControl::EnabledUserId())); + prefs->SetUserPref( + prefs::kCloudPrintEmail, + new base::StringValue(MockServiceProcessControl::EnabledUserId())); service.Initialize(); EXPECT_EQ(std::string(), prefs->GetString(prefs::kCloudPrintEmail)); @@ -418,7 +418,7 @@ TEST_F(CloudPrintProxyPolicyTest, TestingPrefServiceSyncable* prefs = profile_.GetTestingPrefService(); prefs->SetUserPref(prefs::kCloudPrintEmail, - base::Value::CreateStringValue(std::string())); + new base::StringValue(std::string())); prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled, new base::FundamentalValue(false)); @@ -454,7 +454,7 @@ KeyedService* TestCloudPrintProxyServiceFactory( TEST_F(CloudPrintProxyPolicyTest, StartupBrowserCreatorWithCommandLine) { TestingPrefServiceSyncable* prefs = profile_.GetTestingPrefService(); prefs->SetUserPref(prefs::kCloudPrintEmail, - base::Value::CreateStringValue(std::string())); + new base::StringValue(std::string())); prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled, new base::FundamentalValue(false)); diff --git a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc index 063ba5e..e03d85c 100644 --- a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc +++ b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc @@ -552,9 +552,9 @@ TEST_F(CloudPrintProxyPolicyStartupTest, StartBrowserWithoutPolicy) { SetTestingFactory(profile, CloudPrintProxyServiceFactoryForPolicyTest); TestingPrefServiceSyncable* prefs = profile->GetTestingPrefService(); - prefs->SetUserPref(prefs::kCloudPrintEmail, - base::Value::CreateStringValue( - MockServiceIPCServer::EnabledUserId())); + prefs->SetUserPref( + prefs::kCloudPrintEmail, + new base::StringValue(MockServiceIPCServer::EnabledUserId())); CommandLine command_line(CommandLine::NO_PROGRAM); command_line.AppendSwitch(switches::kCheckCloudPrintConnectorPolicy); @@ -600,9 +600,9 @@ TEST_F(CloudPrintProxyPolicyStartupTest, StartBrowserWithPolicy) { SetTestingFactory(profile, CloudPrintProxyServiceFactoryForPolicyTest); TestingPrefServiceSyncable* prefs = profile->GetTestingPrefService(); - prefs->SetUserPref(prefs::kCloudPrintEmail, - base::Value::CreateStringValue( - MockServiceIPCServer::EnabledUserId())); + prefs->SetUserPref( + prefs::kCloudPrintEmail, + new base::StringValue(MockServiceIPCServer::EnabledUserId())); prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled, new base::FundamentalValue(false)); diff --git a/chrome/browser/sync/test/integration/multiple_client_preferences_sync_test.cc b/chrome/browser/sync/test/integration/multiple_client_preferences_sync_test.cc index 0f67cbf..a119627 100644 --- a/chrome/browser/sync/test/integration/multiple_client_preferences_sync_test.cc +++ b/chrome/browser/sync/test/integration/multiple_client_preferences_sync_test.cc @@ -30,7 +30,7 @@ IN_PROC_BROWSER_TEST_F(MultipleClientPreferencesSyncTest, Sanity) { for (int i = 0; i < num_clients(); ++i) { base::ListValue urls; - urls.Append(base::Value::CreateStringValue( + urls.Append(new base::StringValue( base::StringPrintf("http://www.google.com/%d", i))); ChangeListPref(i, prefs::kURLsToRestoreOnStartup, urls); } diff --git a/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc b/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc index e544e8a..85a22fa 100644 --- a/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc @@ -88,8 +88,8 @@ IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, ComplexPrefs) { ASSERT_TRUE(AwaitIntegerPrefMatches(prefs::kRestoreOnStartup)); base::ListValue urls; - urls.Append(base::Value::CreateStringValue("http://www.google.com/")); - urls.Append(base::Value::CreateStringValue("http://www.flickr.com/")); + urls.Append(new base::StringValue("http://www.google.com/")); + urls.Append(new base::StringValue("http://www.flickr.com/")); ChangeIntegerPref(0, prefs::kRestoreOnStartup, 4); ChangeListPref(0, prefs::kURLsToRestoreOnStartup, urls); ASSERT_TRUE(AwaitIntegerPrefMatches(prefs::kRestoreOnStartup)); diff --git a/chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc b/chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc index ae70cbb..7484e7cc 100644 --- a/chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc +++ b/chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc @@ -290,7 +290,7 @@ TEST_F(ExtensionAppModelBuilderTest, InvalidOrdinal) { scoped_prefs->UpdateExtensionPref( kHostedAppId, "page_ordinal", - base::Value::CreateStringValue("a corrupted ordinal")); + new base::StringValue("a corrupted ordinal")); // This should not assert or crash. CreateBuilder(); diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc index 10cd110..74e3d62 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc @@ -322,7 +322,7 @@ class ChromeLauncherControllerTest : public BrowserWithTestWindowTest { manifest_gmail.SetString(extensions::manifest_keys::kLaunchWebURL, kGmailLaunchURL); base::ListValue* list = new base::ListValue(); - list->Append(base::Value::CreateStringValue("*://mail.google.com/mail/ca")); + list->Append(new base::StringValue("*://mail.google.com/mail/ca")); manifest_gmail.Set(extensions::manifest_keys::kWebURLs, list); extension3_ = Extension::Create(base::FilePath(), Manifest::UNPACKED, diff --git a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc index 6601490..5697f8c 100644 --- a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc +++ b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc @@ -1411,8 +1411,8 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorFirstRunTest, SessionStartupPref::kPrefValueURLs), NULL); base::ListValue startup_urls; - startup_urls.Append(base::Value::CreateStringValue( - test_server()->GetURL("files/title1.html").spec())); + startup_urls.Append( + new base::StringValue(test_server()->GetURL("files/title1.html").spec())); policy_map_.Set(policy::key::kRestoreOnStartupURLs, policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, startup_urls.DeepCopy(), NULL); diff --git a/chrome/browser/ui/webui/bidi_checker_web_ui_test.cc b/chrome/browser/ui/webui/bidi_checker_web_ui_test.cc index d080707..c218780 100644 --- a/chrome/browser/ui/webui/bidi_checker_web_ui_test.cc +++ b/chrome/browser/ui/webui/bidi_checker_web_ui_test.cc @@ -102,7 +102,7 @@ void WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage( const std::string& page_url, bool is_rtl) { ui_test_utils::NavigateToURL(browser(), GURL(page_url)); ASSERT_TRUE(RunJavascriptTest("runBidiChecker", - base::Value::CreateStringValue(page_url), + new base::StringValue(page_url), new base::FundamentalValue(is_rtl))); } diff --git a/chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.cc b/chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.cc index a7c84af..d084879 100644 --- a/chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.cc +++ b/chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.cc @@ -180,7 +180,7 @@ void NetInternalsTest::MessageHandler::GetTestServerURL( std::string path; ASSERT_TRUE(list_value->GetString(0, &path)); GURL url = net_internals_test_->test_server()->GetURL(path); - scoped_ptr<base::Value> url_value(base::Value::CreateStringValue(url.spec())); + scoped_ptr<base::Value> url_value(new base::StringValue(url.spec())); RunJavascriptCallback(url_value.get()); } diff --git a/chrome/browser/ui/webui/options/certificate_manager_browsertest.cc b/chrome/browser/ui/webui/options/certificate_manager_browsertest.cc index e86b312..7ff81a6 100644 --- a/chrome/browser/ui/webui/options/certificate_manager_browsertest.cc +++ b/chrome/browser/ui/webui/options/certificate_manager_browsertest.cc @@ -50,7 +50,7 @@ class CertificateManagerBrowserTest : public options::OptionsUIBrowserTest { policy.Set(policy::key::kOpenNetworkConfiguration, policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, - base::Value::CreateStringValue(user_policy_blob), + new base::StringValue(user_policy_blob), NULL); provider_.UpdateChromePolicy(policy); content::RunAllPendingInMessageLoop(); diff --git a/chrome/browser/ui/webui/policy_ui_browsertest.cc b/chrome/browser/ui/webui/policy_ui_browsertest.cc index e80dc08..efb16df 100644 --- a/chrome/browser/ui/webui/policy_ui_browsertest.cc +++ b/chrome/browser/ui/webui/policy_ui_browsertest.cc @@ -198,9 +198,9 @@ IN_PROC_BROWSER_TEST_F(PolicyUITest, SendPolicyValues) { // Set the values of four existing policies. base::ListValue* restore_on_startup_urls = new base::ListValue; - restore_on_startup_urls->Append(base::Value::CreateStringValue("aaa")); - restore_on_startup_urls->Append(base::Value::CreateStringValue("bbb")); - restore_on_startup_urls->Append(base::Value::CreateStringValue("ccc")); + restore_on_startup_urls->Append(new base::StringValue("aaa")); + restore_on_startup_urls->Append(new base::StringValue("bbb")); + restore_on_startup_urls->Append(new base::StringValue("ccc")); values.Set(policy::key::kRestoreOnStartupURLs, policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, @@ -210,7 +210,7 @@ IN_PROC_BROWSER_TEST_F(PolicyUITest, SendPolicyValues) { values.Set(policy::key::kHomepageLocation, policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_MACHINE, - base::Value::CreateStringValue("http://google.com"), + new base::StringValue("http://google.com"), NULL); expected_values[policy::key::kHomepageLocation] = "http://google.com"; values.Set(policy::key::kRestoreOnStartup, diff --git a/chrome/common/extensions/permissions/permission_set_unittest.cc b/chrome/common/extensions/permissions/permission_set_unittest.cc index b56a98e..d1c1b7f 100644 --- a/chrome/common/extensions/permissions/permission_set_unittest.cc +++ b/chrome/common/extensions/permissions/permission_set_unittest.cc @@ -258,10 +258,9 @@ TEST(PermissionsTest, CreateUnion) { permission = permission_info->CreateAPIPermission(); { scoped_ptr<base::ListValue> value(new base::ListValue()); - value->Append( - base::Value::CreateStringValue("tcp-connect:*.example.com:80")); - value->Append(base::Value::CreateStringValue("udp-bind::8080")); - value->Append(base::Value::CreateStringValue("udp-send-to::8888")); + value->Append(new base::StringValue("tcp-connect:*.example.com:80")); + value->Append(new base::StringValue("udp-bind::8080")); + value->Append(new base::StringValue("udp-send-to::8888")); ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL)); } @@ -304,9 +303,8 @@ TEST(PermissionsTest, CreateUnion) { permission = permission_info->CreateAPIPermission(); { scoped_ptr<base::ListValue> value(new base::ListValue()); - value->Append( - base::Value::CreateStringValue("tcp-connect:*.example.com:80")); - value->Append(base::Value::CreateStringValue("udp-send-to::8899")); + value->Append(new base::StringValue("tcp-connect:*.example.com:80")); + value->Append(new base::StringValue("udp-send-to::8899")); ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL)); } apis2.insert(permission); @@ -319,11 +317,10 @@ TEST(PermissionsTest, CreateUnion) { permission = permission_info->CreateAPIPermission(); { scoped_ptr<base::ListValue> value(new base::ListValue()); - value->Append( - base::Value::CreateStringValue("tcp-connect:*.example.com:80")); - value->Append(base::Value::CreateStringValue("udp-bind::8080")); - value->Append(base::Value::CreateStringValue("udp-send-to::8888")); - value->Append(base::Value::CreateStringValue("udp-send-to::8899")); + value->Append(new base::StringValue("tcp-connect:*.example.com:80")); + value->Append(new base::StringValue("udp-bind::8080")); + value->Append(new base::StringValue("udp-send-to::8888")); + value->Append(new base::StringValue("udp-send-to::8899")); ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL)); } // Insert a new permission socket permisssion which will replace the old one. @@ -387,10 +384,9 @@ TEST(PermissionsTest, CreateIntersection) { permission = permission_info->CreateAPIPermission(); { scoped_ptr<base::ListValue> value(new base::ListValue()); - value->Append( - base::Value::CreateStringValue("tcp-connect:*.example.com:80")); - value->Append(base::Value::CreateStringValue("udp-bind::8080")); - value->Append(base::Value::CreateStringValue("udp-send-to::8888")); + value->Append(new base::StringValue("tcp-connect:*.example.com:80")); + value->Append(new base::StringValue("udp-bind::8080")); + value->Append(new base::StringValue("udp-send-to::8888")); ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL)); } apis1.insert(permission); @@ -425,9 +421,9 @@ TEST(PermissionsTest, CreateIntersection) { permission = permission_info->CreateAPIPermission(); { scoped_ptr<base::ListValue> value(new base::ListValue()); - value->Append(base::Value::CreateStringValue("udp-bind::8080")); - value->Append(base::Value::CreateStringValue("udp-send-to::8888")); - value->Append(base::Value::CreateStringValue("udp-send-to::8899")); + value->Append(new base::StringValue("udp-bind::8080")); + value->Append(new base::StringValue("udp-send-to::8888")); + value->Append(new base::StringValue("udp-send-to::8899")); ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL)); } apis2.insert(permission); @@ -436,8 +432,8 @@ TEST(PermissionsTest, CreateIntersection) { permission = permission_info->CreateAPIPermission(); { scoped_ptr<base::ListValue> value(new base::ListValue()); - value->Append(base::Value::CreateStringValue("udp-bind::8080")); - value->Append(base::Value::CreateStringValue("udp-send-to::8888")); + value->Append(new base::StringValue("udp-bind::8080")); + value->Append(new base::StringValue("udp-send-to::8888")); ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL)); } expected_apis.insert(permission); @@ -500,10 +496,9 @@ TEST(PermissionsTest, CreateDifference) { permission = permission_info->CreateAPIPermission(); { scoped_ptr<base::ListValue> value(new base::ListValue()); - value->Append( - base::Value::CreateStringValue("tcp-connect:*.example.com:80")); - value->Append(base::Value::CreateStringValue("udp-bind::8080")); - value->Append(base::Value::CreateStringValue("udp-send-to::8888")); + value->Append(new base::StringValue("tcp-connect:*.example.com:80")); + value->Append(new base::StringValue("udp-bind::8080")); + value->Append(new base::StringValue("udp-send-to::8888")); ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL)); } apis1.insert(permission); @@ -526,9 +521,8 @@ TEST(PermissionsTest, CreateDifference) { permission = permission_info->CreateAPIPermission(); { scoped_ptr<base::ListValue> value(new base::ListValue()); - value->Append( - base::Value::CreateStringValue("tcp-connect:*.example.com:80")); - value->Append(base::Value::CreateStringValue("udp-send-to::8899")); + value->Append(new base::StringValue("tcp-connect:*.example.com:80")); + value->Append(new base::StringValue("udp-send-to::8899")); ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL)); } apis2.insert(permission); @@ -537,8 +531,8 @@ TEST(PermissionsTest, CreateDifference) { permission = permission_info->CreateAPIPermission(); { scoped_ptr<base::ListValue> value(new base::ListValue()); - value->Append(base::Value::CreateStringValue("udp-bind::8080")); - value->Append(base::Value::CreateStringValue("udp-send-to::8888")); + value->Append(new base::StringValue("udp-bind::8080")); + value->Append(new base::StringValue("udp-send-to::8888")); ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL)); } expected_apis.insert(permission); diff --git a/chrome/renderer/chrome_content_renderer_client_unittest.cc b/chrome/renderer/chrome_content_renderer_client_unittest.cc index 48aa0fc..6e6876c 100644 --- a/chrome/renderer/chrome_content_renderer_client_unittest.cc +++ b/chrome/renderer/chrome_content_renderer_client_unittest.cc @@ -98,7 +98,7 @@ scoped_refptr<const extensions::Extension> CreateTestExtension( manifest.SetInteger("manifest_version", 2); if (is_hosted_app) { base::ListValue* url_list = new base::ListValue(); - url_list->Append(base::Value::CreateStringValue(app_url)); + url_list->Append(new base::StringValue(app_url)); manifest.Set(extensions::manifest_keys::kWebURLs, url_list); manifest.SetString(extensions::manifest_keys::kLaunchWebURL, app_url); } diff --git a/chrome/test/chromedriver/alert_commands.cc b/chrome/test/chromedriver/alert_commands.cc index 199e7bc..f75e440 100644 --- a/chrome/test/chromedriver/alert_commands.cc +++ b/chrome/test/chromedriver/alert_commands.cc @@ -59,7 +59,7 @@ Status ExecuteGetAlertText( web_view->GetJavaScriptDialogManager()->GetDialogMessage(&message); if (status.IsError()) return status; - value->reset(base::Value::CreateStringValue(message)); + value->reset(new base::StringValue(message)); return Status(kOk); } diff --git a/chromeos/network/network_configuration_handler_unittest.cc b/chromeos/network/network_configuration_handler_unittest.cc index e0161b6..dcc47f0 100644 --- a/chromeos/network/network_configuration_handler_unittest.cc +++ b/chromeos/network/network_configuration_handler_unittest.cc @@ -217,10 +217,10 @@ TEST_F(NetworkConfigurationHandlerTest, GetProperties) { std::string networkName = "MyNetwork"; std::string key = "SSID"; scoped_ptr<base::StringValue> networkNameValue( - base::Value::CreateStringValue(networkName)); + new base::StringValue(networkName)); base::DictionaryValue value; - value.Set(key, base::Value::CreateStringValue(networkName)); + value.Set(key, new base::StringValue(networkName)); dictionary_value_result_ = &value; EXPECT_CALL(*mock_service_client_, SetProperty(dbus::ObjectPath(service_path), key, @@ -251,10 +251,10 @@ TEST_F(NetworkConfigurationHandlerTest, SetProperties) { std::string networkName = "MyNetwork"; std::string key = "SSID"; scoped_ptr<base::StringValue> networkNameValue( - base::Value::CreateStringValue(networkName)); + new base::StringValue(networkName)); base::DictionaryValue value; - value.Set(key, base::Value::CreateStringValue(networkName)); + value.Set(key, new base::StringValue(networkName)); dictionary_value_result_ = &value; EXPECT_CALL(*mock_service_client_, SetProperties(_, _, _, _)).WillOnce( @@ -273,11 +273,11 @@ TEST_F(NetworkConfigurationHandlerTest, ClearProperties) { std::string networkName = "MyNetwork"; std::string key = "SSID"; scoped_ptr<base::StringValue> networkNameValue( - base::Value::CreateStringValue(networkName)); + new base::StringValue(networkName)); // First set up a value to clear. base::DictionaryValue value; - value.Set(key, base::Value::CreateStringValue(networkName)); + value.Set(key, new base::StringValue(networkName)); dictionary_value_result_ = &value; EXPECT_CALL(*mock_service_client_, SetProperties(_, _, _, _)).WillOnce( @@ -310,11 +310,11 @@ TEST_F(NetworkConfigurationHandlerTest, ClearPropertiesError) { std::string networkName = "MyNetwork"; std::string key = "SSID"; scoped_ptr<base::StringValue> networkNameValue( - base::Value::CreateStringValue(networkName)); + new base::StringValue(networkName)); // First set up a value to clear. base::DictionaryValue value; - value.Set(key, base::Value::CreateStringValue(networkName)); + value.Set(key, new base::StringValue(networkName)); dictionary_value_result_ = &value; EXPECT_CALL(*mock_service_client_, SetProperties(_, _, _, _)).WillOnce( @@ -351,9 +351,9 @@ TEST_F(NetworkConfigurationHandlerTest, CreateConfiguration) { base::DictionaryValue value; shill_property_util::SetSSID(networkName, &value); value.SetWithoutPathExpansion(shill::kTypeProperty, - base::Value::CreateStringValue(type)); + new base::StringValue(type)); value.SetWithoutPathExpansion(shill::kProfileProperty, - base::Value::CreateStringValue(profile)); + new base::StringValue(profile)); EXPECT_CALL(*mock_manager_client_, ConfigureServiceForProfile(dbus::ObjectPath(profile), _, _, _)) diff --git a/chromeos/network/onc/onc_translator_onc_to_shill.cc b/chromeos/network/onc/onc_translator_onc_to_shill.cc index f6b0117..2fd411f 100644 --- a/chromeos/network/onc/onc_translator_onc_to_shill.cc +++ b/chromeos/network/onc/onc_translator_onc_to_shill.cc @@ -31,7 +31,7 @@ scoped_ptr<base::StringValue> ConvertValueToString(const base::Value& value) { std::string str; if (!value.GetAsString(&str)) base::JSONWriter::Write(&value, &str); - return make_scoped_ptr(base::Value::CreateStringValue(str)); + return make_scoped_ptr(new base::StringValue(str)); } // This class is responsible to translate the local fields of the given diff --git a/chromeos/network/onc/onc_translator_shill_to_onc.cc b/chromeos/network/onc/onc_translator_shill_to_onc.cc index 3c00e40..a3651f6 100644 --- a/chromeos/network/onc/onc_translator_shill_to_onc.cc +++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc @@ -30,7 +30,7 @@ scoped_ptr<base::Value> ConvertStringToValue(const std::string& str, base::Value::Type type) { base::Value* value; if (type == base::Value::TYPE_STRING) { - value = base::Value::CreateStringValue(str); + value = new base::StringValue(str); } else { value = base::JSONReader::Read(str); } diff --git a/chromeos/network/shill_property_handler_unittest.cc b/chromeos/network/shill_property_handler_unittest.cc index e807531..cb82890 100644 --- a/chromeos/network/shill_property_handler_unittest.cc +++ b/chromeos/network/shill_property_handler_unittest.cc @@ -432,8 +432,8 @@ TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerIPConfigPropertyChanged) { shill::kAddressProperty, ip_address, base::Bind(&DoNothingWithCallStatus)); base::ListValue dns_servers; - dns_servers.Append(base::Value::CreateStringValue("192.168.1.100")); - dns_servers.Append(base::Value::CreateStringValue("192.168.1.101")); + dns_servers.Append(new base::StringValue("192.168.1.100")); + dns_servers.Append(new base::StringValue("192.168.1.101")); DBusThreadManager::Get()->GetShillIPConfigClient()->SetProperty( dbus::ObjectPath(kTestIPConfigPath), shill::kNameServersProperty, dns_servers, diff --git a/components/metrics/persisted_logs.cc b/components/metrics/persisted_logs.cc index 17d6aa7..7213b59 100644 --- a/components/metrics/persisted_logs.cc +++ b/components/metrics/persisted_logs.cc @@ -41,7 +41,7 @@ bool ReadBase64String(const base::ListValue& list_value, void AppendBase64String(const std::string& str, base::ListValue* list_value) { std::string base64_str; base::Base64Encode(str, &base64_str); - list_value->Append(base::Value::CreateStringValue(base64_str)); + list_value->AppendString(base64_str); } } // namespace diff --git a/components/policy/core/browser/configuration_policy_handler_unittest.cc b/components/policy/core/browser/configuration_policy_handler_unittest.cc index 36c9c2a..db30b0f 100644 --- a/components/policy/core/browser/configuration_policy_handler_unittest.cc +++ b/components/policy/core/browser/configuration_policy_handler_unittest.cc @@ -79,9 +79,11 @@ TEST(StringToIntEnumListPolicyHandlerTest, CheckPolicySettings) { EXPECT_FALSE(errors.empty()); EXPECT_FALSE(errors.GetErrors(kTestPolicy).empty()); - policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, + policy_map.Set(kTestPolicy, + POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("no list"), NULL); + new base::StringValue("no list"), + NULL); errors.Clear(); EXPECT_FALSE(handler.CheckPolicySettings(policy_map, &errors)); EXPECT_FALSE(errors.empty()); @@ -180,8 +182,10 @@ TEST(IntRangePolicyHandler, CheckPolicySettingsClamp) { // Check that an entirely invalid value is rejected and yields an error // message. policy_map.Set(kTestPolicy, - POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("invalid"), NULL); + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("invalid"), + NULL); errors.Clear(); EXPECT_FALSE(handler.CheckPolicySettings(policy_map, &errors)); EXPECT_FALSE(errors.empty()); @@ -245,8 +249,11 @@ TEST(IntRangePolicyHandler, CheckPolicySettingsDontClamp) { // Check that an entirely invalid value is rejected and yields an error // message. - policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("invalid"), NULL); + policy_map.Set(kTestPolicy, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("invalid"), + NULL); errors.Clear(); EXPECT_FALSE(handler.CheckPolicySettings(policy_map, &errors)); EXPECT_FALSE(errors.empty()); @@ -425,8 +432,11 @@ TEST(IntPercentageToDoublePolicyHandler, CheckPolicySettingsClamp) { // Check that an entirely invalid value is rejected and yields an error // message. - policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("invalid"), NULL); + policy_map.Set(kTestPolicy, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("invalid"), + NULL); errors.Clear(); EXPECT_FALSE(handler.CheckPolicySettings(policy_map, &errors)); EXPECT_FALSE(errors.empty()); @@ -491,8 +501,11 @@ TEST(IntPercentageToDoublePolicyHandler, CheckPolicySettingsDontClamp) { // Check that an entirely invalid value is rejected and yields an error // message. - policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("invalid"), NULL); + policy_map.Set(kTestPolicy, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("invalid"), + NULL); errors.Clear(); EXPECT_FALSE(handler.CheckPolicySettings(policy_map, &errors)); EXPECT_FALSE(errors.empty()); diff --git a/components/policy/core/browser/configuration_policy_pref_store_unittest.cc b/components/policy/core/browser/configuration_policy_pref_store_unittest.cc index e307f98..35d91ee 100644 --- a/components/policy/core/browser/configuration_policy_pref_store_unittest.cc +++ b/components/policy/core/browser/configuration_policy_pref_store_unittest.cc @@ -52,8 +52,8 @@ TEST_F(ConfigurationPolicyPrefStoreListTest, GetDefault) { TEST_F(ConfigurationPolicyPrefStoreListTest, SetValue) { base::ListValue* in_value = new base::ListValue(); - in_value->Append(base::Value::CreateStringValue("test1")); - in_value->Append(base::Value::CreateStringValue("test2,")); + in_value->Append(new base::StringValue("test1")); + in_value->Append(new base::StringValue("test2,")); PolicyMap policy; policy.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, in_value, NULL); @@ -80,9 +80,11 @@ TEST_F(ConfigurationPolicyPrefStoreStringTest, GetDefault) { TEST_F(ConfigurationPolicyPrefStoreStringTest, SetValue) { PolicyMap policy; - policy.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, + policy.Set(kTestPolicy, + POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("http://chromium.org"), NULL); + new base::StringValue("http://chromium.org"), + NULL); UpdateProviderPolicy(policy); const base::Value* value = NULL; EXPECT_TRUE(store_->GetValue(kTestPref, &value)); @@ -189,7 +191,7 @@ TEST_F(ConfigurationPolicyPrefStoreRefreshTest, Refresh) { policy.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("http://www.chromium.org"), + new base::StringValue("http://www.chromium.org"), NULL); UpdateProviderPolicy(policy); observer_.VerifyAndResetChangedKey(kTestPref); diff --git a/components/policy/core/common/async_policy_provider_unittest.cc b/components/policy/core/common/async_policy_provider_unittest.cc index 329697f..6a9aaff 100644 --- a/components/policy/core/common/async_policy_provider_unittest.cc +++ b/components/policy/core/common/async_policy_provider_unittest.cc @@ -33,7 +33,7 @@ void SetPolicy(PolicyBundle* bundle, .Set(name, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(value), + new base::StringValue(value), NULL); } diff --git a/components/policy/core/common/cloud/cloud_policy_manager_unittest.cc b/components/policy/core/common/cloud/cloud_policy_manager_unittest.cc index 74a84d5..9dab86b 100644 --- a/components/policy/core/common/cloud/cloud_policy_manager_unittest.cc +++ b/components/policy/core/common/cloud/cloud_policy_manager_unittest.cc @@ -89,8 +89,11 @@ void TestHarness::InstallEmptyPolicy() {} void TestHarness::InstallStringPolicy(const std::string& policy_name, const std::string& policy_value) { - store_.policy_map_.Set(policy_name, policy_level(), policy_scope(), - base::Value::CreateStringValue(policy_value), NULL); + store_.policy_map_.Set(policy_name, + policy_level(), + policy_scope(), + new base::StringValue(policy_value), + NULL); } void TestHarness::InstallIntegerPolicy(const std::string& policy_name, @@ -176,8 +179,11 @@ class CloudPolicyManagerTest : public testing::Test { virtual void SetUp() OVERRIDE { // Set up a policy map for testing. - policy_map_.Set("key", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("value"), NULL); + policy_map_.Set("key", + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("value"), + NULL); expected_bundle_.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) .CopyFrom(policy_map_); diff --git a/components/policy/core/common/cloud/component_cloud_policy_service_unittest.cc b/components/policy/core/common/cloud/component_cloud_policy_service_unittest.cc index 60699a0..6908620 100644 --- a/components/policy/core/common/cloud/component_cloud_policy_service_unittest.cc +++ b/components/policy/core/common/cloud/component_cloud_policy_service_unittest.cc @@ -134,10 +134,16 @@ class ComponentCloudPolicyServiceTest : public testing::Test { builder_.payload().set_download_url(kTestDownload); builder_.payload().set_secure_hash(crypto::SHA256HashString(kTestPolicy)); - expected_policy_.Set("Name", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("disabled"), NULL); - expected_policy_.Set("Second", POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER, - base::Value::CreateStringValue("maybe"), NULL); + expected_policy_.Set("Name", + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("disabled"), + NULL); + expected_policy_.Set("Second", + POLICY_LEVEL_RECOMMENDED, + POLICY_SCOPE_USER, + new base::StringValue("maybe"), + NULL); } virtual void TearDown() OVERRIDE { @@ -550,8 +556,10 @@ TEST_F(ComponentCloudPolicyServiceTest, LoadInvalidPolicyFromCache) { PolicyBundle expected_bundle; const PolicyNamespace ns(POLICY_DOMAIN_EXTENSIONS, kTestExtension); - expected_bundle.Get(ns).Set("Name", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("published"), + expected_bundle.Get(ns).Set("Name", + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("published"), NULL); EXPECT_TRUE(service_->policy().Equals(expected_bundle)); } diff --git a/components/policy/core/common/cloud/component_cloud_policy_store_unittest.cc b/components/policy/core/common/cloud/component_cloud_policy_store_unittest.cc index 2f8d1ea..a49b76c 100644 --- a/components/policy/core/common/cloud/component_cloud_policy_store_unittest.cc +++ b/components/policy/core/common/cloud/component_cloud_policy_store_unittest.cc @@ -85,10 +85,16 @@ class ComponentCloudPolicyStoreTest : public testing::Test { PolicyNamespace ns(POLICY_DOMAIN_EXTENSIONS, kTestExtension); PolicyMap& policy = expected_bundle_.Get(ns); - policy.Set("Name", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("disabled"), NULL); - policy.Set("Second", POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER, - base::Value::CreateStringValue("maybe"), NULL); + policy.Set("Name", + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("disabled"), + NULL); + policy.Set("Second", + POLICY_LEVEL_RECOMMENDED, + POLICY_SCOPE_USER, + new base::StringValue("maybe"), + NULL); } // Returns true if the policy exposed by the |store_| is empty. diff --git a/components/policy/core/common/cloud/component_cloud_policy_updater_unittest.cc b/components/policy/core/common/cloud/component_cloud_policy_updater_unittest.cc index 5463747..09e2bd4d 100644 --- a/components/policy/core/common/cloud/component_cloud_policy_updater_unittest.cc +++ b/components/policy/core/common/cloud/component_cloud_policy_updater_unittest.cc @@ -108,10 +108,16 @@ void ComponentCloudPolicyUpdaterTest::SetUp() { PolicyNamespace ns(POLICY_DOMAIN_EXTENSIONS, kTestExtension); PolicyMap& policy = expected_bundle_.Get(ns); - policy.Set("Name", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("disabled"), NULL); - policy.Set("Second", POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER, - base::Value::CreateStringValue("maybe"), NULL); + policy.Set("Name", + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("disabled"), + NULL); + policy.Set("Second", + POLICY_LEVEL_RECOMMENDED, + POLICY_SCOPE_USER, + new base::StringValue("maybe"), + NULL); } void ComponentCloudPolicyUpdaterTest::TearDown() { diff --git a/components/policy/core/common/cloud/user_cloud_policy_manager_unittest.cc b/components/policy/core/common/cloud/user_cloud_policy_manager_unittest.cc index 0602b28..86d5829 100644 --- a/components/policy/core/common/cloud/user_cloud_policy_manager_unittest.cc +++ b/components/policy/core/common/cloud/user_cloud_policy_manager_unittest.cc @@ -33,8 +33,11 @@ class UserCloudPolicyManagerTest : public testing::Test { virtual void SetUp() OVERRIDE { // Set up a policy map for testing. - policy_map_.Set("key", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("value"), NULL); + policy_map_.Set("key", + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("value"), + NULL); expected_bundle_.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) .CopyFrom(policy_map_); } diff --git a/components/policy/core/common/configuration_policy_provider_test.cc b/components/policy/core/common/configuration_policy_provider_test.cc index 5d87cb3..74c9cc1 100644 --- a/components/policy/core/common/configuration_policy_provider_test.cc +++ b/components/policy/core/common/configuration_policy_provider_test.cc @@ -272,8 +272,8 @@ TEST_P(ConfigurationPolicyProviderTest, IntegerValue) { TEST_P(ConfigurationPolicyProviderTest, StringListValue) { base::ListValue expected_value; - expected_value.Set(0U, base::Value::CreateStringValue("first")); - expected_value.Set(1U, base::Value::CreateStringValue("second")); + expected_value.Set(0U, new base::StringValue("first")); + expected_value.Set(1U, new base::StringValue("second")); CheckValue(test_keys::kKeyStringList, expected_value, base::Bind(&PolicyProviderTestHarness::InstallStringListPolicy, @@ -290,8 +290,8 @@ TEST_P(ConfigurationPolicyProviderTest, DictionaryValue) { expected_value.SetString("string", "omg"); base::ListValue* list = new base::ListValue(); - list->Set(0U, base::Value::CreateStringValue("first")); - list->Set(1U, base::Value::CreateStringValue("second")); + list->Set(0U, new base::StringValue("first")); + list->Set(1U, new base::StringValue("second")); expected_value.Set("array", list); base::DictionaryValue* dict = new base::DictionaryValue(); @@ -341,7 +341,7 @@ TEST_P(ConfigurationPolicyProviderTest, RefreshPolicies) { .Set(test_keys::kKeyString, test_harness_->policy_level(), test_harness_->policy_scope(), - base::Value::CreateStringValue("value"), + new base::StringValue("value"), NULL); EXPECT_TRUE(provider_->policies().Equals(bundle)); provider_->RemoveObserver(&observer); @@ -383,7 +383,7 @@ TEST_P(Configuration3rdPartyPolicyProviderTest, Load3rdParty) { // help detecting memory leaks in the code paths that detect invalid input. policy_3rdparty.Set("invalid-domain.component", policy_dict.DeepCopy()); policy_3rdparty.Set("extensions.cccccccccccccccccccccccccccccccc", - base::Value::CreateStringValue("invalid-value")); + new base::StringValue("invalid-value")); test_harness_->Install3rdPartyPolicy(&policy_3rdparty); provider_->RefreshPolicies(); diff --git a/components/policy/core/common/forwarding_policy_provider_unittest.cc b/components/policy/core/common/forwarding_policy_provider_unittest.cc index 94bf0e5..0a8ae35 100644 --- a/components/policy/core/common/forwarding_policy_provider_unittest.cc +++ b/components/policy/core/common/forwarding_policy_provider_unittest.cc @@ -81,15 +81,21 @@ TEST_F(ForwardingPolicyProviderTest, Empty) { TEST_F(ForwardingPolicyProviderTest, ForwardsChromePolicy) { PolicyBundle bundle; const PolicyNamespace chrome_ns(POLICY_DOMAIN_CHROME, ""); - bundle.Get(chrome_ns).Set("policy", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("value"), NULL); + bundle.Get(chrome_ns).Set("policy", + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("value"), + NULL); EXPECT_CALL(observer_, OnUpdatePolicy(&forwarding_provider_)); scoped_ptr<PolicyBundle> delegate_bundle(new PolicyBundle); delegate_bundle->CopyFrom(bundle); delegate_bundle->Get(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, "xyz")) - .Set("foo", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("not forwarded"), NULL); + .Set("foo", + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("not forwarded"), + NULL); mock_provider_.UpdatePolicy(delegate_bundle.Pass()); Mock::VerifyAndClearExpectations(&observer_); @@ -116,8 +122,11 @@ TEST_F(ForwardingPolicyProviderTest, SchemaReady) { TEST_F(ForwardingPolicyProviderTest, SchemaReadyWithComponents) { PolicyMap policy_map; - policy_map.Set("foo", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("omg"), NULL); + policy_map.Set("foo", + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("omg"), + NULL); scoped_ptr<PolicyBundle> bundle(new PolicyBundle); bundle->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, "")).CopyFrom(policy_map); bundle->Get(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, "xyz")) @@ -162,8 +171,11 @@ TEST_F(ForwardingPolicyProviderTest, DelegateUpdates) { policy::POLICY_DOMAIN_EXTENSIONS)); PolicyMap policy_map; - policy_map.Set("foo", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("omg"), NULL); + policy_map.Set("foo", + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("omg"), + NULL); // Chrome policy updates are forwarded even if the components aren't ready. EXPECT_CALL(observer_, OnUpdatePolicy(&forwarding_provider_)); mock_provider_.UpdateChromePolicy(policy_map); @@ -202,8 +214,11 @@ TEST_F(ForwardingPolicyProviderTest, RemoveAndAddComponent) { // Serve policy for |ns|. PolicyBundle platform_policy; - platform_policy.Get(ns).Set("foo", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("omg"), NULL); + platform_policy.Get(ns).Set("foo", + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("omg"), + NULL); scoped_ptr<PolicyBundle> copy(new PolicyBundle); copy->CopyFrom(platform_policy); EXPECT_CALL(observer_, OnUpdatePolicy(_)); diff --git a/components/policy/core/common/mac_util.cc b/components/policy/core/common/mac_util.cc index eebb931..b1bea9d 100644 --- a/components/policy/core/common/mac_util.cc +++ b/components/policy/core/common/mac_util.cc @@ -71,7 +71,7 @@ scoped_ptr<base::Value> PropertyToValue(CFPropertyListRef property) { if (CFStringRef string = CFCast<CFStringRef>(property)) { return scoped_ptr<base::Value>( - base::Value::CreateStringValue(base::SysCFStringRefToUTF8(string))); + new base::StringValue(base::SysCFStringRefToUTF8(string))); } if (CFDictionaryRef dict = CFCast<CFDictionaryRef>(property)) { diff --git a/components/policy/core/common/policy_bundle_unittest.cc b/components/policy/core/common/policy_bundle_unittest.cc index 4f9a37e..747ead6 100644 --- a/components/policy/core/common/policy_bundle_unittest.cc +++ b/components/policy/core/common/policy_bundle_unittest.cc @@ -32,8 +32,11 @@ void AddTestPolicies(PolicyMap* policy) { POLICY_SCOPE_USER, new base::FundamentalValue(123), NULL); - policy->Set("mandatory-machine", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, - base::Value::CreateStringValue("omg"), NULL); + policy->Set("mandatory-machine", + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_MACHINE, + new base::StringValue("omg"), + NULL); policy->Set("recommended-user", POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER, diff --git a/components/policy/core/common/policy_loader_mac_unittest.cc b/components/policy/core/common/policy_loader_mac_unittest.cc index a7e3401..e2feecf 100644 --- a/components/policy/core/common/policy_loader_mac_unittest.cc +++ b/components/policy/core/common/policy_loader_mac_unittest.cc @@ -192,7 +192,7 @@ TEST_F(PolicyLoaderMacTest, TestNonForcedValue) { .Set(test_keys::kKeyString, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER, - base::Value::CreateStringValue("string value"), + new base::StringValue("string value"), NULL); EXPECT_TRUE(provider_->policies().Equals(expected_bundle)); } diff --git a/components/policy/core/common/policy_loader_win_unittest.cc b/components/policy/core/common/policy_loader_win_unittest.cc index 7ddc783..1c402e3 100644 --- a/components/policy/core/common/policy_loader_win_unittest.cc +++ b/components/policy/core/common/policy_loader_win_unittest.cc @@ -805,7 +805,8 @@ TEST_F(PolicyLoaderWinTest, HKLMOverHKCU) { .Set(test_keys::kKeyString, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, - base::Value::CreateStringValue("hklm"), NULL); + new base::StringValue("hklm"), + NULL); EXPECT_TRUE(Matches(expected)); } @@ -855,15 +856,26 @@ TEST_F(PolicyLoaderWinTest, Merge3rdPartyPolicies) { PolicyBundle expected; PolicyMap& expected_policy = expected.Get(ns); - expected_policy.Set("a", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, - base::Value::CreateStringValue(kMachineMandatory), NULL); - expected_policy.Set("b", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(kUserMandatory), NULL); - expected_policy.Set("c", POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_MACHINE, - base::Value::CreateStringValue(kMachineRecommended), + expected_policy.Set("a", + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_MACHINE, + new base::StringValue(kMachineMandatory), + NULL); + expected_policy.Set("b", + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kUserMandatory), + NULL); + expected_policy.Set("c", + POLICY_LEVEL_RECOMMENDED, + POLICY_SCOPE_MACHINE, + new base::StringValue(kMachineRecommended), + NULL); + expected_policy.Set("d", + POLICY_LEVEL_RECOMMENDED, + POLICY_SCOPE_USER, + new base::StringValue(kUserRecommended), NULL); - expected_policy.Set("d", POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER, - base::Value::CreateStringValue(kUserRecommended), NULL); EXPECT_TRUE(Matches(expected)); } diff --git a/components/policy/core/common/policy_map_unittest.cc b/components/policy/core/common/policy_map_unittest.cc index ad90c62..356cabc 100644 --- a/components/policy/core/common/policy_map_unittest.cc +++ b/components/policy/core/common/policy_map_unittest.cc @@ -51,10 +51,10 @@ scoped_ptr<ExternalDataFetcher> PolicyMapTest::CreateExternalDataFetcher( TEST_F(PolicyMapTest, SetAndGet) { PolicyMap map; - SetPolicy(&map, kTestPolicyName1, base::Value::CreateStringValue("aaa")); + SetPolicy(&map, kTestPolicyName1, new base::StringValue("aaa")); base::StringValue expected("aaa"); EXPECT_TRUE(expected.Equals(map.GetValue(kTestPolicyName1))); - SetPolicy(&map, kTestPolicyName1, base::Value::CreateStringValue("bbb")); + SetPolicy(&map, kTestPolicyName1, new base::StringValue("bbb")); base::StringValue expected_b("bbb"); EXPECT_TRUE(expected_b.Equals(map.GetValue(kTestPolicyName1))); SetPolicy(&map, kTestPolicyName1, @@ -78,13 +78,13 @@ TEST_F(PolicyMapTest, SetAndGet) { TEST_F(PolicyMapTest, Equals) { PolicyMap a; - SetPolicy(&a, kTestPolicyName1, base::Value::CreateStringValue("aaa")); + SetPolicy(&a, kTestPolicyName1, new base::StringValue("aaa")); PolicyMap a2; - SetPolicy(&a2, kTestPolicyName1, base::Value::CreateStringValue("aaa")); + SetPolicy(&a2, kTestPolicyName1, new base::StringValue("aaa")); PolicyMap b; - SetPolicy(&b, kTestPolicyName1, base::Value::CreateStringValue("bbb")); + SetPolicy(&b, kTestPolicyName1, new base::StringValue("bbb")); PolicyMap c; - SetPolicy(&c, kTestPolicyName1, base::Value::CreateStringValue("aaa")); + SetPolicy(&c, kTestPolicyName1, new base::StringValue("aaa")); SetPolicy(&c, kTestPolicyName2, new base::FundamentalValue(true)); PolicyMap d; SetPolicy(&d, kTestPolicyName1, @@ -129,11 +129,11 @@ TEST_F(PolicyMapTest, Equals) { TEST_F(PolicyMapTest, Swap) { PolicyMap a; - SetPolicy(&a, kTestPolicyName1, base::Value::CreateStringValue("aaa")); + SetPolicy(&a, kTestPolicyName1, new base::StringValue("aaa")); SetPolicy(&a, kTestPolicyName2, CreateExternalDataFetcher("dummy").release()); PolicyMap b; - SetPolicy(&b, kTestPolicyName1, base::Value::CreateStringValue("bbb")); + SetPolicy(&b, kTestPolicyName1, new base::StringValue("bbb")); SetPolicy(&b, kTestPolicyName3, new base::FundamentalValue(true)); a.Swap(&b); @@ -161,8 +161,11 @@ TEST_F(PolicyMapTest, Swap) { TEST_F(PolicyMapTest, MergeFrom) { PolicyMap a; - a.Set(kTestPolicyName1, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("google.com"), NULL); + a.Set(kTestPolicyName1, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("google.com"), + NULL); a.Set(kTestPolicyName2, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, @@ -177,12 +180,17 @@ TEST_F(PolicyMapTest, MergeFrom) { new base::FundamentalValue(false), NULL); a.Set(kTestPolicyName5, - POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_MACHINE, - base::Value::CreateStringValue("google.com/q={x}"), NULL); + POLICY_LEVEL_RECOMMENDED, + POLICY_SCOPE_MACHINE, + new base::StringValue("google.com/q={x}"), + NULL); PolicyMap b; - b.Set(kTestPolicyName1, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, - base::Value::CreateStringValue("chromium.org"), NULL); + b.Set(kTestPolicyName1, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_MACHINE, + new base::StringValue("chromium.org"), + NULL); b.Set(kTestPolicyName2, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, @@ -199,7 +207,7 @@ TEST_F(PolicyMapTest, MergeFrom) { b.Set(kTestPolicyName5, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, - base::Value::CreateStringValue(std::string()), + new base::StringValue(std::string()), NULL); b.Set(kTestPolicyName6, POLICY_LEVEL_RECOMMENDED, @@ -211,8 +219,11 @@ TEST_F(PolicyMapTest, MergeFrom) { PolicyMap c; // POLICY_SCOPE_MACHINE over POLICY_SCOPE_USER. - c.Set(kTestPolicyName1, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, - base::Value::CreateStringValue("chromium.org"), NULL); + c.Set(kTestPolicyName1, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_MACHINE, + new base::StringValue("chromium.org"), + NULL); // |a| has precedence over |b|. c.Set(kTestPolicyName2, POLICY_LEVEL_MANDATORY, @@ -232,7 +243,7 @@ TEST_F(PolicyMapTest, MergeFrom) { c.Set(kTestPolicyName5, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, - base::Value::CreateStringValue(std::string()), + new base::StringValue(std::string()), NULL); // Merge new ones. c.Set(kTestPolicyName6, @@ -246,8 +257,11 @@ TEST_F(PolicyMapTest, MergeFrom) { TEST_F(PolicyMapTest, GetDifferingKeys) { PolicyMap a; - a.Set(kTestPolicyName1, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("google.com"), NULL); + a.Set(kTestPolicyName1, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("google.com"), + NULL); a.Set(kTestPolicyName2, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, NULL, CreateExternalDataFetcher("dummy").release()); @@ -265,8 +279,10 @@ TEST_F(PolicyMapTest, GetDifferingKeys) { new base::FundamentalValue(false), NULL); a.Set(kTestPolicyName6, - POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_MACHINE, - base::Value::CreateStringValue("google.com/q={x}"), NULL); + POLICY_LEVEL_RECOMMENDED, + POLICY_SCOPE_MACHINE, + new base::StringValue("google.com/q={x}"), + NULL); a.Set(kTestPolicyName7, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, @@ -274,8 +290,11 @@ TEST_F(PolicyMapTest, GetDifferingKeys) { NULL); PolicyMap b; - b.Set(kTestPolicyName1, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("google.com"), NULL); + b.Set(kTestPolicyName1, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("google.com"), + NULL); b.Set(kTestPolicyName2, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, NULL, CreateExternalDataFetcher("dummy").release()); @@ -292,8 +311,10 @@ TEST_F(PolicyMapTest, GetDifferingKeys) { POLICY_SCOPE_USER, new base::FundamentalValue(false), NULL); - b.Set(kTestPolicyName6, POLICY_LEVEL_RECOMMENDED, - POLICY_SCOPE_USER, base::Value::CreateStringValue("google.com/q={x}"), + b.Set(kTestPolicyName6, + POLICY_LEVEL_RECOMMENDED, + POLICY_SCOPE_USER, + new base::StringValue("google.com/q={x}"), NULL); b.Set(kTestPolicyName8, POLICY_LEVEL_RECOMMENDED, diff --git a/components/policy/core/common/policy_provider_android_unittest.cc b/components/policy/core/common/policy_provider_android_unittest.cc index 7107316..2061508 100644 --- a/components/policy/core/common/policy_provider_android_unittest.cc +++ b/components/policy/core/common/policy_provider_android_unittest.cc @@ -20,7 +20,7 @@ void SetPolicy(PolicyBundle* bundle, .Set(name, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(value), + new base::StringValue(value), NULL); } diff --git a/components/policy/core/common/policy_service_impl_unittest.cc b/components/policy/core/common/policy_service_impl_unittest.cc index 6c3ac21..e814519 100644 --- a/components/policy/core/common/policy_service_impl_unittest.cc +++ b/components/policy/core/common/policy_service_impl_unittest.cc @@ -49,17 +49,22 @@ void AddTestPolicies(PolicyBundle* bundle, PolicyScope scope) { PolicyMap* policy_map = &bundle->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())); - policy_map->Set(kSameLevelPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(value), NULL); - policy_map->Set(kDiffLevelPolicy, level, scope, - base::Value::CreateStringValue(value), NULL); + policy_map->Set(kSameLevelPolicy, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(value), + NULL); + policy_map->Set( + kDiffLevelPolicy, level, scope, new base::StringValue(value), NULL); policy_map = &bundle->Get(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, kExtension)); - policy_map->Set(kSameLevelPolicy, POLICY_LEVEL_MANDATORY, - POLICY_SCOPE_USER, base::Value::CreateStringValue(value), + policy_map->Set(kSameLevelPolicy, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(value), NULL); - policy_map->Set(kDiffLevelPolicy, level, scope, - base::Value::CreateStringValue(value), NULL); + policy_map->Set( + kDiffLevelPolicy, level, scope, new base::StringValue(value), NULL); } // Observer class that changes the policy in the passed provider when the @@ -282,8 +287,11 @@ TEST_F(PolicyServiceTest, NotifyObserversInMultipleNamespaces) { NULL); PolicyMap policy_map; policy_map.CopyFrom(previous_policy_map); - policy_map.Set("policy", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("value"), NULL); + policy_map.Set("policy", + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("value"), + NULL); scoped_ptr<PolicyBundle> bundle(new PolicyBundle()); // The initial setup includes a policy for chrome that is now changing. @@ -321,8 +329,11 @@ TEST_F(PolicyServiceTest, NotifyObserversInMultipleNamespaces) { bundle.reset(new PolicyBundle()); bundle->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) .CopyFrom(policy_map); - policy_map.Set("policy", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("another value"), NULL); + policy_map.Set("policy", + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("another value"), + NULL); bundle->Get(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, kExtension1)) .CopyFrom(policy_map); bundle->Get(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, kExtension2)) @@ -574,12 +585,18 @@ TEST_F(PolicyServiceTest, NamespaceMerge) { PolicyMap expected; // For policies of the same level and scope, the first provider takes // precedence, on every namespace. - expected.Set(kSameLevelPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("bundle0"), NULL); + expected.Set(kSameLevelPolicy, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("bundle0"), + NULL); // For policies with different levels and scopes, the highest priority // level/scope combination takes precedence, on every namespace. - expected.Set(kDiffLevelPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, - base::Value::CreateStringValue("bundle2"), NULL); + expected.Set(kDiffLevelPolicy, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_MACHINE, + new base::StringValue("bundle2"), + NULL); EXPECT_TRUE(policy_service_->GetPolicies( PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())).Equals(expected)); EXPECT_TRUE(policy_service_->GetPolicies( @@ -682,10 +699,15 @@ TEST_F(PolicyServiceTest, FixDeprecatedPolicies) { // Both these policies should be ignored, since there's a higher priority // policy available. - policy_map.Set(key::kProxyMode, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER, - base::Value::CreateStringValue("pac_script"), NULL); - policy_map.Set(key::kProxyPacUrl, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER, - base::Value::CreateStringValue("http://example.com/wpad.dat"), + policy_map.Set(key::kProxyMode, + POLICY_LEVEL_RECOMMENDED, + POLICY_SCOPE_USER, + new base::StringValue("pac_script"), + NULL); + policy_map.Set(key::kProxyPacUrl, + POLICY_LEVEL_RECOMMENDED, + POLICY_SCOPE_USER, + new base::StringValue("http://example.com/wpad.dat"), NULL); // Add a value to a non-Chrome namespace. diff --git a/components/policy/core/common/preg_parser_win.cc b/components/policy/core/common/preg_parser_win.cc index 6a8b19a..16fc0be 100644 --- a/components/policy/core/common/preg_parser_win.cc +++ b/components/policy/core/common/preg_parser_win.cc @@ -118,7 +118,7 @@ bool DecodePRegValue(uint32 type, switch (type) { case REG_SZ: case REG_EXPAND_SZ: - value->reset(base::Value::CreateStringValue(DecodePRegStringValue(data))); + value->reset(new base::StringValue(DecodePRegStringValue(data))); return true; case REG_DWORD_LITTLE_ENDIAN: case REG_DWORD_BIG_ENDIAN: diff --git a/components/policy/core/common/proxy_policy_provider_unittest.cc b/components/policy/core/common/proxy_policy_provider_unittest.cc index 5b787aa..49d65db 100644 --- a/components/policy/core/common/proxy_policy_provider_unittest.cc +++ b/components/policy/core/common/proxy_policy_provider_unittest.cc @@ -54,7 +54,7 @@ TEST_F(ProxyPolicyProviderTest, Delegate) { .Set("policy", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("value"), + new base::StringValue("value"), NULL); mock_provider_.UpdatePolicy(CopyBundle(bundle)); @@ -68,7 +68,7 @@ TEST_F(ProxyPolicyProviderTest, Delegate) { .Set("policy", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("new value"), + new base::StringValue("new value"), NULL); mock_provider_.UpdatePolicy(CopyBundle(bundle)); Mock::VerifyAndClearExpectations(&observer_); diff --git a/components/policy/core/common/schema_map_unittest.cc b/components/policy/core/common/schema_map_unittest.cc index ba9f35c..77d332b 100644 --- a/components/policy/core/common/schema_map_unittest.cc +++ b/components/policy/core/common/schema_map_unittest.cc @@ -141,18 +141,17 @@ TEST_F(SchemaMapTest, FilterBundle) { expected_bundle.Get(chrome_ns).Set("ChromePolicy", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("value"), + new base::StringValue("value"), NULL); bundle.CopyFrom(expected_bundle); // Unknown components are filtered out. PolicyNamespace another_extension_ns(POLICY_DOMAIN_EXTENSIONS, "xyz"); - bundle.Get(another_extension_ns).Set( - "AnotherExtensionPolicy", - POLICY_LEVEL_MANDATORY, - POLICY_SCOPE_USER, - base::Value::CreateStringValue("value"), - NULL); + bundle.Get(another_extension_ns).Set("AnotherExtensionPolicy", + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("value"), + NULL); schema_map->FilterBundle(&bundle); EXPECT_TRUE(bundle.Equals(expected_bundle)); @@ -182,14 +181,17 @@ TEST_F(SchemaMapTest, FilterBundle) { dict.SetInteger("b", 2); map.Set("object", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, dict.DeepCopy(), NULL); - map.Set("string", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("value"), NULL); + map.Set("string", + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue("value"), + NULL); bundle.MergeFrom(expected_bundle); bundle.Get(extension_ns).Set("Unexpected", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("to-be-removed"), + new base::StringValue("to-be-removed"), NULL); schema_map->FilterBundle(&bundle); @@ -261,7 +263,7 @@ TEST_F(SchemaMapTest, LegacyComponents) { bundle.Get(extension_ns).Set("String", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("value 1"), + new base::StringValue("value 1"), NULL); // The Chrome namespace isn't filtered. @@ -269,7 +271,7 @@ TEST_F(SchemaMapTest, LegacyComponents) { bundle.Get(chrome_ns).Set("ChromePolicy", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("value 3"), + new base::StringValue("value 3"), NULL); PolicyBundle expected_bundle; @@ -280,14 +282,14 @@ TEST_F(SchemaMapTest, LegacyComponents) { bundle.Get(without_schema_ns).Set("Schemaless", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("value 2"), + new base::StringValue("value 2"), NULL); // Unknown policies of known components with a schema are removed. bundle.Get(extension_ns).Set("Surprise", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("value 4"), + new base::StringValue("value 4"), NULL); // Unknown components are removed. @@ -295,7 +297,7 @@ TEST_F(SchemaMapTest, LegacyComponents) { bundle.Get(unknown_ns).Set("Surprise", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue("value 5"), + new base::StringValue("value 5"), NULL); schema_map->FilterBundle(&bundle); diff --git a/components/policy/tools/generate_policy_source.py b/components/policy/tools/generate_policy_source.py index c3957c7..4e07baa7 100755 --- a/components/policy/tools/generate_policy_source.py +++ b/components/policy/tools/generate_policy_source.py @@ -825,7 +825,7 @@ base::ListValue* DecodeStringList(const em::StringList& string_list) { RepeatedPtrField<std::string>::const_iterator entry; for (entry = string_list.entries().begin(); entry != string_list.entries().end(); ++entry) { - list_value->Append(base::Value::CreateStringValue(*entry)); + list_value->AppendString(*entry); } return list_value; } @@ -860,7 +860,7 @@ def _CreateValue(type, arg): elif type == 'TYPE_INTEGER': return 'DecodeIntegerValue(%s)' % arg elif type == 'TYPE_STRING': - return 'base::Value::CreateStringValue(%s)' % arg + return 'new base::StringValue(%s)' % arg elif type == 'TYPE_LIST': return 'DecodeStringList(%s)' % arg elif type == 'TYPE_DICTIONARY' or type == 'TYPE_EXTERNAL': diff --git a/components/pref_registry/pref_registry_syncable.cc b/components/pref_registry/pref_registry_syncable.cc index 18c2660..6343e55 100644 --- a/components/pref_registry/pref_registry_syncable.cc +++ b/components/pref_registry/pref_registry_syncable.cc @@ -44,7 +44,7 @@ base::Value* CreateLocaleDefaultValue(base::Value::Type type, } case base::Value::TYPE_STRING: { - return base::Value::CreateStringValue(resource_string); + return new base::StringValue(resource_string); } default: { @@ -99,19 +99,16 @@ void PrefRegistrySyncable::RegisterDoublePref(const char* path, void PrefRegistrySyncable::RegisterStringPref(const char* path, const std::string& default_value, PrefSyncStatus sync_status) { - RegisterSyncablePreference(path, - base::Value::CreateStringValue(default_value), - sync_status); + RegisterSyncablePreference( + path, new base::StringValue(default_value), sync_status); } void PrefRegistrySyncable::RegisterFilePathPref( const char* path, const base::FilePath& default_value, PrefSyncStatus sync_status) { - RegisterSyncablePreference(path, - base::Value::CreateStringValue( - default_value.value()), - sync_status); + RegisterSyncablePreference( + path, new base::StringValue(default_value.value()), sync_status); } void PrefRegistrySyncable::RegisterListPref(const char* path, @@ -187,7 +184,7 @@ void PrefRegistrySyncable::RegisterInt64Pref( PrefSyncStatus sync_status) { RegisterSyncablePreference( path, - base::Value::CreateStringValue(base::Int64ToString(default_value)), + new base::StringValue(base::Int64ToString(default_value)), sync_status); } @@ -197,7 +194,7 @@ void PrefRegistrySyncable::RegisterUint64Pref( PrefSyncStatus sync_status) { RegisterSyncablePreference( path, - base::Value::CreateStringValue(base::Uint64ToString(default_value)), + new base::StringValue(base::Uint64ToString(default_value)), sync_status); } diff --git a/components/search_engines/default_search_policy_handler.cc b/components/search_engines/default_search_policy_handler.cc index 64a0ab7..4041975 100644 --- a/components/search_engines/default_search_policy_handler.cc +++ b/components/search_engines/default_search_policy_handler.cc @@ -170,8 +170,7 @@ void DefaultSearchEncodingsPolicyHandler::ApplyPolicySettings( } } std::string encodings = JoinString(string_parts, ';'); - prefs->SetValue(prefs::kDefaultSearchProviderEncodings, - base::Value::CreateStringValue(encodings)); + prefs->SetString(prefs::kDefaultSearchProviderEncodings, encodings); } diff --git a/components/search_engines/default_search_policy_handler_unittest.cc b/components/search_engines/default_search_policy_handler_unittest.cc index c3c37ce..94620de 100644 --- a/components/search_engines/default_search_policy_handler_unittest.cc +++ b/components/search_engines/default_search_policy_handler_unittest.cc @@ -87,36 +87,55 @@ void DefaultSearchPolicyHandlerTest:: POLICY_SCOPE_USER, new base::FundamentalValue(true), NULL); - policy->Set(key::kDefaultSearchProviderSearchURL, POLICY_LEVEL_MANDATORY, - POLICY_SCOPE_USER, base::Value::CreateStringValue(kSearchURL), + policy->Set(key::kDefaultSearchProviderSearchURL, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kSearchURL), NULL); - policy->Set(key::kDefaultSearchProviderName, POLICY_LEVEL_MANDATORY, - POLICY_SCOPE_USER, base::Value::CreateStringValue(kName), NULL); - policy->Set(key::kDefaultSearchProviderKeyword, POLICY_LEVEL_MANDATORY, - POLICY_SCOPE_USER, base::Value::CreateStringValue(kKeyword), + policy->Set(key::kDefaultSearchProviderName, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kName), NULL); - policy->Set(key::kDefaultSearchProviderSuggestURL, POLICY_LEVEL_MANDATORY, - POLICY_SCOPE_USER, base::Value::CreateStringValue(kSuggestURL), + policy->Set(key::kDefaultSearchProviderKeyword, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kKeyword), NULL); - policy->Set(key::kDefaultSearchProviderIconURL, POLICY_LEVEL_MANDATORY, - POLICY_SCOPE_USER, base::Value::CreateStringValue(kIconURL), + policy->Set(key::kDefaultSearchProviderSuggestURL, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kSuggestURL), + NULL); + policy->Set(key::kDefaultSearchProviderIconURL, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kIconURL), NULL); policy->Set(key::kDefaultSearchProviderEncodings, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, encodings, NULL); policy->Set(key::kDefaultSearchProviderAlternateURLs, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, default_alternate_urls_.DeepCopy(), NULL); policy->Set(key::kDefaultSearchProviderSearchTermsReplacementKey, - POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(kReplacementKey), NULL); + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kReplacementKey), + NULL); policy->Set(key::kDefaultSearchProviderImageURL, - POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(kImageURL), NULL); + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kImageURL), + NULL); policy->Set(key::kDefaultSearchProviderImageURLPostParams, - POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(kImageParams), NULL); + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kImageParams), + NULL); policy->Set(key::kDefaultSearchProviderNewTabURL, - POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(kNewTabURL), NULL); + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kNewTabURL), + NULL); } // Checks that if the policy for default search is valid, i.e. there's a @@ -128,8 +147,10 @@ TEST_F(DefaultSearchPolicyHandlerTest, MinimallyDefined) { POLICY_SCOPE_USER, new base::FundamentalValue(true), NULL); - policy.Set(key::kDefaultSearchProviderSearchURL, POLICY_LEVEL_MANDATORY, - POLICY_SCOPE_USER, base::Value::CreateStringValue(kSearchURL), + policy.Set(key::kDefaultSearchProviderSearchURL, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, + new base::StringValue(kSearchURL), NULL); UpdateProviderPolicy(policy); @@ -277,9 +298,11 @@ TEST_F(DefaultSearchPolicyHandlerTest, Invalid) { PolicyMap policy; BuildDefaultSearchPolicy(&policy); const char bad_search_url[] = "http://test.com/noSearchTerms"; - policy.Set(key::kDefaultSearchProviderSearchURL, POLICY_LEVEL_MANDATORY, + policy.Set(key::kDefaultSearchProviderSearchURL, + POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(bad_search_url), NULL); + new base::StringValue(bad_search_url), + NULL); UpdateProviderPolicy(policy); EXPECT_FALSE(store_->GetValue(prefs::kDefaultSearchProviderSearchURL, NULL)); @@ -414,7 +437,7 @@ TEST_F(DefaultSearchPolicyHandlerTest, DictionaryPrefMinimallyDefined) { policy.Set(key::kDefaultSearchProviderSearchURL, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(kSearchURL), + new base::StringValue(kSearchURL), NULL); UpdateProviderPolicy(policy); @@ -476,7 +499,7 @@ TEST_F(DefaultSearchPolicyHandlerTest, DictionaryPrefFileURL) { policy.Set(key::kDefaultSearchProviderSearchURL, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, - base::Value::CreateStringValue(kFileSearchURL), + new base::StringValue(kFileSearchURL), NULL); UpdateProviderPolicy(policy); diff --git a/components/url_matcher/url_matcher_factory_unittest.cc b/components/url_matcher/url_matcher_factory_unittest.cc index f789a3d..e287156 100644 --- a/components/url_matcher/url_matcher_factory_unittest.cc +++ b/components/url_matcher/url_matcher_factory_unittest.cc @@ -55,7 +55,7 @@ TEST(URLMatcherFactoryTest, CreateFromURLFilterDictionary) { port_ranges->Append(port_range); base::ListValue* scheme_list = new base::ListValue(); - scheme_list->Append(base::Value::CreateStringValue("http")); + scheme_list->Append(new base::StringValue("http")); base::DictionaryValue valid_condition; valid_condition.SetString(keys::kHostSuffixKey, "example.com"); @@ -137,7 +137,7 @@ TEST(URLMatcherFactoryTest, UpperCase) { // {"scheme": ["HTTP"]} base::ListValue* scheme_list = new base::ListValue(); - scheme_list->Append(base::Value::CreateStringValue("HTTP")); + scheme_list->Append(new base::StringValue("HTTP")); base::DictionaryValue invalid_condition5; invalid_condition5.Set(keys::kSchemesKey, scheme_list); @@ -230,7 +230,7 @@ void UrlConditionCaseTest::CheckCondition( base::DictionaryValue condition; if (use_list_of_strings_) { base::ListValue* list = new base::ListValue(); - list->Append(base::Value::CreateStringValue(value)); + list->Append(new base::StringValue(value)); condition.SetWithoutPathExpansion(condition_key_, list); } else { condition.SetStringWithoutPathExpansion(condition_key_, value); diff --git a/content/browser/tracing/etw_system_event_consumer_win.cc b/content/browser/tracing/etw_system_event_consumer_win.cc index df20bce..fc3522f 100644 --- a/content/browser/tracing/etw_system_event_consumer_win.cc +++ b/content/browser/tracing/etw_system_event_consumer_win.cc @@ -195,7 +195,7 @@ void EtwSystemEventConsumer::TraceAndConsumeOnThread() { void EtwSystemEventConsumer::FlushOnThread(const OutputCallback& callback) { // Add the header information to the stream. scoped_ptr<base::DictionaryValue> header(new base::DictionaryValue()); - header->Set("name", base::Value::CreateStringValue("ETW")); + header->Set("name", new base::StringValue("ETW")); // Release and pass the events buffer. header->Set("content", events_.release()); diff --git a/extensions/browser/value_store/leveldb_value_store_unittest.cc b/extensions/browser/value_store/leveldb_value_store_unittest.cc index c278b54..ddcedb2 100644 --- a/extensions/browser/value_store/leveldb_value_store_unittest.cc +++ b/extensions/browser/value_store/leveldb_value_store_unittest.cc @@ -66,7 +66,7 @@ TEST_F(LeveldbValueStoreUnitTest, RestoreKeyTest) { const char kValue[] = "value"; // Insert a valid pair. - scoped_ptr<base::Value> value(base::Value::CreateStringValue(kValue)); + scoped_ptr<base::Value> value(new base::StringValue(kValue)); ASSERT_FALSE( store()->Set(ValueStore::DEFAULTS, kNotCorruptKey, *value)->HasError()); @@ -107,7 +107,7 @@ TEST_F(LeveldbValueStoreUnitTest, RestoreDoesMinimumNecessary) { const char kCorruptValue[] = "[{(.*+\"\'\\"; // Insert a collection of non-corrupted pairs. - scoped_ptr<base::Value> value(base::Value::CreateStringValue(kValue)); + scoped_ptr<base::Value> value(new base::StringValue(kValue)); for (size_t i = 0; i < kNotCorruptKeysSize; ++i) { ASSERT_FALSE(store() ->Set(ValueStore::DEFAULTS, kNotCorruptKeys[i], *value) @@ -152,7 +152,7 @@ TEST_F(LeveldbValueStoreUnitTest, RestoreFullDatabase) { const char kValue[] = "value"; // Generate a database. - scoped_ptr<base::Value> value(base::Value::CreateStringValue(kValue)); + scoped_ptr<base::Value> value(new base::StringValue(kValue)); for (size_t i = 0; i < kNotCorruptKeysSize; ++i) { ASSERT_FALSE(store() ->Set(ValueStore::DEFAULTS, kNotCorruptKeys[i], *value) diff --git a/extensions/browser/value_store/value_store_change_unittest.cc b/extensions/browser/value_store/value_store_change_unittest.cc index 5fb75b7..9da1f64 100644 --- a/extensions/browser/value_store/value_store_change_unittest.cc +++ b/extensions/browser/value_store/value_store_change_unittest.cc @@ -18,22 +18,22 @@ using extensions::ListBuilder; namespace { TEST(ValueStoreChangeTest, NullOldValue) { - ValueStoreChange change("key", NULL, base::Value::CreateStringValue("value")); + ValueStoreChange change("key", NULL, new base::StringValue("value")); EXPECT_EQ("key", change.key()); EXPECT_EQ(NULL, change.old_value()); { - scoped_ptr<base::Value> expected(base::Value::CreateStringValue("value")); + scoped_ptr<base::Value> expected(new base::StringValue("value")); EXPECT_TRUE(change.new_value()->Equals(expected.get())); } } TEST(ValueStoreChangeTest, NullNewValue) { - ValueStoreChange change("key", base::Value::CreateStringValue("value"), NULL); + ValueStoreChange change("key", new base::StringValue("value"), NULL); EXPECT_EQ("key", change.key()); { - scoped_ptr<base::Value> expected(base::Value::CreateStringValue("value")); + scoped_ptr<base::Value> expected(new base::StringValue("value")); EXPECT_TRUE(change.old_value()->Equals(expected.get())); } EXPECT_EQ(NULL, change.new_value()); @@ -41,18 +41,16 @@ TEST(ValueStoreChangeTest, NullNewValue) { TEST(ValueStoreChangeTest, NonNullValues) { ValueStoreChange change("key", - base::Value::CreateStringValue("old_value"), - base::Value::CreateStringValue("new_value")); + new base::StringValue("old_value"), + new base::StringValue("new_value")); EXPECT_EQ("key", change.key()); { - scoped_ptr<base::Value> expected( - base::Value::CreateStringValue("old_value")); + scoped_ptr<base::Value> expected(new base::StringValue("old_value")); EXPECT_TRUE(change.old_value()->Equals(expected.get())); } { - scoped_ptr<base::Value> expected( - base::Value::CreateStringValue("new_value")); + scoped_ptr<base::Value> expected(new base::StringValue("new_value")); EXPECT_TRUE(change.new_value()->Equals(expected.get())); } } diff --git a/extensions/browser/value_store/value_store_frontend_unittest.cc b/extensions/browser/value_store/value_store_frontend_unittest.cc index 3d81a1d..82c24ce 100644 --- a/extensions/browser/value_store/value_store_frontend_unittest.cc +++ b/extensions/browser/value_store/value_store_frontend_unittest.cc @@ -88,8 +88,7 @@ TEST_F(ValueStoreFrontendTest, GetExistingData) { TEST_F(ValueStoreFrontendTest, ChangesPersistAfterReload) { storage_->Set("key0", scoped_ptr<base::Value>(base::Value::CreateIntegerValue(0))); - storage_->Set("key1", - scoped_ptr<base::Value>(base::Value::CreateStringValue("new1"))); + storage_->Set("key1", scoped_ptr<base::Value>(new base::StringValue("new1"))); storage_->Remove("key2"); // Reload the DB and test our changes. diff --git a/extensions/browser/value_store/value_store_unittest.cc b/extensions/browser/value_store/value_store_unittest.cc index a859570..4293459 100644 --- a/extensions/browser/value_store/value_store_unittest.cc +++ b/extensions/browser/value_store/value_store_unittest.cc @@ -135,9 +135,9 @@ ValueStoreTest::ValueStoreTest() dict123_(new base::DictionaryValue()), ui_thread_(BrowserThread::UI, base::MessageLoop::current()), file_thread_(BrowserThread::FILE, base::MessageLoop::current()) { - val1_.reset(base::Value::CreateStringValue(key1_ + "Value")); - val2_.reset(base::Value::CreateStringValue(key2_ + "Value")); - val3_.reset(base::Value::CreateStringValue(key3_ + "Value")); + val1_.reset(new base::StringValue(key1_ + "Value")); + val2_.reset(new base::StringValue(key2_ + "Value")); + val3_.reset(new base::StringValue(key3_ + "Value")); list1_.push_back(key1_); list2_.push_back(key2_); diff --git a/extensions/common/event_filter_unittest.cc b/extensions/common/event_filter_unittest.cc index 0b1bd7b..0ae063c 100644 --- a/extensions/common/event_filter_unittest.cc +++ b/extensions/common/event_filter_unittest.cc @@ -30,7 +30,7 @@ class EventFilterUnittest : public testing::Test { protected: scoped_ptr<base::Value> HostSuffixDict(const std::string& host_suffix) { scoped_ptr<base::DictionaryValue> dict(new DictionaryValue()); - dict->Set("hostSuffix", base::Value::CreateStringValue(host_suffix)); + dict->Set("hostSuffix", new base::StringValue(host_suffix)); return scoped_ptr<base::Value>(dict.release()); } diff --git a/extensions/renderer/dom_activity_logger.cc b/extensions/renderer/dom_activity_logger.cc index 2d8ca46..98408ee 100644 --- a/extensions/renderer/dom_activity_logger.cc +++ b/extensions/renderer/dom_activity_logger.cc @@ -112,7 +112,7 @@ void DOMActivityLogger::logEvent(const WebString& event_name, scoped_ptr<base::ListValue> args(new base::ListValue); std::string event_name_utf8 = event_name.utf8(); for (int i = 0; i < argc; ++i) - args->Append(base::Value::CreateStringValue(argv[i])); + args->Append(new base::StringValue(argv[i])); SendDomActionMessage( event_name_utf8, url, title, DomActionType::METHOD, args.Pass()); } diff --git a/tools/json_schema_compiler/test/additional_properties_unittest.cc b/tools/json_schema_compiler/test/additional_properties_unittest.cc index 37ef4d7..dc980af 100644 --- a/tools/json_schema_compiler/test/additional_properties_unittest.cc +++ b/tools/json_schema_compiler/test/additional_properties_unittest.cc @@ -11,7 +11,7 @@ TEST(JsonSchemaCompilerAdditionalPropertiesTest, AdditionalPropertiesTypePopulate) { { scoped_ptr<base::ListValue> list_value(new base::ListValue()); - list_value->Append(base::Value::CreateStringValue("asdf")); + list_value->Append(new base::StringValue("asdf")); list_value->Append(new base::FundamentalValue(4)); scoped_ptr<base::DictionaryValue> type_value(new base::DictionaryValue()); type_value->SetString("string", "value"); diff --git a/tools/json_schema_compiler/test/any_unittest.cc b/tools/json_schema_compiler/test/any_unittest.cc index 039bd15..d10a3eb 100644 --- a/tools/json_schema_compiler/test/any_unittest.cc +++ b/tools/json_schema_compiler/test/any_unittest.cc @@ -38,7 +38,7 @@ TEST(JsonSchemaCompilerAnyTest, OptionalAnyParamsCreate) { } { scoped_ptr<base::ListValue> params_value(new base::ListValue()); - scoped_ptr<base::Value> param(base::Value::CreateStringValue("asdf")); + scoped_ptr<base::Value> param(new base::StringValue("asdf")); 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 ea25244..8d249b4 100644 --- a/tools/json_schema_compiler/test/arrays_unittest.cc +++ b/tools/json_schema_compiler/test/arrays_unittest.cc @@ -15,10 +15,10 @@ namespace { 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")); + strings_value->Append(new base::StringValue("a")); + strings_value->Append(new base::StringValue("b")); + strings_value->Append(new base::StringValue("c")); + strings_value->Append(new base::StringValue("it's easy as")); base::ListValue* integers_value = new base::ListValue(); integers_value->Append(new base::FundamentalValue(1)); integers_value->Append(new base::FundamentalValue(2)); @@ -185,7 +185,7 @@ TEST(JsonSchemaCompilerArrayTest, OptionalEnumArrayType) { { base::DictionaryValue value; scoped_ptr<base::ListValue> enum_array(new base::ListValue()); - enum_array->Append(base::Value::CreateStringValue("invalid")); + enum_array->Append(new base::StringValue("invalid")); value.Set("types", enum_array.release()); OptionalEnumArrayType enum_array_type; @@ -240,7 +240,7 @@ TEST(JsonSchemaCompilerArrayTest, AnyArrayParamsCreate) { scoped_ptr<base::ListValue> params_value(new base::ListValue()); scoped_ptr<base::ListValue> any_array(new base::ListValue()); any_array->Append(new base::FundamentalValue(1)); - any_array->Append(base::Value::CreateStringValue("test")); + any_array->Append(new base::StringValue("test")); any_array->Append(CreateItemValue(2)); params_value->Append(any_array.release()); scoped_ptr<AnyArray::Params> params( diff --git a/tools/json_schema_compiler/test/choices_unittest.cc b/tools/json_schema_compiler/test/choices_unittest.cc index 5253cd9..2cf1d8d 100644 --- a/tools/json_schema_compiler/test/choices_unittest.cc +++ b/tools/json_schema_compiler/test/choices_unittest.cc @@ -81,9 +81,9 @@ TEST(JsonSchemaCompilerChoicesTest, ObjectWithChoicesParamsCreateFail) { { scoped_ptr<base::DictionaryValue> object_param(new base::DictionaryValue()); object_param->SetWithoutPathExpansion("strings", - base::Value::CreateStringValue("asdf")); + new base::StringValue("asdf")); object_param->SetWithoutPathExpansion("integers", - base::Value::CreateStringValue("asdf")); + new base::StringValue("asdf")); scoped_ptr<base::ListValue> params_value(new base::ListValue()); params_value->Append(object_param.release()); scoped_ptr<ObjectWithChoices::Params> params( @@ -109,7 +109,7 @@ TEST(JsonSchemaCompilerChoicesTest, PopulateChoiceType) { base::ListValue* strings_value = new base::ListValue(); for (size_t i = 0; i < strings.size(); ++i) - strings_value->Append(base::Value::CreateStringValue(strings[i])); + strings_value->Append(new base::StringValue(strings[i])); base::DictionaryValue value; value.SetInteger("integers", 4); @@ -128,9 +128,9 @@ TEST(JsonSchemaCompilerChoicesTest, PopulateChoiceType) { TEST(JsonSchemaCompilerChoicesTest, ChoiceTypeToValue) { 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")); + strings_value->Append(new base::StringValue("list")); + strings_value->Append(new base::StringValue("of")); + strings_value->Append(new base::StringValue("strings")); base::DictionaryValue value; value.SetInteger("integers", 5); diff --git a/tools/json_schema_compiler/test/crossref_unittest.cc b/tools/json_schema_compiler/test/crossref_unittest.cc index 42550ad..af0214e 100644 --- a/tools/json_schema_compiler/test/crossref_unittest.cc +++ b/tools/json_schema_compiler/test/crossref_unittest.cc @@ -15,8 +15,7 @@ static scoped_ptr<base::DictionaryValue> CreateTestTypeDictionary() { base::DictionaryValue* value(new base::DictionaryValue()); value->SetWithoutPathExpansion("number", base::Value::CreateDoubleValue(1.1)); value->SetWithoutPathExpansion("integer", new base::FundamentalValue(4)); - value->SetWithoutPathExpansion("string", - base::Value::CreateStringValue("bling")); + value->SetWithoutPathExpansion("string", new base::StringValue("bling")); value->SetWithoutPathExpansion("boolean", new base::FundamentalValue(true)); return scoped_ptr<base::DictionaryValue>(value); } @@ -102,8 +101,7 @@ TEST(JsonSchemaCompilerCrossrefTest, TestTypeInObjectParamsCreate) { 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("testType", new base::StringValue("invalid")); param_object_value->Set("boolean", new base::FundamentalValue(true)); 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 9bbadd9..7f1addb 100644 --- a/tools/json_schema_compiler/test/enums_unittest.cc +++ b/tools/json_schema_compiler/test/enums_unittest.cc @@ -14,7 +14,7 @@ TEST(JsonSchemaCompilerEnumsTest, EnumTypePopulate) { { EnumType enum_type; base::DictionaryValue value; - value.Set("type", base::Value::CreateStringValue("one")); + value.Set("type", new base::StringValue("one")); EXPECT_TRUE(EnumType::Populate(value, &enum_type)); EXPECT_EQ(EnumType::TYPE_ONE, enum_type.type); EXPECT_TRUE(value.Equals(enum_type.ToValue().get())); @@ -22,7 +22,7 @@ TEST(JsonSchemaCompilerEnumsTest, EnumTypePopulate) { { EnumType enum_type; base::DictionaryValue value; - value.Set("type", base::Value::CreateStringValue("invalid")); + value.Set("type", new base::StringValue("invalid")); EXPECT_FALSE(EnumType::Populate(value, &enum_type)); } } @@ -30,7 +30,7 @@ TEST(JsonSchemaCompilerEnumsTest, EnumTypePopulate) { TEST(JsonSchemaCompilerEnumsTest, EnumsAsTypes) { { base::ListValue args; - args.Append(base::Value::CreateStringValue("one")); + args.Append(new base::StringValue("one")); scoped_ptr<TakesEnumAsType::Params> params( TakesEnumAsType::Params::Create(args)); @@ -50,11 +50,11 @@ TEST(JsonSchemaCompilerEnumsTest, EnumsAsTypes) { base::DictionaryValue value; ASSERT_FALSE(HasEnumeration::Populate(value, &enumeration)); - value.Set("enumeration", base::Value::CreateStringValue("one")); + value.Set("enumeration", new base::StringValue("one")); ASSERT_TRUE(HasEnumeration::Populate(value, &enumeration)); EXPECT_TRUE(value.Equals(enumeration.ToValue().get())); - value.Set("optional_enumeration", base::Value::CreateStringValue("two")); + value.Set("optional_enumeration", new base::StringValue("two")); ASSERT_TRUE(HasEnumeration::Populate(value, &enumeration)); EXPECT_TRUE(value.Equals(enumeration.ToValue().get())); } @@ -63,10 +63,10 @@ TEST(JsonSchemaCompilerEnumsTest, EnumsAsTypes) { base::DictionaryValue value; ASSERT_FALSE(InlineAndReferenceEnum::Populate(value, &enumeration)); - value.Set("inline_enum", base::Value::CreateStringValue("test2")); + value.Set("inline_enum", new base::StringValue("test2")); ASSERT_FALSE(InlineAndReferenceEnum::Populate(value, &enumeration)); - value.Set("reference_enum", base::Value::CreateStringValue("one")); + value.Set("reference_enum", new base::StringValue("one")); ASSERT_TRUE(InlineAndReferenceEnum::Populate(value, &enumeration)); EXPECT_TRUE(value.Equals(enumeration.ToValue().get())); } @@ -75,8 +75,8 @@ TEST(JsonSchemaCompilerEnumsTest, EnumsAsTypes) { TEST(JsonSchemaCompilerEnumsTest, EnumsArrayAsType) { { base::ListValue params_value; - params_value.Append(List(base::Value::CreateStringValue("one"), - base::Value::CreateStringValue("two")).release()); + params_value.Append(List(new base::StringValue("one"), + new base::StringValue("two")).release()); scoped_ptr<TakesEnumArrayAsType::Params> params( TakesEnumArrayAsType::Params::Create(params_value)); ASSERT_TRUE(params); @@ -86,8 +86,7 @@ TEST(JsonSchemaCompilerEnumsTest, EnumsArrayAsType) { } { base::ListValue params_value; - params_value.Append( - List(base::Value::CreateStringValue("invalid")).release()); + params_value.Append(List(new base::StringValue("invalid")).release()); scoped_ptr<TakesEnumArrayAsType::Params> params( TakesEnumArrayAsType::Params::Create(params_value)); EXPECT_FALSE(params); @@ -99,14 +98,14 @@ TEST(JsonSchemaCompilerEnumsTest, ReturnsEnumCreate) { ReturnsEnum::Results::State state = ReturnsEnum::Results::STATE_FOO; scoped_ptr<base::Value> result( new base::StringValue(ReturnsEnum::Results::ToString(state))); - scoped_ptr<base::Value> expected(base::Value::CreateStringValue("foo")); + scoped_ptr<base::Value> expected(new base::StringValue("foo")); EXPECT_TRUE(result->Equals(expected.get())); } { ReturnsEnum::Results::State state = ReturnsEnum::Results::STATE_FOO; scoped_ptr<base::ListValue> results = ReturnsEnum::Results::Create(state); base::ListValue expected; - expected.Append(base::Value::CreateStringValue("foo")); + expected.Append(new base::StringValue("foo")); EXPECT_TRUE(results->Equals(&expected)); } } @@ -117,8 +116,8 @@ TEST(JsonSchemaCompilerEnumsTest, ReturnsTwoEnumsCreate) { ReturnsTwoEnums::Results::FIRST_STATE_FOO, ReturnsTwoEnums::Results::SECOND_STATE_HAM); base::ListValue expected; - expected.Append(base::Value::CreateStringValue("foo")); - expected.Append(base::Value::CreateStringValue("ham")); + expected.Append(new base::StringValue("foo")); + expected.Append(new base::StringValue("ham")); EXPECT_TRUE(results->Equals(&expected)); } } @@ -127,7 +126,7 @@ TEST(JsonSchemaCompilerEnumsTest, OptionalEnumTypePopulate) { { OptionalEnumType enum_type; base::DictionaryValue value; - value.Set("type", base::Value::CreateStringValue("two")); + value.Set("type", new base::StringValue("two")); EXPECT_TRUE(OptionalEnumType::Populate(value, &enum_type)); EXPECT_EQ(OptionalEnumType::TYPE_TWO, enum_type.type); EXPECT_TRUE(value.Equals(enum_type.ToValue().get())); @@ -142,7 +141,7 @@ TEST(JsonSchemaCompilerEnumsTest, OptionalEnumTypePopulate) { { OptionalEnumType enum_type; base::DictionaryValue value; - value.Set("type", base::Value::CreateStringValue("invalid")); + value.Set("type", new base::StringValue("invalid")); EXPECT_FALSE(OptionalEnumType::Populate(value, &enum_type)); } } @@ -150,7 +149,7 @@ TEST(JsonSchemaCompilerEnumsTest, OptionalEnumTypePopulate) { TEST(JsonSchemaCompilerEnumsTest, TakesEnumParamsCreate) { { base::ListValue params_value; - params_value.Append(base::Value::CreateStringValue("baz")); + params_value.Append(new base::StringValue("baz")); scoped_ptr<TakesEnum::Params> params( TakesEnum::Params::Create(params_value)); EXPECT_TRUE(params.get()); @@ -158,7 +157,7 @@ TEST(JsonSchemaCompilerEnumsTest, TakesEnumParamsCreate) { } { base::ListValue params_value; - params_value.Append(base::Value::CreateStringValue("invalid")); + params_value.Append(new base::StringValue("invalid")); scoped_ptr<TakesEnum::Params> params( TakesEnum::Params::Create(params_value)); EXPECT_FALSE(params.get()); @@ -168,8 +167,8 @@ TEST(JsonSchemaCompilerEnumsTest, TakesEnumParamsCreate) { TEST(JsonSchemaCompilerEnumsTest, TakesEnumArrayParamsCreate) { { base::ListValue params_value; - params_value.Append(List(base::Value::CreateStringValue("foo"), - base::Value::CreateStringValue("bar")).release()); + params_value.Append(List(new base::StringValue("foo"), + new base::StringValue("bar")).release()); scoped_ptr<TakesEnumArray::Params> params( TakesEnumArray::Params::Create(params_value)); ASSERT_TRUE(params); @@ -179,8 +178,7 @@ TEST(JsonSchemaCompilerEnumsTest, TakesEnumArrayParamsCreate) { } { base::ListValue params_value; - params_value.Append( - List(base::Value::CreateStringValue("invalid")).release()); + params_value.Append(List(new base::StringValue("invalid")).release()); scoped_ptr<TakesEnumArray::Params> params( TakesEnumArray::Params::Create(params_value)); EXPECT_FALSE(params); @@ -190,7 +188,7 @@ TEST(JsonSchemaCompilerEnumsTest, TakesEnumArrayParamsCreate) { TEST(JsonSchemaCompilerEnumsTest, TakesOptionalEnumParamsCreate) { { base::ListValue params_value; - params_value.Append(base::Value::CreateStringValue("baz")); + params_value.Append(new base::StringValue("baz")); scoped_ptr<TakesOptionalEnum::Params> params( TakesOptionalEnum::Params::Create(params_value)); EXPECT_TRUE(params.get()); @@ -205,7 +203,7 @@ TEST(JsonSchemaCompilerEnumsTest, TakesOptionalEnumParamsCreate) { } { base::ListValue params_value; - params_value.Append(base::Value::CreateStringValue("invalid")); + params_value.Append(new base::StringValue("invalid")); scoped_ptr<TakesOptionalEnum::Params> params( TakesOptionalEnum::Params::Create(params_value)); EXPECT_FALSE(params.get()); @@ -215,8 +213,8 @@ TEST(JsonSchemaCompilerEnumsTest, TakesOptionalEnumParamsCreate) { TEST(JsonSchemaCompilerEnumsTest, TakesMultipleOptionalEnumsParamsCreate) { { base::ListValue params_value; - params_value.Append(base::Value::CreateStringValue("foo")); - params_value.Append(base::Value::CreateStringValue("foo")); + params_value.Append(new base::StringValue("foo")); + params_value.Append(new base::StringValue("foo")); scoped_ptr<TakesMultipleOptionalEnums::Params> params( TakesMultipleOptionalEnums::Params::Create(params_value)); EXPECT_TRUE(params.get()); @@ -225,7 +223,7 @@ TEST(JsonSchemaCompilerEnumsTest, TakesMultipleOptionalEnumsParamsCreate) { } { base::ListValue params_value; - params_value.Append(base::Value::CreateStringValue("foo")); + params_value.Append(new base::StringValue("foo")); scoped_ptr<TakesMultipleOptionalEnums::Params> params( TakesMultipleOptionalEnums::Params::Create(params_value)); EXPECT_TRUE(params.get()); @@ -242,8 +240,8 @@ TEST(JsonSchemaCompilerEnumsTest, TakesMultipleOptionalEnumsParamsCreate) { } { base::ListValue params_value; - params_value.Append(base::Value::CreateStringValue("baz")); - params_value.Append(base::Value::CreateStringValue("invalid")); + params_value.Append(new base::StringValue("baz")); + params_value.Append(new base::StringValue("invalid")); scoped_ptr<TakesMultipleOptionalEnums::Params> params( TakesMultipleOptionalEnums::Params::Create(params_value)); EXPECT_FALSE(params.get()); @@ -255,14 +253,14 @@ TEST(JsonSchemaCompilerEnumsTest, OnEnumFiredCreate) { OnEnumFired::SomeEnum some_enum = OnEnumFired::SOME_ENUM_FOO; scoped_ptr<base::Value> result( new base::StringValue(OnEnumFired::ToString(some_enum))); - scoped_ptr<base::Value> expected(base::Value::CreateStringValue("foo")); + scoped_ptr<base::Value> expected(new base::StringValue("foo")); EXPECT_TRUE(result->Equals(expected.get())); } { OnEnumFired::SomeEnum some_enum = OnEnumFired::SOME_ENUM_FOO; scoped_ptr<base::ListValue> results(OnEnumFired::Create(some_enum)); base::ListValue expected; - expected.Append(base::Value::CreateStringValue("foo")); + expected.Append(new base::StringValue("foo")); EXPECT_TRUE(results->Equals(&expected)); } } @@ -273,8 +271,8 @@ TEST(JsonSchemaCompilerEnumsTest, OnTwoEnumsFiredCreate) { OnTwoEnumsFired::FIRST_ENUM_FOO, OnTwoEnumsFired::SECOND_ENUM_HAM)); base::ListValue expected; - expected.Append(base::Value::CreateStringValue("foo")); - expected.Append(base::Value::CreateStringValue("ham")); + expected.Append(new base::StringValue("foo")); + expected.Append(new base::StringValue("ham")); EXPECT_TRUE(results->Equals(&expected)); } } 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 f2f3f1b..86ce492 100644 --- a/tools/json_schema_compiler/test/functions_on_types_unittest.cc +++ b/tools/json_schema_compiler/test/functions_on_types_unittest.cc @@ -25,7 +25,7 @@ TEST(JsonSchemaCompilerFunctionsOnTypesTest, StorageAreaGetParamsCreate) { } { scoped_ptr<base::ListValue> params_value(new base::ListValue()); - params_value->Append(base::Value::CreateStringValue("test")); + params_value->Append(new base::StringValue("test")); scoped_ptr<StorageArea::Get::Params> params( StorageArea::Get::Params::Create(*params_value)); ASSERT_TRUE(params); diff --git a/tools/json_schema_compiler/test/idl_schemas_unittest.cc b/tools/json_schema_compiler/test/idl_schemas_unittest.cc index 728d7d4..1817afb 100644 --- a/tools/json_schema_compiler/test/idl_schemas_unittest.cc +++ b/tools/json_schema_compiler/test/idl_schemas_unittest.cc @@ -92,7 +92,7 @@ TEST(IdlCompiler, OptionalArguments) { 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(base::Value::CreateStringValue("foo")); + list.Append(new base::StringValue("foo")); f8_params = Function8::Params::Create(list); EXPECT_EQ(8, f8_params->arg1); EXPECT_EQ("foo", *(f8_params->arg2)); diff --git a/tools/json_schema_compiler/test/objects_unittest.cc b/tools/json_schema_compiler/test/objects_unittest.cc index a24ca3b..6dc2c45 100644 --- a/tools/json_schema_compiler/test/objects_unittest.cc +++ b/tools/json_schema_compiler/test/objects_unittest.cc @@ -12,8 +12,8 @@ using namespace test::api::objects; TEST(JsonSchemaCompilerObjectsTest, ObjectParamParamsCreate) { { scoped_ptr<base::ListValue> strings(new base::ListValue()); - strings->Append(base::Value::CreateStringValue("one")); - strings->Append(base::Value::CreateStringValue("two")); + strings->Append(new base::StringValue("one")); + strings->Append(new base::StringValue("two")); scoped_ptr<base::DictionaryValue> info_value(new base::DictionaryValue()); info_value->Set("strings", strings.release()); info_value->Set("integer", new base::FundamentalValue(5)); @@ -32,8 +32,8 @@ TEST(JsonSchemaCompilerObjectsTest, ObjectParamParamsCreate) { } { scoped_ptr<base::ListValue> strings(new base::ListValue()); - strings->Append(base::Value::CreateStringValue("one")); - strings->Append(base::Value::CreateStringValue("two")); + strings->Append(new base::StringValue("one")); + strings->Append(new base::StringValue("two")); scoped_ptr<base::DictionaryValue> info_value(new base::DictionaryValue()); info_value->Set("strings", strings.release()); info_value->Set("integer", new base::FundamentalValue(5)); diff --git a/tools/json_schema_compiler/test/simple_api_unittest.cc b/tools/json_schema_compiler/test/simple_api_unittest.cc index 0cf3fb8..f32031b 100644 --- a/tools/json_schema_compiler/test/simple_api_unittest.cc +++ b/tools/json_schema_compiler/test/simple_api_unittest.cc @@ -15,8 +15,7 @@ static scoped_ptr<base::DictionaryValue> CreateTestTypeDictionary() { value->SetWithoutPathExpansion("number", base::Value::CreateDoubleValue(1.1)); value->SetWithoutPathExpansion("integer", new base::FundamentalValue(4)); - value->SetWithoutPathExpansion("string", - base::Value::CreateStringValue("bling")); + value->SetWithoutPathExpansion("string", new base::StringValue("bling")); value->SetWithoutPathExpansion("boolean", new base::FundamentalValue(true)); return value.Pass(); } @@ -42,8 +41,8 @@ TEST(JsonSchemaCompilerSimpleTest, IncrementIntegerParamsCreate) { TEST(JsonSchemaCompilerSimpleTest, NumberOfParams) { { scoped_ptr<base::ListValue> params_value(new base::ListValue()); - params_value->Append(base::Value::CreateStringValue("text")); - params_value->Append(base::Value::CreateStringValue("text")); + params_value->Append(new base::StringValue("text")); + params_value->Append(new base::StringValue("text")); scoped_ptr<OptionalString::Params> params( OptionalString::Params::Create(*params_value)); EXPECT_FALSE(params.get()); @@ -66,7 +65,7 @@ TEST(JsonSchemaCompilerSimpleTest, OptionalStringParamsCreate) { } { scoped_ptr<base::ListValue> params_value(new base::ListValue()); - params_value->Append(base::Value::CreateStringValue("asdf")); + params_value->Append(new base::StringValue("asdf")); scoped_ptr<OptionalString::Params> params( OptionalString::Params::Create(*params_value)); EXPECT_TRUE(params.get()); @@ -100,7 +99,7 @@ TEST(JsonSchemaCompilerSimpleTest, OptionalBeforeRequired) { { scoped_ptr<base::ListValue> params_value(new base::ListValue()); params_value->Append(base::Value::CreateNullValue()); - params_value->Append(base::Value::CreateStringValue("asdf")); + params_value->Append(new base::StringValue("asdf")); scoped_ptr<OptionalBeforeRequired::Params> params( OptionalBeforeRequired::Params::Create(*params_value)); EXPECT_TRUE(params.get()); @@ -161,7 +160,7 @@ TEST(JsonSchemaCompilerSimpleTest, OnStringFiredCreate) { { scoped_ptr<base::ListValue> results(OnStringFired::Create("yo dawg")); base::ListValue expected; - expected.Append(base::Value::CreateStringValue("yo dawg")); + expected.Append(new base::StringValue("yo dawg")); EXPECT_TRUE(results->Equals(&expected)); } } |