nn-CloseWatcher.html (869B)
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> 9 10 <body> 11 <script> 12 const type = "CloseWatcher"; 13 14 promise_test(async t => { 15 const events = []; 16 17 createRecordingCloseWatcher(t, events, "watcher1", type); 18 createRecordingCloseWatcher(t, events, "watcher2", type); 19 20 await sendCloseRequest(); 21 await waitForPotentialCloseEvent(); 22 assert_array_equals(events, ["watcher2 cancel[cancelable=false]", "watcher2 close", "watcher1 cancel[cancelable=false]", "watcher1 close"]); 23 }, "Create two close watchers without user activation"); 24 </script>