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

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

Issue 2361453004: Add browsertest for Flash permission prompt (Closed)
Patch Set: Add browesrtest for Flash permission prompt Created 4 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/permissions/flash.html
diff --git a/chrome/test/data/permissions/flash.html b/chrome/test/data/permissions/flash.html
new file mode 100644
index 0000000000000000000000000000000000000000..6a9ae3819fffeba681ba35e54ea4cb2693629b84
--- /dev/null
+++ b/chrome/test/data/permissions/flash.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<script>
+ function triggerPrompt() {
+ document.getElementById('flash-link').click();
+ window.domAutomationController.send(true);
+ }
+
+ function flashIsEnabled() {
+ var plugin = document.getElementById('flash-object');
+ function handleEvent(event) {
+ if (event.data.source === 'getPowerSaverStatusResponse') {
+ plugin.removeEventListener('message', handleEvent);
+ window.domAutomationController.send(true);
+ }
+ }
+ plugin.addEventListener('message', handleEvent);
tommycli 2016/09/26 22:54:49 nit: I've seen this cool pattern recently: plugin
raymes 2016/09/27 04:05:41 Cool, thanks!
+ if (plugin.postMessage) {
+ plugin.postMessage('getPowerSaverStatus');
+ } else {
+ window.domAutomationController.send(false);
+ }
+ }
+</script>
+<body>
+ <object id="flash-object" name="plugin" data="test.swf"
+ type="application/x-shockwave-flash" width="400" height="100">
+ Flash not supported.
+ <br>
+ <a href="https://get.adobe.com/flashplayer/" id="flash-link">Download Flash.</a>
tommycli 2016/09/26 22:54:49 need line wrap here?
raymes 2016/09/27 04:05:41 Done.
+ </object>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698