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

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

Issue 263703002: Allow shared modules to whitelist extensions that import them. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: feedback Created 6 years, 8 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/crx_installer.cc ('k') | chrome/browser/extensions/shared_module_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/shared_module_apitest.cc
diff --git a/chrome/browser/extensions/shared_module_apitest.cc b/chrome/browser/extensions/shared_module_apitest.cc
index e10a46704e060025178a1ae033a52abba9dcb673..3b31496cf35c4a3c1e4ddd9fbbaf4a7d9398bf9c 100644
--- a/chrome/browser/extensions/shared_module_apitest.cc
+++ b/chrome/browser/extensions/shared_module_apitest.cc
@@ -6,12 +6,13 @@
using extensions::Extension;
+// NB: We use LoadExtension instead of InstallExtension for shared modules so
+// the public-keys in their manifests are used to generate the extension ID, so
+// it can be imported correctly. We use InstallExtension otherwise so the loads
+// happen through the CRX installer which validates imports.
+
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, SharedModule) {
// import_pass depends on this shared module.
- // NB: We use LoadExtension instead of InstallExtension here so the public-key
- // in 'shared' is used to generate the extension ID so it can be imported
- // correctly. We use InstallExtension otherwise so the loads happen through
- // the CRX installer which validates imports.
ASSERT_TRUE(LoadExtension(
test_data_dir_.AppendASCII("shared_module").AppendASCII("shared")));
@@ -24,3 +25,13 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, SharedModule) {
test_data_dir_.AppendASCII("shared_module")
.AppendASCII("import_non_existent"), 0));
}
+
+IN_PROC_BROWSER_TEST_F(ExtensionApiTest, SharedModuleWhitelist) {
+ ASSERT_TRUE(LoadExtension(
+ test_data_dir_.AppendASCII("shared_module")
+ .AppendASCII("shared_whitelist")));
+
+ EXPECT_FALSE(InstallExtension(
+ test_data_dir_.AppendASCII("shared_module")
+ .AppendASCII("import_not_in_whitelist"), 0));
+}
« no previous file with comments | « chrome/browser/extensions/crx_installer.cc ('k') | chrome/browser/extensions/shared_module_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698