forked from mirrors/gecko-dev
Bug 1796690 - Use instant scrolls in test setup. r=dao
Do not wait for scrollend after a scroll that will not trigger a change in scroll position. A scrollend event will not be fired for a programatic scroll that will not change the scroll position. Differential Revision: https://phabricator.services.mozilla.com/D162341
This commit is contained in:
parent
26f639b478
commit
68a440975b
1 changed files with 4 additions and 8 deletions
|
|
@ -16,9 +16,6 @@ const { setTimeout } = ChromeUtils.importESModule(
|
|||
const { TestUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/TestUtils.sys.mjs"
|
||||
);
|
||||
const { BrowserTestUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/BrowserTestUtils.sys.mjs"
|
||||
);
|
||||
|
||||
var Tabs = {
|
||||
init(libDir) {},
|
||||
|
|
@ -132,13 +129,12 @@ var Tabs = {
|
|||
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.arrowScrollbox,
|
||||
"scrollend"
|
||||
browserWindow.gBrowser.tabContainer.arrowScrollbox.scrollByIndex(
|
||||
-100,
|
||||
true
|
||||
);
|
||||
browserWindow.gBrowser.tabContainer.arrowScrollbox.scrollByIndex(-100);
|
||||
await scrolled;
|
||||
|
||||
await allTabTitlesDisplayed(browserWindow);
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue