2015-11-17 01:54:12 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Test whether windowed plugins with opacity:0 get their window set correctly</title>
|
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
2015-11-17 01:54:12 +03:00
|
|
|
<script type="text/javascript" src="plugin-utils.js"></script>
|
2015-11-17 01:54:12 +03:00
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
|
|
|
|
|
|
|
<body onload="startTest()">
|
2017-02-23 00:10:07 +03:00
|
|
|
<script type="application/javascript">
|
2015-11-17 01:54:12 +03:00
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
|
|
|
|
|
|
|
|
var p = null;
|
|
|
|
|
|
|
|
function startTest() {
|
|
|
|
p = document.getElementById('theplugin');
|
|
|
|
if (!p.hasWidget()) {
|
|
|
|
todo(false, "This test is only relevant for windowed plugins");
|
|
|
|
SimpleTest.finish();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Wait for the plugin to have painted once.
|
|
|
|
var interval = setInterval(function() {
|
|
|
|
if (!p.getPaintCount())
|
|
|
|
return;
|
|
|
|
|
|
|
|
clearInterval(interval);
|
|
|
|
doTest();
|
|
|
|
SimpleTest.finish();
|
|
|
|
}, 100);
|
|
|
|
}
|
|
|
|
|
|
|
|
function doTest() {
|
|
|
|
is(p.getClipRegionRectCount(), 1, "getClipRegionRectCount should be a single rect");
|
2017-01-27 00:09:41 +03:00
|
|
|
var dpr = window.devicePixelRatio;
|
|
|
|
is(p.getClipRegionRectEdge(0,2) - p.getClipRegionRectEdge(0,0), 100 * dpr, "width of clip region rect");
|
|
|
|
is(p.getClipRegionRectEdge(0,3) - p.getClipRegionRectEdge(0,1), 50 * dpr, "height of clip region rect");
|
2015-11-17 01:54:12 +03:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<p id="display"></p>
|
|
|
|
|
2017-01-27 00:09:41 +03:00
|
|
|
<embed id="theplugin" type="application/x-test" width="100" height="50" style="opacity:0" wmode="window"></embed>
|