Commit 754b4a9
[wpt] Ensure compute pressure/generic sensor tests satisfy focus check
Some tests currently assume the testharness browsing context is
initially focused. Opening the BC with WebDriver's "New Window" command
[0] instead of `window.open(...)` broke such tests because the command
doesn't run focusing steps [1].
To fix #50622, ensure the testharness document
starts with focus by sending a click [2] during test setup. A few
`test()`s have been fixed up into `promise_test()`s so that they're
compatible with `promise_setup()`.
The bug doesn't surface with `--product=headless_shell` because headless
shell doesn't seem to have a focusable address bar.
[0]: https://www.w3.org/TR/webdriver/#new-window
[1]: https://html.spec.whatwg.org/multipage/interaction.html#focusing-steps
[2]: https://w3c.github.io/uievents/#event-type-click
Bug: 392539092
Test: run_wpt_tests.py --product=chrome external/wpt/compute-pressure/
Change-Id: I8728ef42733c08cafe555b666c56c4b85d4b0304
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6341204
Reviewed-by: Arnaud Mandy <arnaud.mandy@intel.com>
Commit-Queue: Jonathan Lee <jonathanjlee@google.com>
Cr-Commit-Position: refs/heads/main@{#1430924}1 parent 626d3af commit 754b4a9
File tree
3 files changed
+15
-3
lines changed- compute-pressure
- resources
- generic-sensor
3 files changed
+15
-3
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
139 | 145 | | |
140 | 146 | | |
141 | 147 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
| |||
614 | 620 | | |
615 | 621 | | |
616 | 622 | | |
617 | | - | |
| 623 | + | |
618 | 624 | | |
619 | 625 | | |
620 | 626 | | |
| |||
626 | 632 | | |
627 | 633 | | |
628 | 634 | | |
629 | | - | |
| 635 | + | |
630 | 636 | | |
631 | 637 | | |
632 | 638 | | |
| |||
0 commit comments