mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 17:24:48 -05:00
Tests: Move window.internals.getComputedLabel into testdriver.js file
This change takes the change we made in120bc52f23
to patch the imported WPT aria-utils.js file to use our window.internals.getComputedLabel(el) function, and moves that patching into the imported WPT testdriver.js file — in the same way we did inc5966bbdcb
. That centralizes the patching, and avoids the need to patch multiple other WPT tests we’re likely to import eventually. There are actually six different WPT test files upstream which we haven’t imported yet that call window.test_driver_internal.get_computed_label(el) directly — and that, without this change, we’d otherwise end up needing to patch.
This commit is contained in:
parent
46b95182a0
commit
e10db3aaf0
Notes:
github-actions[bot]
2024-12-07 08:26:21 +00:00
Author: https://github.com/sideshowbarker Commit: https://github.com/LadybirdBrowser/ladybird/commit/e10db3aaf00 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2821 Reviewed-by: https://github.com/tcl3 ✅
2 changed files with 6 additions and 4 deletions
|
@ -233,7 +233,11 @@
|
|||
* rejected in the cases the WebDriver command errors
|
||||
*/
|
||||
get_computed_label: async function(element) {
|
||||
let label = await window.test_driver_internal.get_computed_label(element);
|
||||
// XXX: Ladybird-specific change: Upstream WPT calls
|
||||
// window.test_driver_internal.get_computed_label(element) here,
|
||||
// but we’ve changed that to our Ladybird-specific
|
||||
// window.internals.getComputedLabel(el).
|
||||
let label = await window.internals.getComputedLabel(element);
|
||||
return label;
|
||||
},
|
||||
|
||||
|
|
|
@ -143,9 +143,7 @@ const AriaUtils = {
|
|||
}
|
||||
promise_test(async t => {
|
||||
const expectedLabel = el.getAttribute("data-expectedlabel");
|
||||
// XXX: Ladybird-specific change: upstream WPT has test_driver.get_computed_label(el) here,
|
||||
// but we’ve changed that to the Ladybird-specific window.internals.getComputedLabel(el).
|
||||
let computedLabel = await window.internals.getComputedLabel(el);
|
||||
let computedLabel = await test_driver.get_computed_label(el);
|
||||
assert_not_equals(computedLabel, null, `get_computed_label(el) shouldn't return null for ${el.outerHTML}`);
|
||||
|
||||
// See:
|
||||
|
|
Loading…
Reference in a new issue