Bug 564815 - Tests for window.devicePixelRatio

This commit is contained in:
Matt Brubeck 2012-11-26 09:52:19 -08:00
parent 7a3c11ea5e
commit 97a28ee558

View File

@ -38,6 +38,9 @@ function doTests()
var domWindowUtils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindowUtils);
var devPxPerCSSPx = domWindowUtils.screenPixelsPerCSSPixel;
is(window.devicePixelRatio, devPxPerCSSPx, "window.devicePixelRatio");
var windowBO = document.documentElement.boxObject;
isRounded(window.mozInnerScreenX*devPxPerCSSPx, windowBO.screenX,
"window screen X");
@ -64,6 +67,8 @@ function doTests()
is(frameDomWindowUtils.screenPixelsPerCSSPixel, 2*devPxPerCSSPx,
"frame screen pixels per CSS pixel");
is(f.contentWindow.devicePixelRatio, 2*devPxPerCSSPx, "frame devicePixelRatio");
isRounded(f.contentWindow.mozInnerScreenX*2,
window.mozInnerScreenX + fBounds.left,
"zoomed frame screen X");