2011-05-16 16:05:46 -07:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Test whether windowed plugins with opacity:0 get their window set correctly</title>
|
|
|
|
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
|
|
|
|
|
|
|
<body onload="startTest()">
|
|
|
|
<p id="display"></p>
|
|
|
|
|
|
|
|
<embed id="theplugin" type="application/x-test" width="100" height="50" style="opacity:0" wmode="window"></embed>
|
|
|
|
|
|
|
|
<script type="application/javascript;version=1.8">
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
|
|
|
|
var p = document.getElementById('theplugin');
|
|
|
|
|
|
|
|
function startTest() {
|
2011-05-22 17:28:47 -07:00
|
|
|
if (!p.hasWidget()) {
|
|
|
|
todo(false, "This test is only relevant for windowed plugins");
|
|
|
|
SimpleTest.finish();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-05-16 16:05:46 -07:00
|
|
|
// 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");
|
|
|
|
is(p.getClipRegionRectEdge(0,2) - p.getClipRegionRectEdge(0,0), 100, "width of clip region rect");
|
|
|
|
is(p.getClipRegionRectEdge(0,3) - p.getClipRegionRectEdge(0,1), 50, "height of clip region rect");
|
|
|
|
}
|
|
|
|
</script>
|