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

Unified Diff: chrome/common/pepper_permission_util_unittest.cc

Issue 573113002: Relax shared module whitelist restriction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 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/common/pepper_permission_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/pepper_permission_util_unittest.cc
diff --git a/chrome/common/pepper_permission_util_unittest.cc b/chrome/common/pepper_permission_util_unittest.cc
index b31297db161fbae7e29d1dd10f12b1b20f6a701a..54ca829b2a1816e1104b241a14e1b409a3c76c4b 100644
--- a/chrome/common/pepper_permission_util_unittest.cc
+++ b/chrome/common/pepper_permission_util_unittest.cc
@@ -115,15 +115,19 @@ TEST(PepperPermissionUtilTest, SharedModuleWhitelisting) {
extensions.Insert(shared_module);
EXPECT_TRUE(IsExtensionOrSharedModuleWhitelisted(
GURL(extension_url), &extensions, whitelist));
- scoped_refptr<Extension> bad_ext =
+ scoped_refptr<Extension> not_in_sm_whitelist =
CreateExtensionImportingModule(shared_module->id(), bad_id);
- std::string bad_extension_url = std::string("chrome-extension://") +
- bad_ext->id() + std::string("/foo.html");
-
- extensions.Insert(bad_ext);
- // This should fail because bad_ext is not whitelisted to use shared_module.
- EXPECT_FALSE(IsExtensionOrSharedModuleWhitelisted(
- GURL(bad_extension_url), &extensions, whitelist));
+ std::string not_in_sm_whitelist_url = std::string("chrome-extension://") +
+ not_in_sm_whitelist->id() +
+ std::string("/foo.html");
+
+ extensions.Insert(not_in_sm_whitelist);
+ // This should succeed, even though |not_in_sm_whitelist| is not whitelisted
+ // to use shared_module, because the pepper permission utility does not care
+ // about that whitelist. It is possible to install against the whitelist as
+ // an unpacked extension.
+ EXPECT_TRUE(IsExtensionOrSharedModuleWhitelisted(
+ GURL(not_in_sm_whitelist_url), &extensions, whitelist));
// Note that the whitelist should be empty after this call, so tests checking
// for failure to import will fail because of this.
« no previous file with comments | « chrome/common/pepper_permission_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698