Index: content/test/data/browser_plugin_embedder_late_attach.html |
diff --git a/content/test/data/browser_plugin_embedder.html b/content/test/data/browser_plugin_embedder_late_attach.html |
similarity index 65% |
copy from content/test/data/browser_plugin_embedder.html |
copy to content/test/data/browser_plugin_embedder_late_attach.html |
index b48ecdd8bc2674fba5be7da32c6cd85f56f5416c..9fd984906f58bf3bff32cd5651a1b430259abdc6 100644 |
--- a/content/test/data/browser_plugin_embedder.html |
+++ b/content/test/data/browser_plugin_embedder_late_attach.html |
@@ -1,13 +1,24 @@ |
<script type="text/javascript"> |
-function SetSrc(src) { |
- var plugin = document.getElementById('plugin'); |
- plugin.src = src; |
-} |
-function SetSize(w, h) { |
- var plugin = document.getElementById('plugin'); |
- plugin.width = w; |
- plugin.height = h; |
+ |
+function SetTitle(str) { |
+ document.title = str; |
} |
+document.title = 'embedder'; |
+ |
+var thePlugin = document.createElement('object'); |
+ |
+thePlugin.id = "plugin"; |
+thePlugin.tabindex = "0"; |
+thePlugin.type = "application/browser-plugin"; |
eseidel
2013/11/18 22:11:08
That's quite the generic mimetype ya'll have chose
|
+thePlugin.width = "640"; |
+thePlugin.height = "480"; |
+thePlugin.border = "0px"; |
+ |
+window.addEventListener('message', receiveMessage, false); |
+thePlugin.addEventListener('-internal-instanceid-allocated', function(e) { |
+ thePlugin['-internal-attach']({}); |
+}); |
+ |
function PostMessage(data, shouldTargetIframe) { |
plugin = document.getElementById('plugin'); |
// TODO(fsamuel): contentWindow can be accessed directly once |
@@ -18,19 +29,11 @@ function PostMessage(data, shouldTargetIframe) { |
plugin.contentWindow.frames.postMessage('testing123', '*'); |
} |
} |
-function SetTitle(str) { |
- document.title = str; |
+ |
+function SetSrc(src) { |
+ thePlugin.src = src; |
} |
-document.title = 'embedder'; |
-</script> |
-<object id="plugin" |
- tabindex="0" |
- type="application/browser-plugin" |
- width="640" |
- height="480" |
- border="0px"></object> |
-<script type="text/javascript"> |
var msg; |
function receiveMessage(event) { |
msg = event.data; |
@@ -50,9 +53,10 @@ function receiveMessage(event) { |
} |
} |
-var plugin = document.getElementById('plugin'); |
-window.addEventListener('message', receiveMessage, false); |
-plugin.addEventListener('-internal-instanceid-allocated', function(e) { |
- plugin['-internal-attach']({}); |
-}); |
+function attachPlugin() { |
+ document.getElementById('pluginContainer').appendChild(thePlugin); |
+} |
+ |
</script> |
+ |
+<div id="pluginContainer"></div> |