blob: 2c0e7668e22dcafec05ce4144287aac21388ced9 [file] [log] [blame]
<html>
<head>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script>
var t = async_test("window.stop() can stop loading of multipart images");
function firstPartLoaded()
{
const url = "resources/multipart.php?interval=1&loop=1&img1=2x2-green.png&img2=abe.png";
if (window.internals) {
assert_true(internals.isLoading(url), "The image should be loading before window.stop().");
}
window.stop();
// We emulate window load event to signal testharness.js that we don't
// have to wait for window load event (that will never occur because
// we've called window.stop()) before test completes.
dispatchEvent(new Event('load'));
window.setTimeout(t.step_func(function() {
if (window.internals) {
assert_false(internals.isLoading(url), "The image should not be loading after window.stop().");
}
t.done();
}), 100);
}
</script>
</head>
<body>
<img id=testingImage src="resources/multipart.php?interval=1&loop=1&img1=2x2-green.png&img2=abe.png" onload="t.step(firstPartLoaded)">
</body>
</html>