blob: 5c68de29e90a5c84ece9a9a95a77aec6b5301ac3 [file] [log] [blame]
<!DOCTYPE html>
<meta charset="utf-8">
<title>Detached image blocks load</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
var img_loaded = false;
var img = new Image();
img.onload = function() {
img_loaded = true;
};
img.src = "/images/blue.png?pipe=trickle(d2)";
test(function() {
assert_false(img_loaded);
}, "setting img.src is async");
async_test(function(t) {
document.addEventListener("DOMContentLoaded", t.step_func_done(function() {
assert_false(img_loaded);
}));
}, "DOMContentLoaded doesn't wait for images");
async_test(function(t) {
window.addEventListener("load", t.step_func_done(function() {
assert_true(img_loaded);
}));
}, "load waits for images");
</script>