tor-browser

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

test_innerHtmlDelayedUnsecurePicture.html (1122B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <title>innerHTML changes to unsecure test</title>
      5  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      6  <script type="text/javascript" src="mixedContentTest.js"></script>
      7  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
      8 
      9  <script class="testbody" type="text/javascript">
     10  "use strict";
     11  SimpleTest.requestFlakyTimeout("Timeout in mixedContentTest");
     12 
     13  async function runTest()
     14  {
     15    await isSecurityState("secure");
     16 
     17    window.setTimeout(function () {
     18      document.getElementById("buddy").innerHTML =
     19        "<img id='image1' src='http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg' />";
     20    }, 1);
     21 
     22    waitForSecurityState("broken", async () => {
     23      await isSecurityState("broken", "innerHTML loading insecure changed to broken");
     24      finish();
     25    });
     26  }
     27 
     28  async function afterNavigationTest()
     29  {
     30    is(document.getElementById("buddy").innerHTML, "\n", "innerHTML back to previous");
     31    await isSecurityState("secure");
     32    finish();
     33  }
     34 
     35  </script>
     36 </head>
     37 
     38 <body id="buddy"></body></html>