test: fix background transparency flake (#34190)

This commit is contained in:
Samuel Attard 2022-05-12 00:41:58 -07:00 committed by GitHub
parent d67532ee9f
commit ba3aca8200
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -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);

View file

@ -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);
});