Repository navigation
test(ui-test): hand a page its undo keys on Windows - #92
Merged
Merged
Conversation
This was referenced Nov 5, 2026
BartvHelvert
force-pushed
the
fix/custom-document-undo
branch
from
November 6, 2026 21:27
25e2748 to
65c5e8c
Compare
The driver posts key events instead of typing them, and they carry no scan code. On Windows the off-screen browser makes a page's key from the scan code alone, so every key reached the counter editor's page as "Unidentified" (code Escape, keyCode 0) and the page never saw an undo. On Windows the test now dispatches the undo and redo keydowns in the page itself. Elsewhere it still presses the keys. A real keyboard gives the scan code, so this is not a product bug. Refs #87
BartvHelvert
marked this pull request as ready for review
November 6, 2026 22:56
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.
What this changes
SplitModeCustomEditorTestfailed on Windows at "the extension asked to undo" because of how the test types keys. CodeBridge itself is not at fault.The UI tests have the driver post key events instead of typing them (
driver.robot.use.input.events), and posted events carry no scan code. On Windows, JCEF's off-screen browser builds the page's key from the scan code alone, so it getswindows_key_code0 andnative_key_code1. A diagnostic run of this PR showed every key with Ctrl held reaching the page askey="Unidentified" code=Escape keyCode=0, in both custom editor tests, so the page'skeydownlistener never saw an undo. On Linux JCEF maps from the Java key code, which posted events do have. The text editor test passes on Windows only because its undo goes through the IDE's own Undo on the text.On Windows the test now hands the page its Ctrl+Z and Ctrl+Shift+Z keydowns with JavaScript. Elsewhere it still presses the keys. Ctrl+S is unchanged, because the IDE's Save handles it.
A real keyboard on Windows gives the scan code, so pages should see the undo keys there. That has not been checked by hand yet.
Fixes #87
How it was tested
SplitModeCustomEditorTest› "an extension's own document undoes its edits, saves, and is saved when closed with changes" passed locally on Windows 11 (65 s). It ran on the previous master; the branch was then rebased ontoa4f7b06e, a ui-test-only change.Checklist
A new feature has a UI test.(a test fix)(no behaviour changes)docs/is updated where behaviour changed,docs/status.mdespecially.Third-party material keeps its notice and is listed in(none added)NOTICE.md.