Chromium Code Reviews| Index: content/test/data/browser_plugin_post_message_guest.html |
| diff --git a/content/test/data/browser_plugin_post_message_guest.html b/content/test/data/browser_plugin_post_message_guest.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..57c1c3c452c800535a6c6bfafc063bd1002e3fd3 |
| --- /dev/null |
| +++ b/content/test/data/browser_plugin_post_message_guest.html |
| @@ -0,0 +1,23 @@ |
| +<script> |
| + var embedder; |
| + function receiveMessage(event) { |
| + embedder = event.source; |
| + if (event.data !== 'stop') { |
| + event.source.postMessage('foobar', '*'); |
| + } else { |
| + if (event.data !== '') { |
| + event.source.postMessage('stop_ack ' + window.name, '*'); |
|
Charlie Reis
2012/10/12 00:31:43
Hmm, the window.name stuff is only useful on the i
Fady Samuel
2012/10/12 18:07:53
Sure, I'll work on that next.
|
| + } |
| + } |
| + } |
| + window.addEventListener('message', receiveMessage, false); |
| + function CreateChildFrame(src) { |
| + var ifrm = document.createElement("IFRAME"); |
| + ifrm.style.width = "640px"; |
| + ifrm.style.height = "480px"; |
| + ifrm.src = src; |
| + ifrm.name = 'iframe'; |
| + document.body.appendChild(ifrm); |
| + embedder.postMessage('ready', '*'); |
| + } |
| +</script> |