Chromium Code Reviews| 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> |