Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Unified Diff: content/test/data/browser_plugin_embedder_late_attach.html

Issue 23591016: BrowserPlugin/WebView - Move plugin lifetime to DOM (Chromium-side) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update BrowserPlugin tests to reflect new behaviour. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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";
+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>
« content/renderer/render_frame_impl.cc ('K') | « content/renderer/render_frame_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698