Convert deprecated single-page tests to use proper test harness.

This commit is contained in:
Josh Matthews 2019-11-13 16:58:55 -05:00
parent 610d7d48be
commit ebf54c9788
4 changed files with 18 additions and 24 deletions

View file

@ -1,2 +0,0 @@
[inline-event-listener-panic.html]
expected: ERROR

View file

@ -1,6 +0,0 @@
[window_requestAnimationFrame2.html]
type: testharness
expected: ERROR
[Test throwing an error inside requestAnimationFrame callback]
expected: FAIL

View file

@ -5,10 +5,11 @@
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
var e = document.body;
e.setAttribute("onclick", "console.log('x')");
assert_not_equals(e.onclick, null);
assert_not_equals(e.onclick, null);
done();
test(function() {
var e = document.body;
e.setAttribute("onclick", "console.log('x')");
assert_not_equals(e.onclick, null);
assert_not_equals(e.onclick, null);
});
</script>
</body>

View file

@ -6,18 +6,19 @@
</head>
<body>
<script>
var stepCalled = false;
function step() {
if (stepCalled) {
setTimeout(done, 0);
} else {
stepCalled = true;
window.requestAnimationFrame(step);
setup({allow_uncaught_exception: true});
async_test(function(t) {
var throwDidNotInterrupt = false;
function step() {
window.requestAnimationFrame(t.step_func(function() {
assert_true(throwDidNotInterrupt, "rAF should not throw errors");
t.done();
}));
throw new Error();
}
throw new Error();
}
window.requestAnimationFrame(step);
assert_equals(true, true, "rAF should not throw errors");
window.requestAnimationFrame(step);
throwDidNotInterrupt = true;
});
</script>
</body>
</html>