Commit 5d024270 authored by skyostil@chromium.org's avatar skyostil@chromium.org

Ensure npapi plugin is loaded before clicking on it

PluginTest.SelfDeletePluginInvokeInSynchronousMouseUp loads a page with a
plugin and then simulates a mouse click on the plugin. Because the page load
event can fire before the plugin has actually finished loading, the test can
fail when the mouse event ends up getting sent too soon.

This patch improves the test by ensuring the plugin has been loaded. As
<embed> does not support a generic onload listener (each plugin needs to
implement one separately), we instead set a dummy property on the object,
which, as a side effect, forces the plugin to load synchronously.

BUG=391005

Review URL: https://codereview.chromium.org/487863002

Cr-Commit-Position: refs/heads/master@{#290637}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290637 0039d316-1c4b-4281-b951-d872f2087c98
parent 30853fe4
......@@ -35,6 +35,9 @@ of a synchronous mouse event.
</DIV>
<script>
var height = document.body.offsetHeight;
// Force plugin to be loaded so that we can click on it.
var embed = document.getElementById('1');
embed.dummy = true;
</script>
</body>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment