tor-browser

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

test_bug590812.html (1593B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <title>Test for XML pretty printing, bug 590812</title>
      5  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      6  <script src="/tests/SimpleTest/WindowSnapshot.js"></script>
      7  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
      8 </head>
      9 <body>
     10 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=590812">Mozilla Bug 590812</a>
     11 <p id="display"></p>
     12 <iframe id=iframe></iframe>
     13 <iframe src="file_bug590812-ref.xhtml"></iframe>
     14 <pre id="test">
     15 <script class="testbody" type="application/javascript">
     16 
     17 add_task(async function start() {
     18  var noxul = "https://sub1.test1.example.com:443";
     19  var yesxul = "https://example.org:443"
     20 
     21  await SpecialPowers.pushPermissions([
     22    { type: "allowXULXBL", allow: false, context: noxul },
     23    { type: "allowXULXBL", allow: true, context: yesxul }
     24  ]);
     25 
     26  var path = "/tests/dom/base/test/file_bug590812.xml";
     27  var iframe = $('iframe');
     28  iframe.src = noxul + path;
     29  await new Promise(resolve => iframe.addEventListener("load", resolve, {once: true}));
     30  let sNoXUL = await snapshotWindow(window.frames[0], false);
     31 
     32  iframe.src = yesxul + path;
     33  await new Promise(resolve => iframe.addEventListener("load", resolve, {once: true}));
     34  let sWithXUL = await snapshotWindow(window.frames[0], false);
     35 
     36  let sRef = await snapshotWindow(window.frames[1], false);
     37 
     38  let res;
     39  ok(compareSnapshots(sNoXUL, sRef, true)[0],
     40     "noxul domain same as ref");
     41  ok(compareSnapshots(sWithXUL, sRef, true)[0],
     42     "xul supporting domain same as ref");
     43 });
     44 
     45 </script>
     46 </pre>
     47 </body>
     48 </html>