diff --git a/dom/canvas/test/chrome/test_drawWindow_widget_layers.html b/dom/canvas/test/chrome/test_drawWindow_widget_layers.html index 9ff1f9f873dc..a1f357f5a74a 100644 --- a/dom/canvas/test/chrome/test_drawWindow_widget_layers.html +++ b/dom/canvas/test/chrome/test_drawWindow_widget_layers.html @@ -19,18 +19,22 @@ return; } + // Add a little bottom padding to the window so that we don't capture the + // rounded corners at the bottom, which our GL drawing code on OS X draws + // for regular windows. + // (The reftest framework doesn't have this problem because it doesn't use + // a regular window with a titlebar, so there are no rounded corners.) + const WINDOW_INNER_WIDTH = CANVAS_WIDTH; + const WINDOW_INNER_HEIGHT = CANVAS_HEIGHT + 10; + // Need to open as a toplevel chrome window so that // DRAWWINDOW_USE_WIDGET_LAYERS is honored. sourceWindow = window.open("file_drawWindow_source.html", "", - "chrome,width=200,height=100"); - sourceWindow.addEventListener("load", runTests, false); + `chrome,width=${WINDOW_INNER_WIDTH},height=${WINDOW_INNER_HEIGHT}`); + SimpleTest.waitForFocus(runTests, sourceWindow); } - function runTests(event) { - if (event.target != sourceWindow.document) { - return; - } - + function runTests() { var cxInterfaceWrap = SpecialPowers.wrap(CanvasRenderingContext2D); var flags = cxInterfaceWrap.DRAWWINDOW_USE_WIDGET_LAYERS | cxInterfaceWrap.DRAWWINDOW_DRAW_CARET | diff --git a/dom/canvas/test/file_drawWindow_common.js b/dom/canvas/test/file_drawWindow_common.js index 822b499a0f97..2f4c385d3a53 100644 --- a/dom/canvas/test/file_drawWindow_common.js +++ b/dom/canvas/test/file_drawWindow_common.js @@ -1,6 +1,7 @@ +const CANVAS_WIDTH = 200; +const CANVAS_HEIGHT = 100; + function runDrawWindowTests(win, drawWindowFlags, transparentBackground) { - const CANVAS_WIDTH = 200; - const CANVAS_HEIGHT = 100; function make_canvas() { var canvas = document.createElement("canvas");