tor-browser

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

element-ready-check-containing-iframe.html (1408B)


      1 <!DOCTYPE html>
      2 <title>Element ready check for containing iframe</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 <script src="../trusted-click.js"></script>
      8 <div id="log"></div>
      9 <iframe allowfullscreen></iframe>
     10 <iframe allowfullscreen></iframe>
     11 <script>
     12    // wait for load event to avoid https://bugzil.la/1493878
     13    window.onload = function () {
     14        promise_test(async function (t) {
     15            const [iframe1, iframe2] = document.getElementsByTagName("iframe");
     16 
     17            iframe2.contentDocument.onfullscreenerror = t.unreached_func(
     18                "fullscreenerror event"
     19            );
     20 
     21            await Promise.all([
     22                trusted_request(
     23                    iframe1.contentDocument.body,
     24                    iframe1.contentDocument.body
     25                ),
     26                fullScreenChange(),
     27            ]);
     28 
     29            assert_equals(document.fullscreenElement, iframe1);
     30 
     31            await Promise.all([
     32                trusted_request(
     33                    iframe2.contentDocument.body,
     34                    iframe1.contentDocument.body
     35                ),
     36                fullScreenChange(iframe2.contentDocument),
     37            ]);
     38        }, "Element ready check for containing iframe");
     39    };
     40 </script>