summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/event-timing/resources/crossiframe-childframe.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/event-timing/resources/crossiframe-childframe.html
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/event-timing/resources/crossiframe-childframe.html')
-rw-r--r--testing/web-platform/tests/event-timing/resources/crossiframe-childframe.html39
1 files changed, 39 insertions, 0 deletions
diff --git a/testing/web-platform/tests/event-timing/resources/crossiframe-childframe.html b/testing/web-platform/tests/event-timing/resources/crossiframe-childframe.html
new file mode 100644
index 0000000000..6a8bc6b642
--- /dev/null
+++ b/testing/web-platform/tests/event-timing/resources/crossiframe-childframe.html
@@ -0,0 +1,39 @@
+<!DOCType html>
+<html>
+<body>
+<script src=event-timing-test-utils.js></script>
+<div style="width: 300px; height: 300px" id='iframe_div' onmousedown="mainThreadBusy(120)">
+<script>
+(async () => {
+ const observerPromise = new Promise(resolve => {
+ new PerformanceObserver(entryList => {
+ const mouseDowns = entryList.getEntriesByName('mousedown');
+ if (mouseDowns.length === 0)
+ return;
+ resolve(mouseDowns);
+ }).observe({ type:'event' });
+ });
+ const entries = await observerPromise;
+ const clickDone = performance.now();
+ if (entries.length !== 1) {
+ top.postMessage("failed", "*");
+ return;
+ }
+ const entry = entries[0];
+ top.postMessage({
+ // Entry values (|entry| itself is not clonable)
+ "name": entry.name,
+ "cancelable": entry.cancelable,
+ "entryType": entry.entryType,
+ "startTime": entry.startTime,
+ "processingStart": entry.processingStart,
+ "processingEnd": entry.processingEnd,
+ "duration": entry.duration,
+ // Other values
+ "clickDone" : clickDone,
+ "target": entry.target.id,
+ }, '*');
+}) ();
+</script>
+</body>
+</html>