tor-browser

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

test_bug1648877_dialog_fullscreen_denied.html (1326B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=1648877
      5 -->
      6 <head>
      7  <title>Test for Bug 1648877</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <script src="/tests/SimpleTest/EventUtils.js"></script>
     10  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     11 </head>
     12 <body>
     13  <a target="_blank"
     14     href="https://bugzilla.mozilla.org/show_bug.cgi?id=1648877">Requesting
     15  fullscreen a dialog element should be denied</a>
     16 <p id="display"></p>
     17 <dialog>
     18 </dialog>
     19 <div style="width: 30px; height:30px" </div>
     20    
     21 <pre id="test">
     22 <script type="application/javascript">
     23 SimpleTest.waitForExplicitFinish();
     24 
     25 function runTest() {
     26  document.addEventListener("fullscreenchange", () => {
     27    ok(false, "Should never receive " +
     28      "a fullscreenchange event in the main window.");
     29  });
     30 
     31  document.addEventListener('fullscreenerror', (event) => {
     32    ok(!document.fullscreenElement,
     33       "Should not grant request if the element is dialog");
     34    SimpleTest.finish();
     35  });
     36 
     37  const div = document.querySelector("div");
     38 
     39  div.addEventListener("click", function() {
     40    const dialog = document.querySelector("dialog");
     41    dialog.requestFullscreen();
     42  });
     43 
     44  synthesizeMouseAtCenter(div, {});
     45 }
     46 
     47 SimpleTest.waitForFocus(runTest);
     48 
     49 </script>
     50 </pre>
     51 </body>
     52 </html>