Bug 947753 - Make test_drawWindow_widget_layers.html wait for the opened window to be visible. r=dbaron

Without this change, the test would fail because OMTC windows on OS X refuse to composite until they're visible.
This commit is contained in:
Markus Stange 2015-04-30 23:06:35 -04:00
Родитель 9610791e34
Коммит 08a4aeb70b
2 изменённых файлов: 14 добавлений и 9 удалений

Просмотреть файл

@ -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 |

Просмотреть файл

@ -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");