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> <script src="/resources/testharnessreport.js"></script>
<body> <body>
<script> <script>
var e = document.body; test(function() {
e.setAttribute("onclick", "console.log('x')"); var e = document.body;
assert_not_equals(e.onclick, null); e.setAttribute("onclick", "console.log('x')");
assert_not_equals(e.onclick, null); assert_not_equals(e.onclick, null);
done(); assert_not_equals(e.onclick, null);
});
</script> </script>
</body> </body>

View file

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