From 28d8ed037c0969769cd1d618b1f668e4272e5118 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 12:13:27 +0200 Subject: [PATCH] test: cleanup RenderFrame lifespan tests (#47795) * test: cleanup RenderFrame lifespan tests Co-authored-by: John Kleinschmidt * test: disable navigator.serial tests on arm64 mac debug the hang test: disable navigator.bluetooth on arm64 mac Revert "test: disable navigator.bluetooth on arm64 mac" This reverts commit 4b53a8485a5ff391832c7da93d859f1aa8722e70. Revert "debug the hang" This reverts commit 00338f0d49a7918224822087b4510fa9db0686c3. Revert "test: disable navigator.serial tests on arm64 mac" This reverts commit fb515ce447a9d42185e84b17b460e4fb6d1bf71d. Reapply "test: disable navigator.serial tests on arm64 mac" This reverts commit 0e5608108ffebbe8b8b27af9ea06aadae2ea85dd. Reapply "test: disable navigator.bluetooth on arm64 mac" This reverts commit f4c7d3fc0624a22421cba5d3d75df8c5d4367eea. fixup Co-authored-by: John Kleinschmidt * test: add waitUntil for flaky test Co-authored-by: John Kleinschmidt --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt --- spec/api-web-frame-main-spec.ts | 5 ++++- spec/chromium-spec.ts | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/spec/api-web-frame-main-spec.ts b/spec/api-web-frame-main-spec.ts index 236140780a88..9f583786f215 100644 --- a/spec/api-web-frame-main-spec.ts +++ b/spec/api-web-frame-main-spec.ts @@ -313,6 +313,7 @@ describe('webFrameMain module', () => { beforeEach(async () => { w = new BrowserWindow({ show: false }); }); + afterEach(closeAllWindows); // TODO(jkleinsc) fix this flaky test on linux ifit(process.platform !== 'linux')('throws upon accessing properties when disposed', async () => { @@ -373,7 +374,9 @@ describe('webFrameMain module', () => { await w.webContents.loadURL(server.crossOriginUrl); // senderFrame now points to a disposed RenderFrameHost. It should // be null when attempting to access the lazily evaluated property. - expect(event.senderFrame).to.be.null(); + waitUntil(() => { + return event.senderFrame === null; + }); }); it('is detached when unload handler sends IPC', async () => { diff --git a/spec/chromium-spec.ts b/spec/chromium-spec.ts index 68e013ec4e5c..db5cb3201d89 100644 --- a/spec/chromium-spec.ts +++ b/spec/chromium-spec.ts @@ -3089,7 +3089,7 @@ describe('iframe using HTML fullscreen API while window is OS-fullscreened', () }); }); -describe('navigator.serial', () => { +ifdescribe(process.platform !== 'darwin' || process.arch !== 'arm64')('navigator.serial', () => { let w: BrowserWindow; before(async () => { w = new BrowserWindow({ @@ -3621,7 +3621,7 @@ ifdescribe((process.platform !== 'linux' || app.isUnityRunning()))('navigator.se }); }); -describe('navigator.bluetooth', () => { +ifdescribe(process.platform !== 'darwin' || process.arch !== 'arm64')('navigator.bluetooth', () => { let w: BrowserWindow; before(async () => { w = new BrowserWindow({