Bug 1882451 [wpt PR 44825] - Re-do close watcher user activation tests, a=testonly
[gecko.git] / testing / web-platform / tests / close-watcher / user-activation / nn-activate-CloseWatcher.html
blob8045f30b482647d9364876d812e3eeb5b0cb9116
1 <!doctype html>
2 <script src="/resources/testharness.js"></script>
3 <script src="/resources/testharnessreport.js"></script>
4 <script src="/resources/testdriver.js"></script>
5 <script src="/resources/testdriver-vendor.js"></script>
6 <script src="/resources/testdriver-actions.js"></script>
7 <script src="/common/top-layer.js"></script>
8 <script src="../resources/helpers.js"></script>
10 <!--
11 See note in sibling -dialog.html file.
12 -->
14 <body>
15 <script>
16 const type = "CloseWatcher";
18 promise_test(async t => {
19 const events = [];
21 createRecordingCloseWatcher(t, events, "watcher1", type);
22 const watcher2 = createRecordingCloseWatcher(t, events, "watcher2", type);
24 await maybeTopLayerBless(watcher2);
26 await sendCloseRequest();
27 await waitForPotentialCloseEvent();
28 assert_array_equals(events, ["watcher2 cancel", "watcher2 close", "watcher1 cancel", "watcher1 close"]);
29 }, "Create two CloseWatchers without user activation; send user activation");
30 </script>