Bug 1439875: Update browser_windowopen_flicker.js. r=florian
☠☠ backed out by be470e9c8c14 ☠ ☠
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 13 Mar 2018 09:18:58 +0100
changeset 408143 69550dec053475802f6159203843afcab2ffbd4e
parent 408142 f3b96ce3490b5d69eed821b53555c88363dbbd3d
child 408144 7f25473e9b293076691744bd99ef6d620f95bc10
push id100871
push userecoal95@gmail.com
push dateWed, 14 Mar 2018 19:48:44 +0000
treeherdermozilla-inbound@1ee033e0061a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs1439875
milestone61.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 1439875: Update browser_windowopen_flicker.js. r=florian To avoid hacking around the empty window, and handle the activation issue seen on Windows / OSX. MozReview-Commit-ID: oK3T8FKd5n
browser/base/content/test/performance/browser_startup_flicker.js
browser/base/content/test/performance/browser_windowopen_flicker.js
--- a/browser/base/content/test/performance/browser_startup_flicker.js
+++ b/browser/base/content/test/performance/browser_startup_flicker.js
@@ -17,26 +17,26 @@ add_task(async function() {
   let frames = Cu.cloneInto(startupRecorder.data.frames, {});
 
   let unexpectedRects = 0;
   let alreadyFocused = false;
   for (let i = 1; i < frames.length; ++i) {
     let frame = frames[i], previousFrame = frames[i - 1];
     let rects = compareFrames(frame, previousFrame);
 
-    // The first screenshot we get shows an unfocused browser window for some
-    // reason. This is likely due to the test harness, so we want to ignore it.
+    // The first screenshot we get in OSX / Windows shows an unfocused browser
+    // window for some reason. See bug 1445161.
+    //
     // We'll assume the changes we are seeing are due to this focus change if
     // there are at least 5 areas that changed near the top of the screen, but
     // will only ignore this once (hence the alreadyFocused variable).
     if (!alreadyFocused && rects.length > 5 && rects.every(r => r.y2 < 100)) {
       alreadyFocused = true;
-      // This is likely an issue caused by the test harness, but log it anyway.
       todo(false,
-           "the window should be focused at first paint, " + rects.toSource());
+           "bug 1445161 - the window should be focused at first paint, " + rects.toSource());
       continue;
     }
 
     rects = rects.filter(rect => {
       let width = frame.width;
 
       let exceptions = [
         /**
--- a/browser/base/content/test/performance/browser_windowopen_flicker.js
+++ b/browser/base/content/test/performance/browser_windowopen_flicker.js
@@ -66,27 +66,35 @@ add_task(async function() {
       Services.tm.idleDispatchToMainThread(() => {
         waitForIdle(count - 1);
       });
     })();
   });
   win.removeEventListener("MozAfterPaint", afterPaintListener);
 
   let unexpectedRects = 0;
-  let ignoreTinyPaint = true;
+  let alreadyFocused = false;
   for (let i = 1; i < frames.length; ++i) {
     let frame = frames[i], previousFrame = frames[i - 1];
-    if (ignoreTinyPaint &&
-        previousFrame.width == 1 && previousFrame.height == 1) {
-      todo(false, "shouldn't initially paint a 1x1px window");
+    let rects = compareFrames(frame, previousFrame);
+
+    // The first screenshot we get in OSX / Windows shows an unfocused browser
+    // window for some reason. See bug 1445161.
+    //
+    // We'll assume the changes we are seeing are due to this focus change if
+    // there are at least 5 areas that changed near the top of the screen, but
+    // will only ignore this once (hence the alreadyFocused variable).
+    if (!alreadyFocused && rects.length > 5 && rects.every(r => r.y2 < 100)) {
+      alreadyFocused = true;
+      todo(false,
+           "bug 1445161 - the window should be focused at first paint, " + rects.toSource());
       continue;
     }
 
-    ignoreTinyPaint = false;
-    let rects = compareFrames(frame, previousFrame).filter(rect => {
+    rects = rects.filter(rect => {
       let inRange = (val, min, max) => min <= val && val <= max;
       let width = frame.width;
 
       let exceptions = [
         {name: "bug 1421463 - reload toolbar icon shouldn't flicker",
          condition: r => r.h == 13 && inRange(r.w, 14, 16) && // icon size
                          inRange(r.y1, 40, 80) && // in the toolbar
                          // near the left side of the screen