Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/images/force-reload-image-document.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/images/force-reload-image-document.html b/third_party/WebKit/LayoutTests/http/tests/images/force-reload-image-document.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..37ee2748f911ec471bef4ec653e8f669472fe71c |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/http/tests/images/force-reload-image-document.html |
| @@ -0,0 +1,29 @@ |
| +<!DOCTYPE html> |
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| +<script> |
| +var t = async_test("ForceReload should get a new image for an image document"); |
| + |
| +function triggerReload() { |
| + // This depends on how image documents are implemented by Blink. |
| + var iframe = document.getElementById('iframe'); |
| + var img = iframe.contentDocument.body.getElementsByTagName('img')[0]; |
| + var originalWidth = img.width; |
| + var originalHeight = img.height; |
| + |
| + img.onload = t.step_func_done(function() { |
| + assert_not_equals(originalWidth, img.width, "Should be reloaded: width"); |
| + assert_not_equals(originalHeight, img.height, "Should be reloaded: height"); |
| + }); |
| + |
|
yhirano
2017/05/12 10:30:43
+img.onerror
hiroshige
2017/05/12 17:14:51
Done.
|
| + if (window.internals) { |
| + internals.forceImageReload(img); |
| + } |
| +} |
| +</script> |
| + |
| +<!-- We call triggerReload() strictly after document load event, |
| +because reloading is not enforced until document load event is finished. --> |
| +<body onload="setTimeout(t.step_func(triggerReload), 0)"> |
| +<iframe id="iframe" src="../cache/resources/random-cached-image.php?id=2"></iframe> |
| +</body> |