Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../resources/testharness.js"></script> | |
| 3 <script src="../resources/testharnessreport.js"></script> | |
| 4 <script> | |
| 5 var t = async_test("ForceReload should get a new image for an image document"); | |
| 6 | |
| 7 function triggerReload() { | |
| 8 // This depends on how image documents are implemented by Blink. | |
| 9 var iframe = document.getElementById('iframe'); | |
| 10 var img = iframe.contentDocument.body.getElementsByTagName('img')[0]; | |
| 11 var originalWidth = img.width; | |
| 12 var originalHeight = img.height; | |
| 13 | |
| 14 img.onload = t.step_func_done(function() { | |
| 15 assert_not_equals(originalWidth, img.width, "Should be reloaded: width"); | |
| 16 assert_not_equals(originalHeight, img.height, "Should be reloaded: height"); | |
| 17 }); | |
| 18 | |
|
yhirano
2017/05/12 10:30:43
+img.onerror
hiroshige
2017/05/12 17:14:51
Done.
| |
| 19 if (window.internals) { | |
| 20 internals.forceImageReload(img); | |
| 21 } | |
| 22 } | |
| 23 </script> | |
| 24 | |
| 25 <!-- We call triggerReload() strictly after document load event, | |
| 26 because reloading is not enforced until document load event is finished. --> | |
| 27 <body onload="setTimeout(t.step_func(triggerReload), 0)"> | |
| 28 <iframe id="iframe" src="../cache/resources/random-cached-image.php?id=2"></ifra me> | |
| 29 </body> | |
| OLD | NEW |