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

Unified Diff: chrome/browser/extensions/extension_function_test_utils.cc

Issue 10919201: Make sure that a given app/extension requests only its own resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
Index: chrome/browser/extensions/extension_function_test_utils.cc
diff --git a/chrome/browser/extensions/extension_function_test_utils.cc b/chrome/browser/extensions/extension_function_test_utils.cc
index 820fbdef1ad6352826554ba5408ce70f2feca731..174748c24e2f70eb0f5fd26a5b9d764c1aa37de3 100644
--- a/chrome/browser/extensions/extension_function_test_utils.cc
+++ b/chrome/browser/extensions/extension_function_test_utils.cc
@@ -105,15 +105,24 @@ scoped_refptr<Extension> CreateEmptyExtension() {
scoped_refptr<Extension> CreateEmptyExtensionWithLocation(
Extension::Location location) {
+ return CreateEmptyExtension(location, std::string());
+}
+
+scoped_refptr<Extension> CreateEmptyExtension(Extension::Location location,
+ const std::string& id_input) {
std::string error;
const FilePath test_extension_path;
scoped_ptr<base::DictionaryValue> test_extension_value(
ParseDictionary("{\"name\": \"Test\", \"version\": \"1.0\"}"));
+ std::string id;
+ if (!id_input.empty())
+ CHECK(Extension::GenerateId(id_input, &id));
scoped_refptr<Extension> extension(Extension::Create(
test_extension_path,
location,
*test_extension_value.get(),
Extension::NO_FLAGS,
+ id,
&error));
EXPECT_TRUE(error.empty()) << "Could not parse test extension " << error;
return extension;

Powered by Google App Engine
This is Rietveld 408576698