tor-browser

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

file_youtube_flash_embed.html (2810B)


      1 <!DOCTYPE HTML>
      2 <html>
      3  <!--
      4       https://bugzilla.mozilla.org/show_bug.cgi?id=1240471
      5     -->
      6  <head>
      7    <meta charset="utf-8">
      8    <title>Test for Bug 1240471</title>
      9    <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     10    <script type="application/javascript">
     11     let SimpleTest = {
     12       finish() {
     13    parent.postMessage(JSON.stringify({fn: "finish"}), "*");
     14  }
     15     };
     16     ["ok", "is", "info"].forEach(fn => {
     17       self[fn] = function (...args) {
     18         parent.postMessage(JSON.stringify({fn, args}), "*");
     19       }
     20     });
     21     "use strict";
     22     function onLoad() {
     23       let youtube_changed_url_query = "https://mochitest.youtube.com/embed/Xm5i5kbIXzc?start=10&end=20";
     24 
     25       function testEmbed(embed, expected_url, expected_fullscreen) {
     26         ok (!!embed, "Embed node exists");
     27         // getSVGDocument will return HTMLDocument if the content is HTML
     28         let doc = embed.getSVGDocument();
     29         // doc must be unprivileged because privileged doc will always be
     30         // allowed to use fullscreen.
     31         is (doc.fullscreenEnabled, expected_fullscreen,
     32             "fullscreen should be " + (expected_fullscreen ? "enabled" : "disabled"));
     33         embed = SpecialPowers.wrap(embed);
     34         is (embed.srcURI.spec, expected_url, "Should have src uri of " + expected_url);
     35       }
     36       info("Running youtube rewrite query test");
     37       testEmbed(document.getElementById("testembed-correct"), youtube_changed_url_query, false);
     38       testEmbed(document.getElementById("testembed-correct-fs"), youtube_changed_url_query, true);
     39       testEmbed(document.getElementById("testembed-wrong"), youtube_changed_url_query, false);
     40       testEmbed(document.getElementById("testembed-whywouldyouevendothat"), youtube_changed_url_query, true);
     41       SimpleTest.finish();
     42     }
     43    </script>
     44  </head>
     45  <body onload="onLoad()">
     46    <embed id="testembed-correct"
     47           src="https://mochitest.youtube.com/v/Xm5i5kbIXzc?start=10&end=20"
     48           type="application/x-shockwave-flash"
     49           allowscriptaccess="always"></embed>
     50    <embed id="testembed-correct-fs"
     51           src="https://mochitest.youtube.com/v/Xm5i5kbIXzc?start=10&end=20"
     52           type="application/x-shockwave-flash"
     53           allowfullscreen
     54           allowscriptaccess="always"></embed>
     55    <embed id="testembed-wrong"
     56           src="https://mochitest.youtube.com/v/Xm5i5kbIXzc&start=10&end=20"
     57           type="application/x-shockwave-flash"
     58           allowscriptaccess="always"></embed>
     59    <embed id="testembed-whywouldyouevendothat"
     60           src="https://mochitest.youtube.com/v/Xm5i5kbIXzc&start=10?end=20"
     61           type="application/x-shockwave-flash"
     62           allowfullscreen
     63           allowscriptaccess="always"></embed>
     64  </body>
     65 </html>