mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update web-platform-tests to revision 6fa9de7201cd41564d02c3edd62365aeb40e171b
This commit is contained in:
parent
60f1ffc5a7
commit
dc1f7ba3ec
124 changed files with 2052 additions and 849 deletions
|
@ -10,12 +10,20 @@ async_test(function(t) {
|
|||
var img = document.getElementById("brokenurl");
|
||||
img.src = "http://[";
|
||||
var errorevent = false;
|
||||
var loadendevent = false;
|
||||
|
||||
// The errors should be queued in the event loop, so they should only trigger
|
||||
// after this block of code finishes, not during the img.src setter itself
|
||||
img.addEventListener('error', t.step_func(function(){errorevent = true;}));
|
||||
img.addEventListener('loadend', t.step_func_done(function() {
|
||||
img.addEventListener('error', t.step_func(function() {
|
||||
assert_false(loadendevent, "loadend should fire after error");
|
||||
errorevent = true;
|
||||
t.step_timeout(t.step_func_done(function() {
|
||||
assert_true(loadendevent, "loadend event fired");
|
||||
}), 0);
|
||||
}));
|
||||
img.addEventListener('loadend', t.step_func(function() {
|
||||
assert_true(errorevent, "error event fired");
|
||||
loadendevent = true;
|
||||
}));
|
||||
}, 'src="http://["');
|
||||
|
||||
|
@ -31,8 +39,8 @@ async_test(function(t) {
|
|||
// Queue this check in the event loop to check there is no loadend event
|
||||
// fired.
|
||||
t.step_timeout(t.step_func_done(function() {
|
||||
assert_false(loadendevent, "loadend event should not fired");
|
||||
}), 0)
|
||||
assert_false(loadendevent, "loadend event should not be fired");
|
||||
}), 0);
|
||||
}));
|
||||
img.addEventListener('loadend', t.step_func(function() {
|
||||
loadendevent = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue