Make content tests synchronous by default. Fixes #884.

This commit is contained in:
Josh Matthews 2014-11-06 21:39:46 -08:00
parent 338a9c3f05
commit 711f4d5af9
72 changed files with 20 additions and 105 deletions

View file

@ -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();
}
});