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

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

Issue 2385033002: Hookup the plugin placeholder to the Flash permission prompt (Closed)
Patch Set: Hookup the plugin placeholder to the Flash permission 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/browser/plugins/plugin_observer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/permissions/flash.html
diff --git a/chrome/test/data/permissions/flash.html b/chrome/test/data/permissions/flash.html
index d5bb3f175592cf0fb816ae117d4ee1f01847268d..dc9ccf154129d0effa6d8b281d94a18ec181595f 100644
--- a/chrome/test/data/permissions/flash.html
+++ b/chrome/test/data/permissions/flash.html
@@ -11,10 +11,14 @@
window.domAutomationController.send(true);
}
- function flashIsEnabled() {
- var plugin = document.getElementById('flash-object');
+ function triggerPromptViaPluginPlaceholder() {
tommycli 2016/10/03 17:28:50 I think this function is not used.
raymes 2016/10/04 05:07:21 Done.
+ document.getElementById('flash-object-no-fallback').click();
+ window.domAutomationController.send(true);
+ }
+
+ function flashIsEnabledForPlugin(plugin) {
plugin.addEventListener('message', function handleEvent(event) {
- if (event.data.source === 'getPowerSaverStatusResponse') {
+ if (event.data.source === 'getPowerSaverStatusResponse') {
plugin.removeEventListener('message', handleEvent);
window.domAutomationController.send(true);
}
@@ -25,9 +29,21 @@
window.domAutomationController.send(false);
tommycli 2016/10/03 17:28:50 I wonder if this is the source of the flakiness.
raymes 2016/10/04 05:07:21 postMessage should appear synchronously on the pep
}
}
+
+ function flashIsEnabled() {
+ flashIsEnabledForPlugin(document.getElementById('flash-object'));
+ }
+
+ function flashIsEnabledForPluginWithoutFallack() {
tommycli 2016/10/03 17:28:50 This is getting confusing. Perhaps split into mult
raymes 2016/10/04 05:07:21 Splitting it into another test will add its own co
+ flashIsEnabledForPlugin(
+ document.getElementById('flash-object-no-fallback'));
+ }
</script>
<body>
- <object id="flash-object" name="plugin" data="test.swf"
+ <object id="flash-object-no-fallback" data="test.swf"
+ type="application/x-shockwave-flash" width="400" height="100">
+ </object>
+ <object id="flash-object" data="test.swf"
type="application/x-shockwave-flash" width="400" height="100">
Flash not supported.
<br>
« no previous file with comments | « chrome/browser/plugins/plugin_observer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698