tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

y-dialog-disconnected.html (1408B)


      1 <!DOCTYPE html>
      2 <link rel=author href="mailto:jarhar@chromium.org">
      3 <link rel=author href="mailto:wpt@keithcirkel.co.uk">
      4 <link rel=help href="https://github.com/whatwg/html/pull/9462">
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 <script src="/resources/testdriver.js"></script>
      8 <script src="/resources/testdriver-vendor.js"></script>
      9 <script src="/resources/testdriver-actions.js"></script>
     10 <script src="../resources/helpers.js"></script>
     11 
     12 <button id=b0>b0</button>
     13 
     14 <dialog id=d1>
     15  <button id=b1>b1</button>
     16 
     17  <dialog id=d2>d2</dialog>
     18 </dialog>
     19 
     20 <script>
     21 promise_test(async () => {
     22  const d1 = document.getElementById('d1');
     23  const d2 = document.getElementById('d2');
     24  await test_driver.click(b0);
     25  d1.showModal();
     26  await test_driver.click(b1);
     27  d2.showModal();
     28 
     29  assert_true(d1.matches(':modal'), 'd1 should be open.');
     30  assert_true(d2.matches(':modal'), 'd2 should be open.');
     31 
     32  d2.remove()
     33 
     34  assert_false(d2.matches(':modal'), 'd2 should now be closed.');
     35  await sendCloseRequest();
     36  assert_false(d2.matches(':modal'), 'd2 still now be closed.');
     37  assert_false(d1.matches(':modal'), 'd1 should now be closed.');
     38 
     39  await sendCloseRequest();
     40  assert_false(d2.matches(':modal'), 'd2 still now be closed.');
     41  assert_false(d1.matches(':modal'), 'd1 still now be closed.');
     42 }, 'Disconnect dialog with close request');
     43 </script>