diff --git a/spec/chromium-spec.ts b/spec/chromium-spec.ts index dc54a816df0d..a925e5b05529 100644 --- a/spec/chromium-spec.ts +++ b/spec/chromium-spec.ts @@ -98,14 +98,13 @@ describe('window.postMessage', () => { }); }); -// Tests disabled due to regression in Chromium upgrade -// https://github.com/electron/electron/issues/45322 -ifdescribe(!(process.platform === 'win32' && process.arch === 'ia32'))('focus handling', () => { +describe('focus handling', () => { let webviewContents: WebContents; let w: BrowserWindow; beforeEach(async () => { w = new BrowserWindow({ + alwaysOnTop: true, show: true, webPreferences: { nodeIntegration: true, diff --git a/spec/lib/screen-helpers.ts b/spec/lib/screen-helpers.ts index 0fb3128611dd..2358e5a35cd5 100644 --- a/spec/lib/screen-helpers.ts +++ b/spec/lib/screen-helpers.ts @@ -122,6 +122,14 @@ export class ScreenCapture { return this._expectImpl(findPoint(this.display.size), hexColor, true); } + public async takeScreenshot (filePrefix: string) { + const frame = await this.captureFrame(); + return await createArtifactWithRandomId( + (id) => `${filePrefix}-${id}.png`, + frame.toPNG() + ); + } + private async captureFrame (): Promise { const sources = await desktopCapturer.getSources({ types: ['screen'],