summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/close-watcher/resources/helpers.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
commita90a5cba08fdf6c0ceb95101c275108a152a3aed (patch)
tree532507288f3defd7f4dcf1af49698bcb76034855 /testing/web-platform/tests/close-watcher/resources/helpers.js
parentAdding debian version 126.0.1-1. (diff)
downloadfirefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz
firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/close-watcher/resources/helpers.js')
-rw-r--r--testing/web-platform/tests/close-watcher/resources/helpers.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/testing/web-platform/tests/close-watcher/resources/helpers.js b/testing/web-platform/tests/close-watcher/resources/helpers.js
index dd9e191c4d..ad80c28847 100644
--- a/testing/web-platform/tests/close-watcher/resources/helpers.js
+++ b/testing/web-platform/tests/close-watcher/resources/helpers.js
@@ -26,9 +26,14 @@ window.createRecordingCloseWatcher = (t, events, name, type, parentWatcher) => {
t.add_cleanup(() => watcher.destroy());
}
- const prefix = name === undefined ? "" : name + " ";
- watcher.addEventListener('cancel', () => events.push(prefix + "cancel"));
- watcher.addEventListener('close', () => events.push(prefix + "close"));
+ const prefix = name === undefined ? '' : name + ' ';
+ watcher.addEventListener('cancel', e => {
+ const cancelable = e.cancelable ? '[cancelable=true]' : '[cancelable=false]';
+ events.push(prefix + 'cancel' + cancelable);
+ });
+ watcher.addEventListener('close', () => {
+ events.push(prefix + 'close');
+ });
return watcher;
};