зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
1c23491f71
Коммит
ccaf13bf0a
|
@ -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,
|
||||
[],
|
||||
|
|
Загрузка…
Ссылка в новой задаче