2 <meta name=variant
content=
"?dialog">
3 <meta name=variant
content=
"?CloseWatcher">
4 <script src=
"/resources/testharness.js"></script>
5 <script src=
"/resources/testharnessreport.js"></script>
6 <script src=
"/resources/testdriver.js"></script>
7 <script src=
"/resources/testdriver-vendor.js"></script>
8 <script src=
"/resources/testdriver-actions.js"></script>
9 <script src=
"/common/top-layer.js"></script>
10 <script src=
"../resources/helpers.js"></script>
14 const type
= location
.search
.substring(1);
16 promise_test(async t
=> {
19 await
createBlessedRecordingCloseWatcher(t
, events
, "watcher1", type
);
20 const watcher2
= createRecordingCloseWatcher(t
, events
, "watcher2", type
);
22 await
maybeTopLayerBless(watcher2
);
24 await
sendCloseRequest();
25 await
waitForPotentialCloseEvent();
26 assert_array_equals(events
, ["watcher2 cancel", "watcher2 close"]);
28 await
sendCloseRequest();
29 await
waitForPotentialCloseEvent();
30 assert_array_equals(events
, ["watcher2 cancel", "watcher2 close", "watcher1 cancel", "watcher1 close"]);
31 }, "Create a close watcher with user activation; create a close watcher without user activation; send user activation");