Skip to content

Commit

Permalink
Fix html/webappapis/scripting/events/event-handler-attributes-body-wi…
Browse files Browse the repository at this point in the history
…ndow.html (#3873)

Fix html/webappapis/scripting/events/event-handler-attributes-body-window.html so
that it no longer requires user interaction before moving on to the next test.
The test is registering a number of event listeners on the body / window, which
caused a confirmation dialog to be shown on unload.

So that the test can be run in an automated fashion, we now unregister the event
listeners at the end of the test. We now also checks that the event listeners
have properly been unregistered.
  • Loading branch information
Chris Dumez authored and jdm committed Oct 4, 2016
1 parent 3a9dea9 commit 283ee74
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,14 @@
}, handler);
});

handlers.forEach(function(handler) {
document.body['on' + handler] = null;
});

handlers.forEach(function(handler) {
test(function() {
assert_equals(document.body['on' + handler], null);
assert_equals(window['on' + handler], null);
}, handler + " removal");
});
</script>

0 comments on commit 283ee74

Please sign in to comment.