OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <picture></picture> | 4 <picture></picture> |
5 | 5 |
6 <script src="/resources/testharness.js"></script> | 6 <script src="/resources/testharness.js"></script> |
7 <script src="/resources/testharnessreport.js"></script> | 7 <script src="/resources/testharnessreport.js"></script> |
8 <script> | 8 <script> |
9 if (window.testRunner) | 9 if (window.testRunner) |
10 testRunner.overridePreference("WebKitAllowRunningInsecureContent", false
); | 10 testRunner.overridePreference("WebKitAllowRunningInsecureContent", false
); |
11 | 11 |
12 var t = async_test("Testing an insecure image in a <picture> element."); | 12 var t = async_test("Testing an insecure image in a <picture> element."); |
13 | 13 |
14 window.onload = t.step_func(function () { | 14 window.onload = t.step_func(function () { |
15 var img = document.createElement('img'); | 15 var img = document.createElement('img'); |
16 | 16 |
17 img.addEventListener('load', t.step_func(function() { | 17 img.addEventListener('load', t.step_func(function() { |
18 assert_unreached("The image should not load."); | 18 assert_unreached("The image should not load."); |
19 t.done(); | 19 t.done(); |
20 })); | 20 })); |
21 | 21 |
22 img.addEventListener('error', t.step_func(function() { | 22 img.addEventListener('error', t.step_func(function() { |
23 assert_equals(0, img.naturalHeight, "Should have 0 naturalHeight"); | 23 assert_equals(0, img.naturalHeight, "Should have 0 naturalHeight"); |
24 assert_equals(0, img.naturalWidth, "Should have 0 naturalWidth"); | 24 assert_equals(0, img.naturalWidth, "Should have 0 naturalWidth"); |
25 t.done(); | 25 t.done(); |
26 })); | 26 })); |
27 | 27 |
28 document.querySelector('picture').appendChild(img); | 28 document.querySelector('picture').appendChild(img); |
29 img.src = "http://127.0.0.1:8080/security/resources/compass.jpg"; | 29 img.src = "http://example.test:8080/security/resources/compass.jpg"; |
30 }); | 30 }); |
31 </script> | 31 </script> |
32 </body> | 32 </body> |
33 </html> | 33 </html> |
OLD | NEW |