Index: content/test/data/browser_plugin_embedder.html |
diff --git a/content/test/data/browser_plugin_embedder.html b/content/test/data/browser_plugin_embedder.html |
index 31a78467a65d57d70e50da1e131de0351542d808..b34f884d0e86c9e2d4fb2d410ec4f265e5443794 100644 |
--- a/content/test/data/browser_plugin_embedder.html |
+++ b/content/test/data/browser_plugin_embedder.html |
@@ -8,6 +8,10 @@ function SetSize(w, h) { |
plugin.width = w; |
plugin.height = h; |
} |
+function PostMessage(data) { |
+ plugin = document.getElementById('plugin'); |
+ plugin.postMessage('testing123', ''); |
nasko
2012/09/19 21:19:59
The second param is the target origin, right? If y
|
+} |
</script> |
<object id="plugin" |
@@ -16,3 +20,15 @@ function SetSize(w, h) { |
width="640" |
height="480" |
border="0px"></object> |
+<script type="text/javascript"> |
+var msg; |
+function receiveMessage(event) { |
+ msg = event.data; |
+ if (msg != 'stop_ack') { |
nasko
2012/09/19 21:19:59
Shouldn't that be !==?
Fady Samuel
2012/09/20 15:24:28
Done.
|
+ event.source.postMessage('stop', '*'); |
+ } else { |
+ window.document.title = 'stop_ack'; |
+ } |
+} |
+document.getElementById('plugin').addEventListener('message', receiveMessage, false); |
+</script> |