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

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: Improve tests; fix merge conflicts. 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
« no previous file with comments | « chrome/browser/extensions/extension_function_test_utils.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2f8bfc6e1405f8c8e08d737d8d1fe138b0940aeb..d352966effec3bc49c29530b4a16cb4bf7243d27 100644
--- a/chrome/browser/extensions/extension_function_test_utils.cc
+++ b/chrome/browser/extensions/extension_function_test_utils.cc
@@ -109,24 +109,38 @@ scoped_refptr<Extension> CreateEmptyExtensionWithLocation(
Extension::Location location) {
scoped_ptr<base::DictionaryValue> test_extension_value(
ParseDictionary("{\"name\": \"Test\", \"version\": \"1.0\"}"));
- return CreateExtension(location, test_extension_value.get());
+ return CreateExtension(location, test_extension_value.get(), std::string());
+}
+
+scoped_refptr<Extension> CreateEmptyExtension(
+ const std::string& id_input) {
+ scoped_ptr<base::DictionaryValue> test_extension_value(
+ ParseDictionary("{\"name\": \"Test\", \"version\": \"1.0\"}"));
+ return CreateExtension(Extension::INTERNAL, test_extension_value.get(),
+ id_input);
}
scoped_refptr<Extension> CreateExtension(
base::DictionaryValue* test_extension_value) {
- return CreateExtension(Extension::INTERNAL, test_extension_value);
+ return CreateExtension(Extension::INTERNAL, test_extension_value,
+ std::string());
}
scoped_refptr<Extension> CreateExtension(
Extension::Location location,
- base::DictionaryValue* test_extension_value) {
+ base::DictionaryValue* test_extension_value,
+ const std::string& id_input) {
std::string error;
const FilePath test_extension_path;
+ 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,
Extension::NO_FLAGS,
+ id,
&error));
EXPECT_TRUE(error.empty()) << "Could not parse test extension " << error;
return extension;
« no previous file with comments | « chrome/browser/extensions/extension_function_test_utils.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698