Skip to content

Commit

Permalink
spec: use backgroundWindow for color consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Mar 16, 2022
1 parent 14a044d commit e79a5b4
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions spec-main/api-browser-window-spec.ts
Expand Up @@ -1696,20 +1696,31 @@ describe('BrowserWindow module', () => {

it('Allows setting a transparent window via CSS', async () => {
const display = screen.getPrimaryDisplay();
const TRANSPARENT_BG_COLOR = '#515152';
const TRANSPARENT_BG_COLOR = '#244a24';

const window = new BrowserWindow({
const backgroundWindow = new BrowserWindow({
...display.bounds,
frame: false,
backgroundColor: CHROMA_COLOR_HEX,
hasShadow: false
});

await backgroundWindow.loadURL('about:blank');

const foregroundWindow = new BrowserWindow({
...display.bounds,
frame: false,
transparent: true,
vibrancy: 'under-window',
hasShadow: false,
webPreferences: {
contextIsolation: false,
nodeIntegration: true
}
});

const file = path.join(__dirname, 'fixtures', 'pages', 'css-transparent.html');
await window.loadFile(file);
await foregroundWindow.loadFile(file);
await emittedOnce(ipcMain, 'set-transparent');

const screenCapture = await captureScreen();
Expand Down

0 comments on commit e79a5b4

Please sign in to comment.