fire error when placeholder image is loaded

This commit is contained in:
Gregory Terzian 2018-08-13 23:47:35 +02:00
parent 6b6fc7de92
commit 7b8d903d57
3 changed files with 60 additions and 24 deletions

View file

@ -13976,6 +13976,12 @@
{}
]
],
"mozilla/img_placeholder_load.html": [
[
"/_mozilla/mozilla/img_placeholder_load.html",
{}
]
],
"mozilla/img_width_height.html": [
[
"/_mozilla/mozilla/img_width_height.html",
@ -27043,6 +27049,10 @@
"e9f1b56ac4c49c146868123a9a73f55c85ae3771",
"testharness"
],
"mozilla/img_placeholder_load.html": [
"c90b0041a4bc4c255819839cec7265ae65454674",
"testharness"
],
"mozilla/img_width_height.html": [
"ec68ac34ee2a35aebb38eb297a33a1cd98f5893c",
"testharness"

View file

@ -0,0 +1,21 @@
<!DOCTYPE HTML>
<meta charset="utf-8">
<title>Loading a placeholder image should trigger an error on the img element</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<img>
<script>
async_test(function(t) {
var img = document.querySelector("img");
img.onload = this.step_func_done(function() {
assert_unreached("image.onload() was not supposed to be called");
});
img.onerror = this.step_func_done(function(e) {
assert_equals(e.type, "error", "image.onerror() called");
t.done();
});
img.src = "http://whatevertheheckawefawefawe.org/img.gif";
});
</script>