Bug 1936575 - PART 2: Do not trigger default browser prompt until ToS is accepted...
[gecko.git] / security / manager / ssl / tests / mochitest / mixedcontent / test_dynDelayedUnsecureXHR.html
blobf59c03e47f0051353815259bdbfe656af6f5afdc
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>unsecure XHR 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" />
9 <script class="testbody" type="text/javascript">
10 "use strict";
12 hasMixedActiveContent = true;
14 async function runTest()
16 await isSecurityState("secure");
17 window.setTimeout(async () => {
18 try {
19 let req = new XMLHttpRequest();
20 req.open("GET", "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/alloworigin.sjs", false);
21 req.send(null);
23 // Change should be immediate, the request was sent synchronously
24 await isSecurityState("broken", "security broken after insecure XHR");
25 } catch (ex) {
26 ok(false, ex);
29 finish();
30 }, 0);
33 async function afterNavigationTest()
35 await isSecurityState("secure", "security full after navigation");
36 finish();
39 </script>
40 </head>
42 <body>
43 </body>
44 </html>