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

Unified Diff: chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc

Issue 1739183003: Make extensions::DictionaryBuilder and extensions::ListValue unmovable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc
diff --git a/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc b/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc
index 481852800f6121fae41ab082ffe898683e685df9..c008601bb119c44f37d1bf651987f0c9370548df 100644
--- a/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc
+++ b/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc
@@ -84,17 +84,17 @@ class ExtensionInfoGeneratorUnitTest : public ExtensionServiceTestBase {
const scoped_refptr<const Extension> CreateExtension(
const std::string& name,
- ListBuilder permissions) {
+ scoped_ptr<base::ListValue> permissions) {
const std::string kId = crx_file::id_util::GenerateId(name);
scoped_refptr<const Extension> extension =
ExtensionBuilder()
- .SetManifest(
- std::move(DictionaryBuilder()
- .Set("name", name)
- .Set("description", "an extension")
- .Set("manifest_version", 2)
- .Set("version", "1.0.0")
- .Set("permissions", std::move(permissions))))
+ .SetManifest(DictionaryBuilder()
+ .Set("name", name)
+ .Set("description", "an extension")
+ .Set("manifest_version", 2)
+ .Set("version", "1.0.0")
+ .Set("permissions", std::move(permissions))
+ .Build())
.SetLocation(Manifest::INTERNAL)
.SetID(kId)
.Build();
@@ -187,7 +187,7 @@ TEST_F(ExtensionInfoGeneratorUnitTest, BasicInfoTest) {
.Set("version", kVersion)
.Set("manifest_version", 2)
.Set("description", "an extension")
- .Set("permissions", std::move(ListBuilder().Append("file://*/*")))
+ .Set("permissions", ListBuilder().Append("file://*/*").Build())
.Build();
scoped_ptr<base::DictionaryValue> manifest_copy(manifest->DeepCopy());
scoped_refptr<const Extension> extension =
@@ -353,9 +353,9 @@ TEST_F(ExtensionInfoGeneratorUnitTest, ExtensionInfoRunOnAllUrls) {
FeatureSwitch::scripts_require_action(), true));
// Two extensions - one with all urls, one without.
scoped_refptr<const Extension> all_urls_extension = CreateExtension(
- "all_urls", std::move(ListBuilder().Append(kAllHostsPermission)));
+ "all_urls", ListBuilder().Append(kAllHostsPermission).Build());
scoped_refptr<const Extension> no_urls_extension =
- CreateExtension("no urls", ListBuilder());
+ CreateExtension("no urls", ListBuilder().Build());
scoped_ptr<developer::ExtensionInfo> info =
GenerateExtensionInfo(all_urls_extension->id());
@@ -400,7 +400,7 @@ TEST_F(ExtensionInfoGeneratorUnitTest, ExtensionInfoRunOnAllUrls) {
// Load another extension with all urls (so permissions get re-init'd).
all_urls_extension = CreateExtension(
- "all_urls_II", std::move(ListBuilder().Append(kAllHostsPermission)));
+ "all_urls_II", ListBuilder().Append(kAllHostsPermission).Build());
// Even though the extension has all_urls permission, the checkbox shouldn't
// show up without the switch.

Powered by Google App Engine
This is Rietveld 408576698