summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fenced-frame/resources
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /testing/web-platform/tests/fenced-frame/resources
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.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.js21
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();
+ }
+}