security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecurePicture.html

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:a81183e89e0e
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>img.src changes to unsecure test</title>
5 <script type="text/javascript" src="/MochiKit/Base.js"></script>
6 <script type="text/javascript" src="/MochiKit/DOM.js"></script>
7 <script type="text/javascript" src="/MochiKit/Style.js"></script>
8 <script type="text/javascript" src="/MochiKit/Signal.js"></script>
9 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
10 <script type="text/javascript" src="mixedContentTest.js"></script>
11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
12
13 <script class="testbody" type="text/javascript">
14
15 function runTest()
16 {
17 isSecurityState("secure");
18 window.setTimeout(function() {
19 // Don't do this synchronously from onload handler
20 document.getElementById("image1").src =
21 "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg";
22 }, 0);
23
24 waitForSecurityState("broken", function()
25 {
26 isSecurityState("broken", "src='http://...' changed to broken");
27 finish();
28 });
29 }
30
31 function afterNavigationTest()
32 {
33 is(document.getElementById("image1").src,
34 "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg",
35 "img.src secure again");
36 isSecurityState("secure", "security full after navigation");
37 finish();
38 }
39
40 </script>
41 </head>
42
43 <body>
44 <img id="image1" src="https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg" />
45 </body>
46 </html>

mercurial