-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
webdriver: Focus when "switch to window" #38889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Converting to draft as I see two stably passing tests due to this change.. I wanna know why. EDIT: We are stably passing following test related to history navigation
This involves ScriptToConstellationMessage::PushHistoryState. servo/components/constellation/constellation.rs Lines 1740 to 1741 in 0a81461
|
This is really interesting. When we didn't focus the tab 2 (webview_id = TopLevel(0,2)), it seems the servo/components/script/dom/document_event_handler.rs Lines 65 to 67 in 1fc8578
The log says constellation indeed forward to the tab 2. However, the
It is not related to this PR anyway. |
Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
cc @PotatoCP @longvatrong111 After this, there are many flaky TIMEOUT due to focus race condition I said before. I've been working on it. |
#38889 adds back the mechanism to focus the window when [switch to window](https://w3c.github.io/webdriver/#switch-to-window). After that, it causes many flaky TIMEOUT. Turns out the real reason is same as the phenomenon which I thought was unrelated: #38889 (comment): we need to focus the browsing context as well according to spec. This is important for Servo because it relies on https://github.com/servo/servo/blob/f4dd2960b89bcc6bae3f9dae5be8964c64c1c2c7/components/constellation/constellation_webview.rs#L64 to determine which pipeline to send `InputEvent` to. Testing: Before, there are 9 ~ 13 flaky results. [Before 1](https://github.com/yezhizhen/servo/actions/runs/17379170889), [Before 2](https://github.com/yezhizhen/servo/actions/runs/17392219417), [Before 3](https://github.com/yezhizhen/servo/actions/runs/17379172612). Now there are 2 ~ 4 flaky results. [After 1](https://github.com/yezhizhen/servo/actions/runs/17394359570), [After 2](https://github.com/yezhizhen/servo/actions/runs/17394358218), [After 3](https://github.com/yezhizhen/servo/actions/runs/17394357400). Fixes: #38889 (comment) Fixes: #38906, which is last blocking point to enable WebDriver CI. --------- Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
Add logic that was accidentally removed in #38745. Otherwise it is very weird when using webdriver as a human, as we still stays on the original tab.
Testing:
this should not affect any test. Even if the tab is not "visible" previously, all programmatic interaction works fine.Stably passtest_history_pushstate
inback.py
andforward.py
.