8000 servoshell: Do handle prompts and other requests in headless mode whe… · servo/servo@9afe027 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9afe027

Browse files
servoshell: Do handle prompts and other requests in headless mode when WebDriver is active (#37886)
Webdriver CI uses headless window, which skips the handling for alert box. It leads to unexpected `OK` in test results, which should be still timeout. This PR removes the skip, so test result in local and CI are synchronized. Testing: 7 unexpected `OK` are removed https://github.com/longvatrong111/servo/actions/runs/16079192271 compared to CI on main: https://github.com/longvatrong111/servo/actions/runs/16078898742 Fixes: #37875 Partially fixes: #37387 --------- Signed-off-by: batu_hoang <longvatrong111@gmail.com>
1 parent 71d97bd commit 9afe027

File tree

20 files changed

+409
-26
lines changed

20 files changed

+409
-26
lines changed

ports/servoshell/desktop/app_state.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,9 @@ impl WebViewDelegate for RunningAppState {
452452
}
453453

454454
fn show_simple_dialog(&self, webview: servo::WebView, dialog: SimpleDialog) {
455-
if self.servoshell_preferences.headless {
455+
if self.servoshell_preferences.headless &&
456+
self.servoshell_preferences.webdriver_port.is_none()
457+
{
456458
// TODO: Avoid copying this from the default trait impl?
457459
// Return the DOM-specified default value for when we **cannot show simple dialogs**.
458460
let _ = match dialog {
@@ -477,7 +479,9 @@ impl WebViewDelegate for RunningAppState {
477479
webview: WebView,
478480
authentication_request: AuthenticationRequest,
479481
) {
480-
if self.servoshell_preferences.headless {
482+
if self.servoshell_preferences.headless &&
483+
self.servoshell_preferences.webdriver_port.is_none()
484+
{
481485
return;
482486
}
483487

@@ -575,7 +579,9 @@ impl WebViewDelegate for RunningAppState {
575579
}
576580

577581
fn request_permission(&self, webview: servo::WebView, permission_request: PermissionRequest) {
578-
if self.servoshell_preferences.headless {
582+
if self.servoshell_preferences.headless &&
583+
self.servoshell_preferences.webdriver_port.is_none()
584+
{
579585
permission_request.deny();
580586
return;
581587
}
@@ -635,7 +641,9 @@ impl WebViewDelegate for RunningAppState {
635641
}
636642

637643
fn show_form_control(&self, webview: WebView, form_control: FormControl) {
638-
if self.servoshell_preferences.headless {
644+
if self.servoshell_preferences.headless &&
645+
self.servoshell_preferences.webdriver_port.is_none()
646+
{
639647
return;
640648
}
641649

tests/wpt/meta/webdriver/tests/classic/delete_session/delete.py.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[delete.py]
2-
expected: ERROR
32
[test_null_response_value]
43
expected: FAIL
54

tests/wpt/meta/webdriver/tests/classic/element_clear/clear.py.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,12 @@
208208

209209
[test_scroll_into_view]
210210
expected: FAIL
211+
212+
[test_resettable_element_does_not_satisfy_validation_constraints[range-foo\]]
213+
expected: FAIL
214+
215+
[test_resettable_element_does_not_satisfy_validation_constraints[color-foo\]]
216+
expected: FAIL
217+
218+
[test_resettable_element_does_not_satisfy_validation_constraints[datetime-foo\]]
219+
expected: FAIL

tests/wpt/meta/webdriver/tests/classic/element_click/interactability.py.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[interactability.py]
2-
expected: TIMEOUT
32
[test_display_none]
43
expected: FAIL
54

tests/wpt/meta/webdriver/tests/classic/element_send_keys/events.py.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,12 @@
44

55
[test_form_control_send_text[textarea\]]
66
expected: FAIL
7+
8+
[test_file_upload]
9+
expected: FAIL
10+
11+
[test_not_blurred[input\]]
12+
expected: FAIL
13+
14+
[test_not_blurred[textarea\]]
15+
expected: FAIL

tests/wpt/meta/webdriver/tests/classic/element_send_keys/file_upload.py.ini

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,33 @@
2222

2323
[test_strict_display_none]
2424
expected: ERROR
25+
26+
[test_multiple_files]
27+
expected: FAIL
28+
29+
[test_multiple_files_without_multiple_attribute]
30+
expected: FAIL
31+
32+
[test_single_file]
33+
expected: FAIL
34+
35+
[test_single_file_replaces_without_multiple_attribute]
36+
expected: FAIL
37+
38+
[test_transparent]
39+
expected: FAIL
40+
41+
[test_obscured]
42+
expected: FAIL
43+
44+
[test_outside_viewport]
45+
expected: FAIL
46+
47+
[test_hidden]
48+
expected: FAIL
49+
50+
[test_display_none]
51+
expected: FAIL
52+
53+
[test_not_focused]
54+
expected: FAIL

tests/wpt/meta/webdriver/tests/classic/element_send_keys/form_controls.py.ini

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,18 @@
44

55
[test_textarea_append]
66
expected: FAIL
7+
8+
[test_input]
9+
expected: FAIL
10+
11+
[test_textarea]
12+
expected: FAIL
13+
14+
[test_input_insert_when_focused]
15+
expected: FAIL
16+
17+
[test_textarea_insert_when_focused]
18+
expected: FAIL
19+
20+
[test_date]
21+
expected: FAIL

tests/wpt/meta/webdriver/tests/classic/element_send_keys/interactability.py.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,12 @@
2222

2323
[test_readonly_element]
2424
expected: FAIL
25+
26+
[test_body_is_interactable]
27+
expected: FAIL
28+
29+
[test_transparent_element]
30+
expected: FAIL
31+
32+
[test_obscured_element]
33+
expected: FAIL

tests/wpt/meta/webdriver/tests/classic/element_send_keys/scroll_into_view.py.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@
2222

2323
[test_element_just_outside_viewport[Just below viewport\]]
2424
expected: FAIL
25+
26+
[test_element_outside_of_not_scrollable_viewport]
27+
expected: FAIL
Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
11
[send_keys.py]
2-
[test_no_browsing_context]
2+
[test_null_response_value]
3+
expected: FAIL
4+
5+
[test_no_top_browsing_context]
6+
expected: FAIL
7+
8+
[test_no_such_element_with_invalid_value]
9+
expected: FAIL
10+
11+
[test_no_such_element_with_shadow_root]
12+
expected: FAIL
13+
14+
[test_no_such_element_from_other_window_handle[open\]]
15+
expected: FAIL
16+
17+
[test_no_such_element_from_other_window_handle[closed\]]
18+
expected: FAIL
19+
20+
[test_no_such_element_from_other_frame[open\]]
21+
expected: FAIL
22+
23+
[test_no_such_element_from_other_frame[closed\]]
65CE
24+
expected: FAIL
25+
26+
[test_stale_element_reference[top_context\]]
27+
expected: FAIL
28+
29+
[test_stale_element_reference[child_context\]]
30+
expected: FAIL
31+
32+
[test_surrogates]
333
expected: FAIL

0 commit comments

Comments
 (0)
0