Bug 1532580 - Fix wpt reftest window dimensions, r=gsnedders
☠☠ backed out by 66b1aba3fb43 ☠ ☠
authorJames Graham <james@hoppipolla.co.uk>
Wed, 13 Mar 2019 13:10:02 +0000
changeset 464360 95f1a7ff5760ed51b90ede77e65e98c5ffc629de
parent 464359 ad53fdccd298a17c68bb72c3fb24aa890387765b
child 464361 66b1aba3fb4372ec47986e728b1da9b32dd3d368
push id35713
push usercbrindusan@mozilla.com
push dateFri, 15 Mar 2019 21:55:43 +0000
treeherdermozilla-central@66b1aba3fb43 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgsnedders
bugs1532580
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1532580 - Fix wpt reftest window dimensions, r=gsnedders The wpt reftest window was mixing up width and height for initial opening, meaining that it would be the wrong shape for non-square configurations. This caused us to go down a path where we weren't passing DRAWWINDOW_USE_WIDGET_LAYERS which turns out to be broken and result in frequent blank screenshots. Fix the window dimensions and make the broken path an error instead. Differential Revision: https://phabricator.services.mozilla.com/D23323
testing/marionette/reftest.js
--- a/testing/marionette/reftest.js
+++ b/testing/marionette/reftest.js
@@ -123,17 +123,17 @@ reftest.Runner = class {
 
   async openWindow(width, height) {
     assert.positiveInteger(width);
     assert.positiveInteger(height);
 
     let reftestWin = this.parentWindow.open(
         "chrome://marionette/content/reftest.xul",
         "reftest",
-        `chrome,height=${width},width=${height}`);
+        `chrome,height=${height},width=${width}`);
 
     await new Promise(resolve => {
       reftestWin.addEventListener("load", resolve, {once: true});
     });
     return reftestWin;
   }
 
   setupWindow(reftestWin, width, height) {
@@ -455,26 +455,31 @@ max-width: ${width}px; max-height: ${hei
       } else {
         logger.debug("using new canvas");
         canvas = null;
       }
       reuseCanvas = !cache;
 
       let ctxInterface = win.CanvasRenderingContext2D;
       let flags = ctxInterface.DRAWWINDOW_DRAW_CARET |
-          ctxInterface.DRAWWINDOW_DRAW_VIEW;
+          ctxInterface.DRAWWINDOW_DRAW_VIEW |
+          ctxInterface.DRAWWINDOW_USE_WIDGET_LAYERS;
 
-      if (0 <= browserRect.left &&
-          0 <= browserRect.top &&
-          win.innerWidth >= browserRect.width &&
-          win.innerHeight >= browserRect.height) {
-        logger.debug("Using DRAWWINDOW_USE_WIDGET_LAYERS");
-        flags |= ctxInterface.DRAWWINDOW_USE_WIDGET_LAYERS;
-      } else {
-        logger.debug("Not using DRAWWINDOW_USE_WIDGET_LAYERS");
+      if (!(0 <= browserRect.left &&
+            0 <= browserRect.top &&
+            win.innerWidth >= browserRect.width &&
+            win.innerHeight >= browserRect.height)) {
+        logger.error(`Invalid window dimensions:
+browserRect.left: ${browserRect.left}
+browserRect.top: ${browserRect.top}
+win.innerWidth: ${win.innerWidth}
+browserRect.width: ${browserRect.width}
+win.innerHeight: ${win.innerHeight}
+browserRect.height: ${browserRect.height}`);
+        throw new Error("Window has incorrect dimensions");
       }
 
       url = new URL(url).href; // normalize the URL
       logger.debug(`Starting load of ${url}`);
       let navigateOpts = {
         commandId: this.driver.listener.activeMessageId,
         pageTimeout: timeout,
       };