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

Unified Diff: chrome/test/data/permissions/flash.js

Issue 2391743005: Make the flash permission prompt work properly on file: URLs (Closed)
Patch Set: test prompt Created 4 years, 2 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/test/data/permissions/flash.html ('k') | chrome/test/data/permissions/flash2.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/permissions/flash.js
diff --git a/chrome/test/data/permissions/flash.js b/chrome/test/data/permissions/flash.js
new file mode 100644
index 0000000000000000000000000000000000000000..0331ce251b0ab40d0d4d166842cfe079b122bf4d
--- /dev/null
+++ b/chrome/test/data/permissions/flash.js
@@ -0,0 +1,35 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+function triggerPrompt() {
+ document.getElementById('flash-link').click();
+ window.domAutomationController.send(true);
+}
+
+function triggerPromptViaNewWindow() {
+ document.getElementById('flash-new-window-link').click();
+ window.domAutomationController.send(true);
+}
+
+function flashIsEnabledForPlugin(plugin) {
+ plugin.addEventListener('message', function handleEvent(event) {
+ if (event.data.source === 'getPowerSaverStatusResponse') {
+ plugin.removeEventListener('message', handleEvent);
+ window.domAutomationController.send(true);
+ }
+ });
+ if (plugin.postMessage)
+ plugin.postMessage('getPowerSaverStatus');
+ else
+ window.domAutomationController.send(false);
+}
+
+function flashIsEnabled() {
+ flashIsEnabledForPlugin(document.getElementById('flash-object'));
+}
+
+function flashIsEnabledForPluginWithoutFallback() {
+ flashIsEnabledForPlugin(
+ document.getElementById('flash-object-no-fallback'));
+}
« no previous file with comments | « chrome/test/data/permissions/flash.html ('k') | chrome/test/data/permissions/flash2.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698