Repository navigation
test: ignore security warnings in the iframe external protocol spec - #54060
Merged
Merged
Conversation
…col spec The spec asserted on the first console message the page logged. Since the renderer security warnings moved to C++ (#53970) the main frame logs an "Electron Security Warning (Insecure Content-Security-Policy)" message when it finishes loading, and on Windows that regularly lands before the "Navigation to external protocol blocked by sandbox" message the test is waiting for. Wait for the first message that is not a security warning instead.
MarshallOfSound
approved these changes
Sep 18, 2026
MarshallOfSound
enabled auto-merge (squash)
September 18, 2026 00:57
VerteDinde
approved these changes
Sep 18, 2026
codebytere
approved these changes
Sep 18, 2026
Member
|
(Looks like one of my recent PRs introduced a test flake due to a timing change in security warnings) |
|
No Release Notes |
Contributor
|
I have automatically backported this PR to "45-x-y", please check out #54064 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
Before:
iframe sandbox external protocols > blocks navigation to external protocol from a sandboxed iframeasserted on the firstconsole-messagethe page logged. Since the renderer security warnings moved to C++ in #53970, the main frame logs an "Electron Security Warning (Insecure Content-Security-Policy)" message when it finishes loading (the fixture page has no CSP), and on the Windows runners that regularly arrives before the "Navigation to external protocol blocked by sandbox" message the test wants. It failed twice and passed on the third retry in #53970's ownwindows-x64 / test (win, 2)job, and failed all four attempts on #53838.After: the spec waits for the first console message that is not a security warning, so the order of the two messages no longer matters. The assertions are unchanged.
How: swap
once(w.webContents, 'console-message')foremittedUntil(...)fromspec/lib/events-helperswith a predicate that skips messages starting with "Electron Security Warning", the same approach #53970 took for the<webview>console-message helper.Verified with oxlint on the changed file; the behavior change itself is only observable on CI, where the Windows shards should stop flaking on this spec.
Checklist
Release Notes
Notes: none
Generated by Claude Code