Bug 1532580 - Fix wpt reftest window dimensions, r=gsnedders
authorJames Graham <james@hoppipolla.co.uk>
Wed, 13 Mar 2019 13:10:02 +0000
changeset 464694 f798b9ef8e66
parent 464693 6c7b81bf956a
child 464695 cca61da626c0
push id35717
push useraciure@mozilla.com
push dateSun, 17 Mar 2019 09:45:26 +0000
treeherdermozilla-central@e0861be8d6c0 [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,
       };