Bug 1381817 - Scroll tabstrip to the beginning in mozscreenshots twoPinnedWithOverflow config. r=MattN
MozReview-Commit-ID: 9NCRXVkcU6s
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Tabs.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Tabs.jsm
@@ -10,16 +10,17 @@ 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/BrowserTestUtils.jsm");
this.Tabs = {
init(libDir) {},
configurations: {
fiveTabs: {
selectors: ["#tabbrowser-tabs"],
async applyConfig() {
@@ -103,16 +104,20 @@ this.Tabs = {
});
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);
});
+ // Make sure the tabstrip is scrolled all the way to the left.
+ let scrolled = BrowserTestUtils.waitForEvent(browserWindow.gBrowser.tabContainer, "scrollend");
+ browserWindow.gBrowser.tabContainer.arrowScrollbox.scrollByIndex(-100);
+ await scrolled;
},
},
},
};
/* helpers */