From 8b380ee2f246dfbe2a95db0780462b7a8b8e0ab7 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Wed, 8 Feb 2023 12:40:24 -0800 Subject: [PATCH] test: ensure fullscreen test is retryable (#37179) spec: ensure fullscreen test is retryable --- spec/chromium-spec.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spec/chromium-spec.ts b/spec/chromium-spec.ts index 6ce63aa28554..45c28350cdcc 100644 --- a/spec/chromium-spec.ts +++ b/spec/chromium-spec.ts @@ -2270,17 +2270,19 @@ describe('iframe using HTML fullscreen API while window is OS-fullscreened', () ); let w: BrowserWindow, server: http.Server; - before(() => { + beforeEach(async () => { server = http.createServer(async (_req, res) => { res.writeHead(200, { 'Content-Type': 'text/html' }); res.write(await fullscreenChildHtml); res.end(); }); - server.listen(8989, '127.0.0.1'); - }); + await new Promise((resolve) => { + server.listen(8989, '127.0.0.1', () => { + resolve(); + }); + }); - beforeEach(() => { w = new BrowserWindow({ show: true, fullscreen: true,