We have more than 1,000 layout tests to just confirm not crashed.
A typical test is:
foo-crash.html:
if (window.testRunner) {
testRunner.dumpAsText();
//…testing..
document.body = document.createElement(‘body’);
document.body.textContent = 'PASS if not crashed.';
foo-crash-expected.txt:
PASS if not crashed.
In addition if we can’t set body textContext because of test case,
we sometimes need to use ‘iframe trick’ such as:
bar-crash.html:
if (window.testRunner) {
testRunner.waitUntilDone();
<iframe src=bar-crash-body.html>
document.body = document.createElement(‘body’);
document.body.textContent = 'OK!';
and bar-crash-body.html and bar-crash-expected.txt
This bureaucracy is very annoying both to write and read.
Thus I propose 2 ways:
Add test behavior for *-crash.html.
If run-webkit-test processes *-crash.html, it confirms just the file doesn’t cause crash
so that we don’t need -crash-expected.txt, textContent insertion and the iframe trick.
2. Add testRunner.finishWithoutCrash() function;
the function outputs ‘OK’ so we can also remove textContent and the iframe trick and unify -crash-expected.txt format.
2. Add testRunner.finishWithoutCrash() function;
the function outputs ‘OK’ so we can also remove textContent and the iframe trick and unify -crash-expected.txt format.
There should be a presubmit check too, so that upload does not require -expected when testharness.js is used.
I'd rather we didn't use testharness.js, many crash tests require subtle or very specific actions to happen in a specific order and having this test runner doing lots of things around your code make it easy to have it not really test what you want.
I'd prefer we just use a special name.
> The premise of this proposal is that it's annoying to have empty> -expected.txt files.Plus, sometimes we need to write tricky code to output description and result inside