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