Bug 1263092 - Improve error logging when reftests fail due to the screen resolution being too low. r=dholbert
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 11 Jul 2016 13:11:08 +1200
changeset 344440 60fdac16b45828f1d2d979f3ff28c0783e8a2edc
parent 344439 2f89df793074acdd9a682c055cd7c9470409cf5e
child 344441 ad2cbcabbc571104bb0656668bdef187d0a1b122
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1263092
milestone50.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 1263092 - Improve error logging when reftests fail due to the screen resolution being too low. r=dholbert
layout/tools/reftest/reftest.jsm
--- a/layout/tools/reftest/reftest.jsm
+++ b/layout/tools/reftest/reftest.jsm
@@ -103,16 +103,17 @@ var gCount = 0;
 var gAssertionCount = 0;
 
 var gIOService;
 var gDebug;
 var gWindowUtils;
 
 var gSlowestTestTime = 0;
 var gSlowestTestURL;
+var gFailedUseWidgetLayers = false;
 
 var gDrawWindowFlags;
 
 var gExpectingProcessCrash = false;
 var gExpectedCrashDumpFiles = [];
 var gUnexpectedCrashDumpFiles = { };
 var gCrashDumpDir;
 var gFailedNoPaint = false;
@@ -207,16 +208,22 @@ function FlushTestBuffer()
   if (gLogLevel !== 'debug') {
     for (var i = 0; i < gTestLog.length; ++i) {
       logger.info("Saved log: " + gTestLog[i]);
     }
   }
   gTestLog = [];
 }
 
+function LogWidgetLayersFailure()
+{
+  logger.error("USE_WIDGET_LAYERS disabled because the screen resolution is too low. This falls back to an alternate rendering path (that may not be representative) and is not implemented with e10s enabled.");
+  logger.error("Consider increasing your screen resolution, or adding '--disable-e10s' to your './mach reftest' command");
+}
+
 function AllocateCanvas()
 {
     if (gRecycledCanvases.length > 0)
         return gRecycledCanvases.shift();
 
     var canvas = gContainingWindow.document.createElementNS(XHTML_NS, "canvas");
     var r = gBrowser.getBoundingClientRect();
     canvas.setAttribute("width", Math.ceil(r.width));
@@ -1383,16 +1390,19 @@ function StartCurrentURI(aState)
     }
 }
 
 function DoneTests()
 {
     logger.suiteEnd(extra={'results': gTestResults});
     logger.info("Slowest test took " + gSlowestTestTime + "ms (" + gSlowestTestURL + ")");
     logger.info("Total canvas count = " + gRecycledCanvases.length);
+    if (gFailedUseWidgetLayers) {
+        LogWidgetLayersFailure();
+    }
 
     function onStopped() {
         let appStartup = CC["@mozilla.org/toolkit/app-startup;1"].getService(CI.nsIAppStartup);
         appStartup.quit(CI.nsIAppStartup.eForceQuit);
     }
     if (gServer) {
         gServer.stop(onStopped);
     }
@@ -1444,17 +1454,18 @@ function DoDrawWindow(ctx, x, y, w, h)
         // Every time the flags change, dump the new state.
         gDrawWindowFlags = flags;
         var flagsStr = "DRAWWINDOW_DRAW_CARET | DRAWWINDOW_DRAW_VIEW";
         if (flags & ctx.DRAWWINDOW_USE_WIDGET_LAYERS) {
             flagsStr += " | DRAWWINDOW_USE_WIDGET_LAYERS";
         } else {
             // Output a special warning because we need to be able to detect
             // this whenever it happens.
-            logger.error("WARNING: USE_WIDGET_LAYERS disabled");
+            LogWidgetLayersFailure();
+            gFailedUseWidgetLayers = true;
         }
         logger.info("drawWindow flags = " + flagsStr +
                     "; window size = " + gContainingWindow.innerWidth + "," + gContainingWindow.innerHeight +
                     "; test browser size = " + testRect.width + "," + testRect.height);
     }
 
     TestBuffer("DoDrawWindow " + x + "," + y + "," + w + "," + h);
     ctx.drawWindow(gContainingWindow, x, y, w, h, "rgb(255,255,255)",