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(
|
const { TestUtils } = ChromeUtils.importESModule(
|
||||||
"resource://testing-common/TestUtils.sys.mjs"
|
"resource://testing-common/TestUtils.sys.mjs"
|
||||||
);
|
);
|
||||||
const { BrowserTestUtils } = ChromeUtils.importESModule(
|
|
||||||
"resource://testing-common/BrowserTestUtils.sys.mjs"
|
|
||||||
);
|
|
||||||
|
|
||||||
var Tabs = {
|
var Tabs = {
|
||||||
init(libDir) {},
|
init(libDir) {},
|
||||||
|
|
@ -132,13 +129,12 @@ var Tabs = {
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
setTimeout(resolve, 3000);
|
setTimeout(resolve, 3000);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Make sure the tabstrip is scrolled all the way to the left.
|
// Make sure the tabstrip is scrolled all the way to the left.
|
||||||
let scrolled = BrowserTestUtils.waitForEvent(
|
browserWindow.gBrowser.tabContainer.arrowScrollbox.scrollByIndex(
|
||||||
browserWindow.gBrowser.tabContainer.arrowScrollbox,
|
-100,
|
||||||
"scrollend"
|
true
|
||||||
);
|
);
|
||||||
browserWindow.gBrowser.tabContainer.arrowScrollbox.scrollByIndex(-100);
|
|
||||||
await scrolled;
|
|
||||||
|
|
||||||
await allTabTitlesDisplayed(browserWindow);
|
await allTabTitlesDisplayed(browserWindow);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue