mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make content tests synchronous by default. Fixes #884.
This commit is contained in:
parent
338a9c3f05
commit
711f4d5af9
72 changed files with 20 additions and 105 deletions
|
@ -75,6 +75,9 @@ function check_disabled_selector(elem, disabled) {
|
|||
var _test_complete = false;
|
||||
var _test_timeout = 10000; //10 seconds
|
||||
function finish() {
|
||||
if (_test_complete) {
|
||||
_fail('finish called multiple times');
|
||||
}
|
||||
if (_expectations > _tests) {
|
||||
_fail('expected ' + _expectations + ' tests, fullfilled ' + _tests);
|
||||
}
|
||||
|
@ -90,3 +93,14 @@ function _test_timed_out() {
|
|||
}
|
||||
|
||||
setTimeout(_test_timed_out, _test_timeout);
|
||||
|
||||
var _needs_finish = false;
|
||||
function waitForExplicitFinish() {
|
||||
_needs_finish = true;
|
||||
}
|
||||
|
||||
addEventListener('load', function() {
|
||||
if (!_needs_finish) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue