| 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 dc2e780d72bebc3e23816992d104a631272d9307..3550ee50adf55752624392d9920547c5a9df775b 100644
|
| --- a/content/test/data/browser_plugin_embedder.html
|
| +++ b/content/test/data/browser_plugin_embedder.html
|
| @@ -8,6 +8,16 @@ function SetSize(w, h) {
|
| plugin.width = w;
|
| plugin.height = h;
|
| }
|
| +function PostMessage(data, targetiframe) {
|
| + plugin = document.getElementById('plugin');
|
| + // TODO(fsamuel): contentWindow can be accessed directly once
|
| + // http://wkbug.com/85679 lands.
|
| + if (targetiframe) {
|
| + plugin.contentWindow.frames[0].postMessage('testing123', '*');
|
| + } else {
|
| + plugin.contentWindow.frames.postMessage('testing123', '*');
|
| + }
|
| +}
|
| function Back() {
|
| var plugin = document.getElementById('plugin');
|
| plugin.back();
|
| @@ -33,3 +43,24 @@ window.document.title = 'embedder';
|
| width="640"
|
| height="480"
|
| border="0px"></object>
|
| +<script type="text/javascript">
|
| +var msg;
|
| +function receiveMessage(event) {
|
| + msg = event.data;
|
| + if (msg == 'ready') {
|
| + document.title = 'ready';
|
| + return;
|
| + }
|
| + if (msg.indexOf('stop_ack') == -1) {
|
| + event.source.postMessage('stop', '*');
|
| + } else {
|
| + var name = msg.replace("stop_ack", "").trim();
|
| + if (name !== '') {
|
| + window.document.title = name;
|
| + } else {
|
| + window.document.title = 'main guest';
|
| + }
|
| + }
|
| +}
|
| +document.getElementById('plugin').addEventListener('message', receiveMessage, false);
|
| +</script>
|
|
|