Backed out changeset fd98493f58fa (bug 1425358) screenshot failures at browser/tools/mozscreenshots/primaryUI/browser_primaryUI.js r=backout on a CLOSED TREE
authorCosmin Sabou <csabou@mozilla.com>
Fri, 15 Dec 2017 21:26:46 +0200
changeset 396567 8643a82e172d08f86bf3a08e773c1743cc5a69d3
parent 396566 63eff267ee3a8d5c2751e2778a5b9969140139d7
child 396568 26b24e77688e00861649d63f1964ffebc6981260
push id57050
push usercsabou@mozilla.com
push dateFri, 15 Dec 2017 19:34:17 +0000
treeherderautoland@8643a82e172d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1425358
milestone59.0a1
backs outfd98493f58fa4c5c9d55558c0d623fbc2ac9f3e6
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
Backed out changeset fd98493f58fa (bug 1425358) screenshot failures at browser/tools/mozscreenshots/primaryUI/browser_primaryUI.js r=backout on a CLOSED TREE
browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Tabs.jsm
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Tabs.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Tabs.jsm
@@ -10,32 +10,30 @@ const {classes: Cc, interfaces: Ci, util
 
 const CUST_TAB = "chrome://browser/skin/customize.svg";
 const PREFS_TAB = "chrome://browser/skin/settings.svg";
 const DEFAULT_FAVICON_TAB = `data:text/html,<meta charset="utf-8">
 <title>No favicon</title>`;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/Timer.jsm");
-Cu.import("resource://testing-common/TestUtils.jsm");
 
 this.Tabs = {
   init(libDir) {},
 
   configurations: {
     fiveTabs: {
       selectors: ["#tabbrowser-tabs"],
       async applyConfig() {
         fiveTabsHelper();
         let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
         hoverTab(browserWindow.gBrowser.tabs[3]);
         await new Promise((resolve, reject) => {
           setTimeout(resolve, 3000);
         });
-        await Promise.all(allTabTitlesDisplayed(browserWindow));
       },
     },
 
     fourPinned: {
       selectors: ["#tabbrowser-tabs"],
       async applyConfig() {
         fiveTabsHelper();
         let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
@@ -50,21 +48,19 @@ this.Tabs = {
         browserWindow.gBrowser.selectTabAtIndex(5);
         hoverTab(browserWindow.gBrowser.tabs[2]);
         // also hover the new tab button
         let newTabButton = browserWindow.document.getAnonymousElementByAttribute(browserWindow.
                            gBrowser.tabContainer, "class", "tabs-newtab-button");
         hoverTab(newTabButton);
         browserWindow.gBrowser.tabs[browserWindow.gBrowser.tabs.length - 1].
                       setAttribute("beforehovered", true);
-
         await new Promise((resolve, reject) => {
           setTimeout(resolve, 3000);
         });
-        await Promise.all(allTabTitlesDisplayed(browserWindow));
       },
     },
 
     twoPinnedWithOverflow: {
       selectors: ["#tabbrowser-tabs"],
       async applyConfig() {
         fiveTabsHelper();
 
@@ -104,55 +100,27 @@ this.Tabs = {
            inBackground: true,
            replace: true,
            triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal()
         });
         browserWindow.gBrowser.pinTab(browserWindow.gBrowser.tabs[1]);
         browserWindow.gBrowser.pinTab(browserWindow.gBrowser.tabs[2]);
         browserWindow.gBrowser.selectTabAtIndex(3);
         hoverTab(browserWindow.gBrowser.tabs[5]);
-
         await new Promise((resolve, reject) => {
           setTimeout(resolve, 3000);
         });
-        await Promise.all(allTabTitlesDisplayed(browserWindow));
       },
     },
   },
 };
 
 
 /* helpers */
 
-async function allTabTitlesDisplayed(browserWindow) {
-  let specToTitleMap = {
-    "about:home": "New Tab",
-    "about:newtab": "New Tab",
-    "about:addons": "Add-ons Manager",
-  };
-  specToTitleMap[PREFS_TAB] = "browser/skin/settings.svg";
-  specToTitleMap[CUST_TAB] = "browser/skin/customize.svg";
-  specToTitleMap[DEFAULT_FAVICON_TAB] = "No favicon";
-
-  let tabTitlePromises = [];
-  for (let tab of browserWindow.gBrowser.tabs) {
-    let tabTitleLoaded = () => {
-      let spec = tab.linkedBrowser &&
-                 tab.linkedBrowser.documentURI &&
-                 tab.linkedBrowser.documentURI.spec;
-      return spec ? tab.label == specToTitleMap[spec] : false;
-    };
-    let promise =
-      TestUtils.waitForCondition(tabTitleLoaded, `Tab should be showing ${tab.label}`);
-    tabTitlePromises.push(promise);
-  }
-
-  return tabTitlePromises;
-}
-
 function fiveTabsHelper() {
   // some with no favicon and some with. Selected tab in middle.
   closeAllButOneTab("about:addons");
 
   let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
   browserWindow.gBrowser.loadTabs([
     "about:addons",
     "about:home",