test: fix background transparency flake (#34190)
This commit is contained in:
parent
d67532ee9f
commit
ba3aca8200
2 changed files with 6 additions and 2 deletions
|
@ -1828,7 +1828,7 @@ describe('BrowserWindow module', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
ifdescribe(process.platform === 'darwin')('BrowserWindow.setVibrancy(type)', () => {
|
ifdescribe(process.platform === 'darwin')('BrowserWindow.setVibrancy(type)', () => {
|
||||||
let appProcess: childProcess.ChildProcessWithoutNullStreams | undefined;
|
let appProcess: childProcess.ChildProcessWithoutNullStreams | childProcess.ChildProcess | undefined;
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
if (appProcess && !appProcess.killed) {
|
if (appProcess && !appProcess.killed) {
|
||||||
|
@ -1859,7 +1859,9 @@ describe('BrowserWindow module', () => {
|
||||||
it('Allows setting a transparent window via CSS', async () => {
|
it('Allows setting a transparent window via CSS', async () => {
|
||||||
const appPath = path.join(__dirname, 'fixtures', 'apps', 'background-color-transparent');
|
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');
|
const [code] = await emittedOnce(appProcess, 'exit');
|
||||||
expect(code).to.equal(0);
|
expect(code).to.equal(0);
|
||||||
|
|
|
@ -21,6 +21,7 @@ async function createWindow () {
|
||||||
transparent: true,
|
transparent: true,
|
||||||
vibrancy: 'under-window',
|
vibrancy: 'under-window',
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
|
backgroundThrottling: false,
|
||||||
contextIsolation: false,
|
contextIsolation: false,
|
||||||
nodeIntegration: true
|
nodeIntegration: true
|
||||||
}
|
}
|
||||||
|
@ -43,6 +44,7 @@ ipcMain.on('set-transparent', async () => {
|
||||||
colors.transparent = result[0].hex();
|
colors.transparent = result[0].hex();
|
||||||
|
|
||||||
const { green, transparent } = colors;
|
const { green, transparent } = colors;
|
||||||
|
console.log({ green, transparent });
|
||||||
process.exit(green === transparent ? 1 : 0);
|
process.exit(green === transparent ? 1 : 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue