From 36a5009994b73f1a0ea5faedf3751459a7eed41e Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Thu, 12 May 2022 00:41:58 -0700 Subject: [PATCH] test: fix background transparency flake (#34190) --- spec-main/api-browser-window-spec.ts | 6 ++++-- .../fixtures/apps/background-color-transparent/main.js | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/spec-main/api-browser-window-spec.ts b/spec-main/api-browser-window-spec.ts index 6d76851d82b2e..b938b483b8c5e 100644 --- a/spec-main/api-browser-window-spec.ts +++ b/spec-main/api-browser-window-spec.ts @@ -1828,7 +1828,7 @@ describe('BrowserWindow module', () => { }); ifdescribe(process.platform === 'darwin')('BrowserWindow.setVibrancy(type)', () => { - let appProcess: childProcess.ChildProcessWithoutNullStreams | undefined; + let appProcess: childProcess.ChildProcessWithoutNullStreams | childProcess.ChildProcess | undefined; afterEach(() => { if (appProcess && !appProcess.killed) { @@ -1859,7 +1859,9 @@ describe('BrowserWindow module', () => { it('Allows setting a transparent window via CSS', async () => { const appPath = path.join(__dirname, 'fixtures', 'apps', 'background-color-transparent'); - appProcess = childProcess.spawn(process.execPath, [appPath]); + appProcess = childProcess.spawn(process.execPath, [appPath], { + stdio: 'inherit' + }); const [code] = await emittedOnce(appProcess, 'exit'); expect(code).to.equal(0); diff --git a/spec-main/fixtures/apps/background-color-transparent/main.js b/spec-main/fixtures/apps/background-color-transparent/main.js index 8d1da05c6c1db..3086db0dc6b97 100644 --- a/spec-main/fixtures/apps/background-color-transparent/main.js +++ b/spec-main/fixtures/apps/background-color-transparent/main.js @@ -21,6 +21,7 @@ async function createWindow () { transparent: true, vibrancy: 'under-window', webPreferences: { + backgroundThrottling: false, contextIsolation: false, nodeIntegration: true } @@ -43,6 +44,7 @@ ipcMain.on('set-transparent', async () => { colors.transparent = result[0].hex(); const { green, transparent } = colors; + console.log({ green, transparent }); process.exit(green === transparent ? 1 : 0); });