test_bug472986.html (1192B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>img.src replace</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 SimpleTest.expectAssertions(0, 4); 13 14 // Clear the default onload assigned to test start because we must 15 // wait for replaced image to load and only after that test the security state 16 var onLoadFunction = window.onload; 17 window.onload = function() 18 { 19 let img1 = document.getElementById("img1"); 20 img1.addEventListener("load", onLoadFunction); 21 img1.src = "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg"; 22 }; 23 24 async function runTest() 25 { 26 await isSecurityState("secure", "secure"); 27 finish(); 28 } 29 30 async function afterNavigationTest() 31 { 32 await isSecurityState("secure", "secure after navigation"); 33 finish(); 34 } 35 36 </script> 37 </head> 38 39 <body> 40 <img id="img1" src="https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/hugebmp.sjs" /> 41 </body> 42 </html>