Bug 1712006 - Speed up browser_gc_schedule.js with Promise.all and removing unnecessary waitForNewTab calls r=pbone

Differential Revision: https://phabricator.services.mozilla.com/D115554
This commit is contained in:
Steve Fink 2021-05-21 22:08:06 +00:00
Родитель 1c23491f71
Коммит ccaf13bf0a
1 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@ -124,24 +124,24 @@ function checkAllCompleted(events, expectTabsCompleted) {
}
async function setupTabs(num_tabs) {
var tabs = [];
var pids = [];
const parent_pid = getProcessID();
info("Parent process PID is " + parent_pid);
for (var i = 0; i < num_tabs; i++) {
var newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser, null, true);
const tab = await BrowserTestUtils.openNewForegroundTab({
gBrowser,
opening: TEST_PAGE,
forceNewProcess: true,
});
// Make sure the tab is ready
await newTabPromise;
tabs[i] = tab;
const tabs = await Promise.all(
Array(num_tabs)
.fill()
.map(_ => {
return BrowserTestUtils.openNewForegroundTab({
gBrowser,
opening: TEST_PAGE,
forceNewProcess: true,
});
})
);
for (const [i, tab] of Object.entries(tabs)) {
const tab_pid = await SpecialPowers.spawn(
tab.linkedBrowser,
[],