tor-browser

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

y-popover-disconnected.html (1476B)


      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 <div id=p1 popover=auto>
     15  <button id=b1>b1</button>
     16 
     17  <div id=p2 popover=auto>p2</div>
     18 </div>
     19 
     20 <script>
     21 promise_test(async () => {
     22  const p1 = document.getElementById('p1');
     23  const p2 = document.getElementById('p2');
     24  await test_driver.click(b0);
     25  p1.showPopover();
     26  await test_driver.click(b1);
     27  p2.showPopover();
     28 
     29  assert_true(p1.matches(':popover-open'), 'p1 should be open.');
     30  assert_true(p2.matches(':popover-open'), 'p2 should be open.');
     31 
     32  p2.remove()
     33 
     34  assert_false(p2.matches(':popover-open'), 'p2 should now be closed.');
     35  await sendCloseRequest();
     36  assert_false(p2.matches(':popover-open'), 'p2 still now be closed.');
     37  assert_false(p1.matches(':popover-open'), 'p1 should now be closed.');
     38 
     39  await sendCloseRequest();
     40  assert_false(p2.matches(':popover-open'), 'p2 still now be closed.');
     41  assert_false(p1.matches(':popover-open'), 'p1 still now be closed.');
     42 }, 'Disconnect popover with close request');
     43 </script>