Repository navigation
Register test iframes with their own window IDs - #347731
Merged
Bryan Chen (bryanchen-d) merged 1 commit intoNov 12, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the test-only iframe state-isolation change.
No open issues 🎉
What changed in this PR
This test-only change isolates iframe animation-frame state so removing an iframe with a pending frame cannot stall later tests in the same renderer. Production scheduling behavior is unchanged.
Changes:
- Adds
registerTestIframeto assign unique window IDs and register iframe windows. - Updates 24 test files to register attached iframes and dispose their registrations during cleanup.
- Leaves navigating
srcdociframes and fake-clock animation-frame handling outside this change.
| File | Description |
|---|---|
src/vs/workbench/services/themes/test/browser/workbenchSizeService.test.ts |
Registers the auxiliary sizing iframe. |
src/vs/workbench/services/contextmenu/test/electron-browser/contextmenuService.test.ts |
Registers the native context-menu test iframe. |
src/vs/workbench/contrib/webview/test/browser/overlayWebview.test.ts |
Registers the auxiliary clipping iframe. |
src/vs/workbench/contrib/terminal/test/browser/xterm/xtermTerminal.test.ts |
Registers three terminal test iframes. |
src/vs/workbench/contrib/issue/test/electron-browser/issueReporterMediaImport.test.ts |
Registers the media-import reparenting iframe. |
src/vs/workbench/contrib/issue/test/browser/issueReporterOverlay.test.ts |
Registers the overlay reparenting iframe. |
src/vs/workbench/contrib/issue/test/browser/issueFormService.test.ts |
Registers the issue-form auxiliary iframe. |
src/vs/workbench/contrib/issue/test/browser/baseIssueReporterService.test.ts |
Registers the reporter test iframe. |
src/vs/workbench/contrib/chat/test/browser/widget/input/chatInputNoticeWidget.test.ts |
Registers the input-notice test iframe. |
src/vs/workbench/contrib/chat/test/browser/widget/chatWindowBlurListener.test.ts |
Registers the secondary-window test iframe. |
src/vs/workbench/contrib/chat/test/browser/widget/chatPetWidgetService.test.ts |
Registers the chat-pet test iframe. |
src/vs/workbench/contrib/chat/test/browser/widget/chatEditorOverflowWidgetsHost.test.ts |
Registers the overflow-host test iframe. |
src/vs/workbench/contrib/chat/test/browser/widget/chatContentParts/chatMcpAppModel.test.ts |
Registers the MCP app test iframe. |
src/vs/workbench/contrib/chat/test/browser/widget/chatContentParts/chatActivityLabelTransition.test.ts |
Registers the label-animation test iframe. |
src/vs/workbench/contrib/chat/test/browser/widget/chatClipboard.test.ts |
Registers the clipboard test iframe. |
src/vs/workbench/contrib/chat/test/browser/voiceClient/voiceGlow.test.ts |
Registers the voice-glow test iframe. |
src/vs/workbench/contrib/chat/test/browser/dictationDownloadRing.test.ts |
Registers the download-ring test iframe. |
src/vs/workbench/contrib/chat/test/browser/chatImageActions.test.ts |
Registers the image-copy test iframe. |
src/vs/sessions/contrib/terminal/test/browser/chatWindowTerminalActions.test.ts |
Registers the terminal-action test iframe. |
src/vs/sessions/contrib/chat/test/browser/responseSelectionSideChatController.test.ts |
Registers the response-selection test iframe. |
src/vs/sessions/contrib/aquarium/test/browser/aquariumOverlay.test.ts |
Registers the aquarium test iframe. |
src/vs/editor/test/browser/controller/nativeEditContextUtils.test.ts |
Registers the focus-tracker test iframe. |
src/vs/editor/contrib/suggest/test/browser/suggestWidget.test.ts |
Registers the suggestion-widget test iframe. |
src/vs/base/test/browser/ui/contextview/contextview.test.ts |
Registers two context-view test iframes with cleanup. |
src/vs/base/test/browser/testWindow.ts |
Adds the shared disposable iframe-registration helper. |
Review effort: Balanced
Tests that create iframes and use their contentWindow leave vscodeWindowId undefined, so every such window shares one slot in per-window state such as the dom.ts animation frame queue. If one test removes an iframe while a frame is pending for it, later unregistered iframes in the same renderer never get their scheduled frames, which made the auxiliary-window clipping tests fail depending on test order. Add registerTestIframe, which gives the iframe window a unique ID and registers it like the auxiliary window service does, and use it in the tests that create iframes. Co-authored-by: Copilot <[email protected]>
Bryan Chen (bryanchen-d)
force-pushed
the
copilot/vscode/register-test-iframes
branch
from
November 11, 2026 23:35
b19daaa to
ad7a928
Compare
Bryan Chen (bryanchen-d)
marked this pull request as ready for review
November 11, 2026 23:55
Bryan Chen (bryanchen-d)
enabled auto-merge (squash)
November 11, 2026 23:55
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Anthony Kim (@anthonykim1)Matched files:
|
Dmitriy Vasyura (dmitrivMS)
approved these changes
Nov 12, 2026
Bryan Chen (bryanchen-d)
deleted the
copilot/vscode/register-test-iframes
branch
November 12, 2026 00:03
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.
Test-only alternative to #347523 for the stale animation frame problem.
Mechanism
scheduleAtNextAnimationFrameindom.tskeeps its queue and its "frame requested" flag per window ID. Iframes that tests create are never registered, so their windows have novscodeWindowIdand all of them share the sameundefinedslot. When a test removes its iframe while a frame is still pending for it, that frame never runs, the flag for the shared slot stays set, and every later test iframe in the same renderer stops getting animation frames.Main CI runs the whole unit suite in one renderer, so this shows up there and in product builds depending on test order, for example the auxiliary-window clipping assertions in
WorkbenchSizeServiceandOverlayWebview(the WebKit failures in build 495183). PR CI only runs affected tests, so it rarely sees it.Change
registerTestIframe(iframe)helper insrc/vs/base/test/browser/testWindow.ts. It gives the iframe window a unique ID withensureCodeWindowand registers it withregisterWindow, which is what the auxiliary window service does for real windows. Disposing the registration firesonDidUnregisterWindow, which clears that window's animation frame state.chatMarkdownContentPart.test.tsandchatListRenderer.test.ts. Theirsrcdociframes navigate after creation, which replaces the window object, so a registration would not stick.This doesn't cover the other way the flag gets stuck, a test faking
requestAnimationFramewith sinon (build 495093). #347524 fixed that test, and #347523 fixes both cases indom.ts.Validation
main, 595 passing and 2 failing (OverlayWebview"auxiliary webview clipping refreshes after cloned theme styles propagate" andWorkbenchSizeService"cloned auxiliary-window styles receive initial sizes and live updates"). With this change, 597 passing and 0 failing.tsc --noEmitonsrcreports no errors in the touched files. eslint is clean.