Repository: electron/electron (language: cpp)

Issue:
Focus handling tests fail on Windows 32-bit
`focus handling` tests have regressed on Windows 32-bit in the Chromium roll (https://github.com/electron/electron/pull/45172) [133.0.6920.0..134.0.6968.0](https://chromium.googlesource.com/chromium/src/+log/133.0.6920.0..134.0.6968.0?n=10000&pretty=fuller)

https://github.com/electron/electron/actions/runs/12932282696/job/36083022633#step:18:2050
```
not ok 1465 focus handling a TAB press moves focus to the next focusable item
  focus should've moved to the webview's element-2, it's instead in BUTTON-wv-element-1: expected 'BUTTON-wv-element-1' to equal 'BUTTON-wv-element-2'
  AssertionError: focus should've moved to the webview's element-2, it's instead in BUTTON-wv-element-1: expected 'BUTTON-wv-element-1' to equal 'BUTTON-wv-element-2'
      at Context.<anonymous> (electron\spec\chromium-spec.ts:159:35)
[1956:0123/195544.605:WARNING:render_input_router.cc(41)] Input request on unbound interface
[1956:0123/195615.443:WARNING:render_input_router.cc(41)] Input request on unbound interface
[1956:0123/195616.297:WARNING:render_input_router.cc(41)] Input request on unbound interface
[1956:0123/195647.125:WARNING:render_input_router.cc(41)] Input request on unbound interface
not ok 1466 focus handling a SHIFT + TAB press moves focus to the previous focusable item
  focus should've moved to the webview's element-1, it's instead in BUTTON-wv-element-2: expected 'BUTTON-wv-element-2' to equal 'BUTTON-wv-element-1'
  AssertionError: focus should've moved to the webview's element-1, it's instead in BUTTON-wv-element-2: expected 'BUTTON-wv-element-2' to equal 'BUTTON-wv-element-1'
      at Context.<anonymous> (electron\spec\chromium-spec.ts:194:35)
```

https://github.com/electron/electron/blob/aafb1ba72c6abc66c81bd530658d3642f9a34f71/spec/chromium-spec.ts#L101-L212


Discussion / hints:
The test is also flaky on Windows ARM64:
https://github.com/electron/electron/actions/runs/13114221716/job/36590890024

Fix patch:
diff --git a/spec/chromium-spec.ts b/spec/chromium-spec.ts
index dc54a816df0d1..a925e5b055293 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 0fb3128611ddb..2358e5a35cd51 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<NativeImage> {
     const sources = await desktopCapturer.getSources({
       types: ['screen'],


Test patch: