зеркало из https://github.com/mozilla/gecko-dev.git
bug 1333607 - fix some plugin tests to work on high dpi machines r=jimm
This commit is contained in:
Родитель
d07b805990
Коммит
95541ed5c6
|
@ -34,8 +34,9 @@
|
|||
|
||||
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), 26, "height of clip region rect");
|
||||
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), 26 * dpr, "height of clip region rect");
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -40,10 +40,11 @@ function runTests() {
|
|||
function verify(test,x,y,next) {
|
||||
var p = $("plugin1").getLastMouseX();
|
||||
const delta = 2;
|
||||
ok(p-delta <= x && x <= p+delta, "test"+test+" LastMouseX got " + p + " expected " + x +
|
||||
var dpr = window.devicePixelRatio / SpecialPowers.getFullZoom(window);
|
||||
ok(p-delta <= x * dpr && x * dpr <= p+delta, "test"+test+" LastMouseX got " + p + " expected " + x +
|
||||
" with fullZoom="+SpecialPowers.getFullZoom(window)+" MozTransform='"+$("container").style.MozTransform+"'");
|
||||
p = $("plugin1").getLastMouseY();
|
||||
ok(p-delta <= y && y <= p+delta, "test"+test+" LastMouseY got " + p + " expected " + y +
|
||||
ok(p-delta <= y * dpr && y * dpr <= p+delta, "test"+test+" LastMouseY got " + p + " expected " + y +
|
||||
" with fullZoom="+SpecialPowers.getFullZoom(window)+" MozTransform='"+$("container").style.MozTransform+"'");
|
||||
if (next) next();
|
||||
}
|
||||
|
|
|
@ -40,10 +40,11 @@ function runTests() {
|
|||
function verify(test,x,y,next) {
|
||||
var p = $("plugin1").getLastMouseX();
|
||||
const delta = 2;
|
||||
ok(p-delta <= x && x <= p+delta, "test"+test+" LastMouseX got " + p + " expected " + x +
|
||||
var dpr = window.devicePixelRatio / SpecialPowers.getFullZoom(window);
|
||||
ok(p-delta <= x * dpr && x * dpr <= p+delta, "test"+test+" LastMouseX got " + p + " expected " + x +
|
||||
" with fullZoom="+SpecialPowers.getFullZoom(window)+" MozTransform='"+$("container").style.MozTransform+"'");
|
||||
p = $("plugin1").getLastMouseY();
|
||||
ok(p-delta <= y && y <= p+delta, "test"+test+" LastMouseY got " + p + " expected " + y +
|
||||
ok(p-delta <= y * dpr && y * dpr <= p+delta, "test"+test+" LastMouseY got " + p + " expected " + y +
|
||||
" with fullZoom="+SpecialPowers.getFullZoom(window)+" MozTransform='"+$("container").style.MozTransform+"'");
|
||||
if (next) next();
|
||||
}
|
||||
|
|
|
@ -34,11 +34,12 @@
|
|||
|
||||
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");
|
||||
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");
|
||||
}
|
||||
</script>
|
||||
|
||||
<p id="display"></p>
|
||||
|
||||
<embed id="theplugin" type="application/x-test" width="100" height="50" style="opacity:0" wmode="window"></embed>
|
||||
<embed id="theplugin" type="application/x-test" width="100" height="50" style="opacity:0" wmode="window"></embed>
|
||||
|
|
Загрузка…
Ссылка в новой задаче