Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Verify that aborted image requests do not cause extraneous load events.
  • Loading branch information
jdm committed Mar 7, 2017
1 parent 330e222 commit db79dfb
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/wpt/mozilla/meta/MANIFEST.json
Expand Up @@ -12874,6 +12874,12 @@
{}
]
],
"mozilla/img_multiple_request.html": [
[
"/_mozilla/mozilla/img_multiple_request.html",
{}
]
],
"mozilla/img_width_height.html": [
[
"/_mozilla/mozilla/img_width_height.html",
Expand Down Expand Up @@ -25345,6 +25351,10 @@
"3c4f36abed83367c851d943b1f25b8394de6fe75",
"testharness"
],
"mozilla/img_multiple_request.html": [
"0a6263ad87c9b3307f2dc694747b094a0517b79b",
"testharness"
],
"mozilla/img_width_height.html": [
"37a04735261a6d2b36c3d529ce81eda46ed6967e",
"testharness"
Expand Down
25 changes: 25 additions & 0 deletions tests/wpt/mozilla/tests/mozilla/img_multiple_request.html
@@ -0,0 +1,25 @@
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(function(t) {
var i = new Image();
i.src = "2x2.png";
i.src = "2x2.png";
i.onload = t.step_func(function() {
i.onload = this.unreached_func("Load event for aborted request.");
t.step_timeout(t.step_func_done(), 100);
});
}, "Multiple requests for the same URL do not trigger multiple load events.");

async_test(function(t) {
var i = new Image();
i.src = "test.png";
i.src = "2x2.png";
i.onload = t.step_func(function() {
i.onload = this.unreached_func("Load event for aborted request.");
t.step_timeout(t.step_func_done(), 100);
});
}, "Multiple requests for different URL do not trigger multiple load events.");
</script>

0 comments on commit db79dfb

Please sign in to comment.