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

Unified Diff: chrome/test/data/extensions/platform_apps/web_view/shim/main.js

Issue 24576003: <webview>: Change how plugin load works inside guests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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/test/data/extensions/platform_apps/web_view/shim/main.js
diff --git a/chrome/test/data/extensions/platform_apps/web_view/shim/main.js b/chrome/test/data/extensions/platform_apps/web_view/shim/main.js
index 0498d026f337ddf64b5b56f5131fb3590e42c5b4..56a9d388e071993d067be059ce00daf0d4520443 100644
--- a/chrome/test/data/extensions/platform_apps/web_view/shim/main.js
+++ b/chrome/test/data/extensions/platform_apps/web_view/shim/main.js
@@ -699,6 +699,31 @@ function testBrowserPluginNotAllowed() {
embedder.test.succeed();
}
+function testPluginLoadPermission() {
+ var pluginIdentifier = 'unknown platform';
+ if (navigator.platform.match(/linux/i))
+ pluginIdentifier = 'libppapi_tests.so';
+ else if (navigator.platform.match(/win32/i))
+ pluginIdentifier = 'ppapi_tests.dll';
+ else if (navigator.platform.match(/mac/i))
+ pluginIdentifier = 'ppapi_tests.plugin';
+
+ var webview = document.createElement('webview');
+ webview.addEventListener('permissionrequest', function(e) {
+ e.preventDefault();
+ embedder.test.assertEq('loadplugin', e.permission);
+ embedder.test.assertEq(pluginIdentifier, e.name);
+ embedder.test.assertEq(pluginIdentifier, e.identifier);
+ embedder.test.assertEq('function', typeof e.request.allow);
+ embedder.test.assertEq('function', typeof e.request.deny);
+ embedder.test.succeed();
+ });
+ webview.setAttribute('src', 'data:text/html,<body>' +
+ '<embed type="application/x-ppapi-tests">' +
+ '</embed></body>');
+ document.body.appendChild(webview);
+}
+
// This test verifies that new window attachment functions as expected.
function testNewWindow() {
var webview = document.createElement('webview');
@@ -1072,6 +1097,7 @@ embedder.test.testList = {
'testReassignSrcAttribute': testReassignSrcAttribute,
'testRemoveSrcAttribute': testRemoveSrcAttribute,
'testBrowserPluginNotAllowed': testBrowserPluginNotAllowed,
+ 'testPluginLoadPermission': testPluginLoadPermission,
'testNewWindow': testNewWindow,
'testNewWindowTwoListeners': testNewWindowTwoListeners,
'testNewWindowNoPreventDefault': testNewWindowNoPreventDefault,
« no previous file with comments | « chrome/renderer/resources/extensions/web_view_experimental.js ('k') | content/public/common/browser_plugin_permission_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698