Skip to content

Commit

Permalink
Introduce safety timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Jan 8, 2020
1 parent fffe60e commit a3b8eba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions webextensions/tests/test-new-tab.js
Original file line number Diff line number Diff line change
@@ -127,7 +127,10 @@ export async function testReopenedWithPositionByAnotherAddonImmediatelyWhileCrea
browser.tabs.onCreated.removeListener(onCreated);
try {
// wait until the tab is attached by TST
const start = Date.now();
while (true) {
if (Date.now() - start > 1000)
throw new Error('timeout');
await wait(1);
const tabs = await Utils.refreshTabs({ opened: tab });
if (!tabs.opened || !tabs.opened.$TST.parent)

0 comments on commit a3b8eba

Please sign in to comment.