tor-browser

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

pip-receives-focus.https.html (735B)


      1 <!DOCTYPE html>
      2 <title>Test that the document Picture in picture window receives system focus</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script src="/resources/testdriver.js"></script>
      6 <script src="/resources/testdriver-vendor.js"></script>
      7 <body>
      8 <script>
      9 promise_test(async (t) => {
     10  await test_driver.bless('request PiP window');
     11  const pipWindow = await documentPictureInPicture.requestWindow();
     12  if (!pipWindow.document.hasFocus()) {
     13    await new Promise(resolve => pipWindow.onfocus = resolve);
     14  }
     15  assert_true(pipWindow.document.hasFocus(), 'PiP has focus');
     16  pipWindow.close();
     17 }, 'PiP recieves system focus after being opened');
     18 </script>
     19 </body>