mirror of
https://github.com/servo/servo.git
synced 2025-06-12 18:34:39 +00:00
36 lines
643 B
HTML
36 lines
643 B
HTML
<html>
|
|
<head>
|
|
<script src="harness.js"></script>
|
|
</head>
|
|
<body>
|
|
<script>
|
|
waitForExplicitFinish();
|
|
|
|
var onloads = 0;
|
|
function check(ev) {
|
|
is_a(ev, Event);
|
|
ev.preventDefault();
|
|
is(ev.defaultPrevented, false);
|
|
is(ev.target, document);
|
|
is(ev.currentTarget, window);
|
|
if (onloads == 2) {
|
|
finish();
|
|
}
|
|
}
|
|
|
|
window.onload = function(ev) {
|
|
_fail("this inline handler should be overwritten");
|
|
}
|
|
window.onload = function(ev) {
|
|
onloads++;
|
|
is(onloads, 1);
|
|
check(ev);
|
|
}
|
|
addEventListener("load", function(ev) {
|
|
onloads++;
|
|
is(onloads, 2);
|
|
check(ev);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|