tor-browser

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

file_fullscreen-lenient-setters.html (1477B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4  <meta charset="UTF-8">
      5  <title>Test for Bug 1268798</title>
      6  <script src="/tests/SimpleTest/EventUtils.js"></script>
      7  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      8 </head>
      9 <body>
     10 <script>
     11 "use strict";
     12 
     13 function ok(condition, msg) {
     14  opener.ok(condition, "[lenient-setters] " + msg);
     15 }
     16 
     17 function is(a, b, msg) {
     18  opener.is(a, b, "[lenient-setters] " + msg);
     19 }
     20 
     21 function info(msg) {
     22  opener.info("[lenient-setters] " + msg);
     23 }
     24 
     25 let unattachedDiv = document.createElement("div");
     26 
     27 function begin() {
     28  var originalValue = document.fullscreen;
     29  try {
     30    document.fullscreen = !document.fullscreen;
     31    is(document.fullscreen, originalValue,
     32       "fullscreen should not be changed");
     33  } catch (e) {
     34    ok(false, "Setting fullscreen should not throw");
     35  }
     36 
     37  var originalElem = document.fullscreenElement;
     38  try {
     39    document.fullscreenElement = unattachedDiv;
     40    document.fullscreenElement = [];
     41    is(document.fullscreenElement, originalElem,
     42       "fullscreenElement should not be changed");
     43  } catch (e) {
     44    ok(false, "Setting fullscreenElement should not throw");
     45  }
     46 
     47  var originalEnabled = document.fullscreenEnabled;
     48  try {
     49    document.fullscreenEnabled = !originalEnabled;
     50    is(document.fullscreenEnabled, originalEnabled,
     51       "fullscreenEnabled should not be changed");
     52  } catch (e) {
     53    ok(false, "Setting fullscreenEnabled should not throw");
     54  }
     55 
     56  opener.nextTest();
     57 }
     58 
     59 </script>
     60 </body>
     61 </html>