Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move David Bruant's DOM Events tests into position. #58

Merged
merged 8 commits into from
Oct 6, 2013
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<button type="button" id="test">Start test</button>

<script>
var t = async_test("Event phases order");

Expand All @@ -28,4 +26,4 @@

<div id="parent">
<div id="child"></div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
<!DOCTYPE html>
<!-- Submitted from TestTWF Paris -->
<meta charset="UTF-8">
<title>Throwing in event listener generates an error event on the window object</title>

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<button type="button" id="test">Start test</button>

<script>
var t = async_test("Throwing in event listener generates an error event on the window object");

var errorEvent = false;

window.addEventListener('error', function(e){
window.onerror = function(e) {
errorEvent = e;
});
}

document.addEventListener('DOMContentLoaded', function(){
document.addEventListener('DOMContentLoaded', t.step_func(function(){
var element = document.getElementById('bim');

element.addEventListener('click', function(){
Expand All @@ -26,10 +24,10 @@

element.click();

assert_true(typeof errorEvent === 'object');
assert_equals(typeof errorEvent, 'string');
t.done();
});
}));
</script>

<div id="bim">
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<!DOCTYPE html>
<!-- Submitted from TestTWF Paris -->
<meta charset="UTF-8">
<title>Throwing in event listener</title>

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<button type="button" id="test">Start test</button>

<script>
var t = async_test("Throwing in event listener");
Expand All @@ -29,4 +27,4 @@
</script>

<div id="bim">
</div>
</div>