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

Unified Diff: extensions/common/file_util_unittest.cc

Issue 1308013005: Add scoped_ptr-safe base::Value to Dictionary/List conversion functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made conversions static members. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/common/file_util.cc ('k') | extensions/renderer/event_bindings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/file_util_unittest.cc
diff --git a/extensions/common/file_util_unittest.cc b/extensions/common/file_util_unittest.cc
index 586dbe2444bdc512362aed73150b09e7e7e2a82e..df82b8293ee5ac224137f569b7131a13855d0082 100644
--- a/extensions/common/file_util_unittest.cc
+++ b/extensions/common/file_util_unittest.cc
@@ -27,13 +27,13 @@ namespace extensions {
namespace {
scoped_refptr<Extension> LoadExtensionManifest(
- base::DictionaryValue* manifest,
+ const base::DictionaryValue& manifest,
const base::FilePath& manifest_dir,
Manifest::Location location,
int extra_flags,
std::string* error) {
scoped_refptr<Extension> extension =
- Extension::Create(manifest_dir, location, *manifest, extra_flags, error);
+ Extension::Create(manifest_dir, location, manifest, extra_flags, error);
return extension;
}
@@ -49,11 +49,8 @@ scoped_refptr<Extension> LoadExtensionManifest(
return NULL;
CHECK_EQ(base::Value::TYPE_DICTIONARY, result->GetType());
return LoadExtensionManifest(
- static_cast<base::DictionaryValue*>(result.get()),
- manifest_dir,
- location,
- extra_flags,
- error);
+ *base::DictionaryValue::From(result.Pass()).get(), manifest_dir, location,
+ extra_flags, error);
}
} // namespace
@@ -294,7 +291,7 @@ TEST_F(FileUtilTest, BackgroundScriptsMustExist) {
std::string error;
std::vector<extensions::InstallWarning> warnings;
scoped_refptr<Extension> extension = LoadExtensionManifest(
- value.get(), temp.path(), Manifest::UNPACKED, 0, &error);
+ *value.get(), temp.path(), Manifest::UNPACKED, 0, &error);
ASSERT_TRUE(extension.get()) << error;
EXPECT_FALSE(
@@ -308,8 +305,8 @@ TEST_F(FileUtilTest, BackgroundScriptsMustExist) {
scripts->Clear();
scripts->Append(new base::StringValue("http://google.com/foo.js"));
- extension = LoadExtensionManifest(
- value.get(), temp.path(), Manifest::UNPACKED, 0, &error);
+ extension = LoadExtensionManifest(*value.get(), temp.path(),
+ Manifest::UNPACKED, 0, &error);
ASSERT_TRUE(extension.get()) << error;
warnings.clear();
« no previous file with comments | « extensions/common/file_util.cc ('k') | extensions/renderer/event_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698