diff --git a/Tests/LibWeb/Text/expected/wpt-import/infrastructure/testdriver/click.txt b/Tests/LibWeb/Text/expected/wpt-import/infrastructure/testdriver/click.txt new file mode 100644 index 00000000000..81464bc95c3 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/infrastructure/testdriver/click.txt @@ -0,0 +1,6 @@ +Harness status: OK + +Found 1 tests + +1 Pass +Pass TestDriver click method \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/infrastructure/testdriver/click.html b/Tests/LibWeb/Text/input/wpt-import/infrastructure/testdriver/click.html new file mode 100644 index 00000000000..0d144b3d33e --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/infrastructure/testdriver/click.html @@ -0,0 +1,19 @@ + + +TestDriver click method + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/resources/testdriver-vendor.js b/Tests/LibWeb/Text/input/wpt-import/resources/testdriver-vendor.js index 2496b5f1830..a9beda369b1 100644 --- a/Tests/LibWeb/Text/input/wpt-import/resources/testdriver-vendor.js +++ b/Tests/LibWeb/Text/input/wpt-import/resources/testdriver-vendor.js @@ -1,3 +1,13 @@ +window.test_driver_internal.click = function(element) { + const boundingRect = element.getBoundingClientRect(); + const centerPoint = { + x: boundingRect.left + boundingRect.width / 2, + y: boundingRect.top + boundingRect.height / 2 + }; + window.internals.click(centerPoint.x, centerPoint.y); + return Promise.resolve(); +}; + window.test_driver_internal.get_computed_label = async function(element) { return await window.internals.getComputedLabel(element); };