diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
commit | fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch) | |
tree | 4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /testing/web-platform/tests/fenced-frame/resources | |
parent | Releasing progress-linux version 124.0.1-1~progress7.99u1. (diff) | |
download | firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/fenced-frame/resources')
-rw-r--r-- | testing/web-platform/tests/fenced-frame/resources/utils.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/testing/web-platform/tests/fenced-frame/resources/utils.js b/testing/web-platform/tests/fenced-frame/resources/utils.js index cbea173f17..d6cca91437 100644 --- a/testing/web-platform/tests/fenced-frame/resources/utils.js +++ b/testing/web-platform/tests/fenced-frame/resources/utils.js @@ -250,6 +250,11 @@ function buildRemoteContextForObject(object, uuid, html) { } }; + // If `object` is null (e.g. a window created with noopener), set it to a + // dummy value so that the Proxy constructor won't fail. + if (object == null) { + object = {}; + } const proxy = new Proxy(object, handler); return proxy; } @@ -646,3 +651,19 @@ function setupCSP(csp, second_csp=null) { document.head.appendChild(second_meta); } } + +// Clicking in WPT tends to be flaky (https://crbug.com/1066891), so you may +// need to click multiple times to have an effect. This function clicks at +// coordinates `{x, y}` relative to `click_origin`, by default 3 times. Should +// not be used for tests where multiple clicks have distinct impact on the state +// of the page, but rather to bruteforce through flakes that rely on only one +// click. +async function multiClick(x, y, click_origin, times = 3) { + for (let i = 0; i < times; i++) { + let actions = new test_driver.Actions(); + await actions.pointerMove(x, y, {origin: click_origin}) + .pointerDown() + .pointerUp() + .send(); + } +} |