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 <img> element"); | |
| 6 function triggerReload() { | |
| 7 var img = document.getElementById('img'); | |
| 8 var originalWidth = img.width; | |
| 9 var originalHeight = img.height; | |
| 10 | |
| 11 img.onload = t.step_func_done(function() { | |
| 12 assert_not_equals(originalWidth, img.width, "Should be reloaded: width"); | |
| 13 assert_not_equals(originalHeight, img.height, "Should be reloaded: height"); | |
| 14 }); | |
| 15 | |
|
yhirano
2017/05/12 10:30:43
+img.onerror
hiroshige
2017/05/12 17:14:51
Done.
| |
| 16 if (window.internals) { | |
| 17 internals.forceImageReload(img); | |
| 18 } | |
| 19 } | |
| 20 </script> | |
| 21 | |
| 22 <!-- We call triggerReload() strictly after document load event, | |
| 23 because reloading is not enforced until document load event is finished. --> | |
| 24 <body onload="setTimeout(t.step_func(triggerReload), 0)"> | |
| 25 <img id="img" src="../cache/resources/random-cached-image.php?id=1"> | |
|
yhirano
2017/05/12 10:30:43
[optional] I think using the test name as id is sa
hiroshige
2017/05/12 17:14:51
Done.
| |
| 26 </body> | |
| OLD | NEW |