2012-10-19 06:21:19 -07:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Test for Bug 787619</title>
|
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
2013-02-15 13:20:00 -08:00
|
|
|
<script type="application/javascript;version=1.7" src="head_plain.js"></script>
|
2012-10-19 06:21:19 -07:00
|
|
|
<script>
|
|
|
|
SpecialPowers.setBoolPref('plugins.click_to_play', true);
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<a id="wrapper">
|
|
|
|
<embed id="plugin" style="width: 200px; height: 200px" type="application/x-test">
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<script class="testbody" type="application/javascript;version=1.7">
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
|
2013-02-25 10:43:03 -08:00
|
|
|
const Ci = SpecialPowers.Ci;
|
2012-10-19 06:21:19 -07:00
|
|
|
let wrapperClickCount = 0;
|
|
|
|
|
|
|
|
function test1() {
|
|
|
|
let plugin = document.getElementById('plugin');
|
|
|
|
ok(plugin, 'got plugin element');
|
|
|
|
let objLC = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
|
|
|
ok(!objLC.activated, 'plugin should not be activated');
|
|
|
|
|
|
|
|
synthesizeMouseAtCenter(plugin, {});
|
|
|
|
waitForCondition(function() objLC.activated, test2,
|
|
|
|
'waited too long for plugin to activate');
|
|
|
|
}
|
|
|
|
|
|
|
|
function test2() {
|
|
|
|
is(wrapperClickCount, 0, 'wrapper should not have received any clicks');
|
|
|
|
SpecialPowers.clearUserPref('plugins.click_to_play');
|
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
let wrapper = document.getElementById('wrapper');
|
|
|
|
wrapper.addEventListener('click', function() ++wrapperClickCount, false);
|
|
|
|
SimpleTest.waitForFocus(test1);
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|