Skip to content

test: fix types in chromium-spec - #48943

Merged
jkleinsc merged 1 commit into
mainfrom
fix-remotely-test
Nov 13, 2025
Merged

jkleinsc merged 1 commit into
mainfrom
fix-remotely-test

Conversation

@codebytere

Copy link
Copy Markdown
Member

Description of Change

See https://github.com/electron/electron/actions/runs/19341206364

Error: electron/spec/chromium-spec.ts(918,54): error TS7006: Parameter '_wc' implicitly has an 'any' type.
Error: electron/spec/chromium-spec.ts(918,59): error TS7006: Parameter 'permission' implicitly has an 'any' type.
Error: electron/spec/chromium-spec.ts(918,71): error TS7006: Parameter 'callback' implicitly has an 'any' type.

Checklist

Release Notes

Notes: none

@codebytere codebytere added fast-track 🚅 Indicates that this PR is intended to bypass the 24 hour rule. Needs approval from Releases semver/none labels Nov 13, 2025

@nikwen nikwen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Comment thread spec/chromium-spec.ts
if (action !== 'none') {
// Make the PermissionRequestHandler behave according to action variable passed for this test
testSession.setPermissionRequestHandler((_wc, permission, callback) => {
testSession.setPermissionRequestHandler((_wc: Electron.WebContents, permission: string, callback: (allow: boolean) => void) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with getting this in to unblock things, but I wonder why it doesn't infer the types automatically.

We have session.setPermissionRequestHandler() typed as:

setPermissionRequestHandler(handler: ((webContents: WebContents, permission: 'clipboard-read' | 'clipboard-sanitized-write' | 'display-capture' | 'fullscreen' | 'geolocation' | 'idle-detection' | 'media' | 'mediaKeySystem' | 'midi' | 'midiSysex' | 'notifications' | 'pointerLock' | 'keyboardLock' | 'openExternal' | 'speaker-selection' | 'storage-access' | 'top-level-storage-access' | 'window-management' | 'unknown' | 'fileSystem', callback: (permissionGranted: boolean) => void, details: (PermissionRequest) | (FilesystemPermissionRequest) | (MediaAccessPermissionRequest) | (OpenExternalPermissionRequest)) => void) | (null)): void;

@codebytere codebytere Nov 13, 2025 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikwen it's due to the remote runner - they all get clobbered; this just coincidentally hasn't been an issue yet

@jkleinsc
jkleinsc merged commit 40b6738 into main Nov 13, 2025
@jkleinsc
jkleinsc deleted the fix-remotely-test branch November 13, 2025 20:25
@release-clerk

release-clerk Bot commented Nov 13, 2025

Copy link
Copy Markdown

No Release Notes

nilayarya pushed a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fast-track 🚅 Indicates that this PR is intended to bypass the 24 hour rule. Needs approval from Releases no-backport semver/none

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants