test_dynDelayedUnsecurePicture.html (1308B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>img.src 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 12 async function runTest() 13 { 14 await isSecurityState("secure"); 15 window.setTimeout(function() { 16 // Don't do this synchronously from onload handler 17 document.getElementById("image1").src = 18 "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg"; 19 }, 0); 20 21 waitForSecurityState("broken", async () => 22 { 23 await isSecurityState("broken", "src='http://...' changed to broken"); 24 finish(); 25 }); 26 } 27 28 async function afterNavigationTest() 29 { 30 is(document.getElementById("image1").src, 31 "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg", 32 "img.src secure again"); 33 await isSecurityState("secure", "security full after navigation"); 34 finish(); 35 } 36 37 </script> 38 </head> 39 40 <body> 41 <img id="image1" src="https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg" /> 42 </body> 43 </html>