tor-browser

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

document-fullscreen-enabled-cross-origin.sub.html (1533B)


      1 <!DOCTYPE html>
      2 <title>Document#fullscreenEnabled</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <div id="log"></div>
      6 <iframe src="resources/report-fullscreen-enabled.html" name="same-origin-default"></iframe>
      7 <iframe src="resources/report-fullscreen-enabled.html" allowfullscreen name="same-origin-allow"></iframe>
      8 <iframe src="http://{{hosts[alt][]}}:{{ports[http][0]}}/fullscreen/api/resources/report-fullscreen-enabled.html" name="cross-origin-default"></iframe>
      9 <iframe src="http://{{hosts[alt][]}}:{{ports[http][1]}}/fullscreen/api/resources/report-fullscreen-enabled.html" allowfullscreen name="cross-origin-allow"></iframe>
     10 <script>
     11 var expectations = {
     12  "same-origin-default": true,
     13  "same-origin-allow": true,
     14  "cross-origin-default": false,
     15  "cross-origin-allow": true
     16 };
     17 
     18 var tests = {};
     19 for (var name in expectations) {
     20  tests[name] = async_test( 'Fullscreen enabled test: ' + name);
     21 }
     22 
     23 // When a message is received from a child frame, ensure that the report
     24 // matches the expectations.
     25 window.addEventListener('message', e => {
     26  if (e.data.report && e.data.report.api == "fullscreen") {
     27    if (e.data.report.frame in expectations) {
     28      tests[e.data.report.frame].step(() => {
     29        assert_equals(e.data.report.enabled, expectations[e.data.report.frame],
     30          e.data.report.frame + " frame fullscreenEnabled");
     31      });
     32      delete expectations[e.data.report.frame];
     33      tests[e.data.report.frame].done();
     34    }
     35  }
     36 });
     37 </script>