Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/loading/image-picture-download-after-shrink.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/loading/image-picture-download-after-shrink.html b/third_party/WebKit/LayoutTests/http/tests/loading/image-picture-download-after-shrink.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9984950675b6254513453e11305c6533dd7205b2 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/http/tests/loading/image-picture-download-after-shrink.html |
| @@ -0,0 +1,22 @@ |
| +<!DOCTYPE html> |
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| +<script> |
| + var t = async_test('Make sure that previousely non-matching source based image resources are downloaded after the viewport changes.'); |
|
cbiesinger
2016/09/02 19:09:21
previousely -> previously
|
| +</script> |
| +<iframe id=frame src="resources/image-picture-download-after-shrink-frame.html" width="700px"></iframe> |
| +<script> |
| + window.addEventListener("message", t.step_func(function(msg) { |
| + if (msg.data == "shrink") { |
| + document.getElementsByTagName("iframe")[0].width = "150px"; |
| + } else if (msg.data.indexOf("test_") != -1) { |
| + assert_equals(msg.data, "test_2"); |
| + t.done(); |
| + } |
| + })); |
| + |
| + // Since we want to see that a new resource wasn't downloaded, the only way is a timeout. |
| + setTimeout(t.step_func(function() { |
| + document.getElementById("frame").contentWindow.postMessage("test", "*"); |
| + }), 500); |
| +</script> |