Bug 1756757 - [devtools] Use wait instead of waitForTime. r=nchevobbe

Differential Revision: https://phabricator.services.mozilla.com/D139482
This commit is contained in:
Alexandre Poirot 2022-02-25 12:10:53 +00:00
Родитель d1792a86b7
Коммит 560fbd9491
4 изменённых файлов: 3 добавлений и 13 удалений

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

@ -121,7 +121,7 @@ add_task(async function testReloadingStableOriginalSource() {
// There will initially be zero breakpoints, but wait to make sure none are
// installed while syncing.
await waitForTime(1000);
await wait(1000);
assertNotPaused(dbg);
is(dbg.selectors.getBreakpointCount(dbg), 0, "No breakpoints");

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

@ -37,7 +37,7 @@ add_task(async function() {
});
async function assertNoTooltip(dbg) {
await waitForTime(200);
await wait(200);
const el = findElement(dbg, "tooltip");
is(el, null, "Tooltip should not exist");
}

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

@ -43,7 +43,7 @@ add_task(async function() {
// Wait for some time, in order to wait for it to be paused
// in case we regress
await waitForTime(1000);
await wait(1000);
assertNotPaused(dbg);
});

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

@ -524,16 +524,6 @@ async function waitForPausedThread(dbg, thread) {
return waitForState(dbg, state => dbg.selectors.getIsPaused(thread));
}
/*
* useful for waiting for a short amount of time as
* a placeholder for a better waitForX handler.
*
* e.g await waitForTime(500)
*/
function waitForTime(ms) {
return new Promise(r => setTimeout(r, ms));
}
function isSelectedFrameSelected(dbg, state) {
const frame = dbg.selectors.getVisibleSelectedFrame();