Skip to content

Commit

Permalink
test: fix background transparency flake (#34190)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed May 12, 2022
1 parent d67532e commit ba3aca8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spec-main/api-browser-window-spec.ts
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions spec-main/fixtures/apps/background-color-transparent/main.js
Expand Up @@ -21,6 +21,7 @@ async function createWindow () {
transparent: true,
vibrancy: 'under-window',
webPreferences: {
backgroundThrottling: false,
contextIsolation: false,
nodeIntegration: true
}
Expand All @@ -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);
});

Expand Down

0 comments on commit ba3aca8

Please sign in to comment.