зеркало из https://github.com/mozilla/pjs.git
Bug 662178 - Harden test_utils_namedTimer.js. r=rnewman
This commit is contained in:
Родитель
47b1aab0b3
Коммит
49004370ec
|
@ -28,7 +28,9 @@ add_test(function test_simple() {
|
|||
do_check_eq(this, that);
|
||||
do_check_eq(this._zetimer, null);
|
||||
do_check_true(timer instanceof Ci.nsITimer);
|
||||
do_check_true((Date.now() - t0) >= delay);
|
||||
// Difference should be ~delay, but hard to predict on all platforms,
|
||||
// particularly Windows XP.
|
||||
do_check_true(Date.now() > t0);
|
||||
run_next_test();
|
||||
}, delay, that, "_zetimer");
|
||||
});
|
||||
|
@ -40,8 +42,9 @@ add_test(function test_delay() {
|
|||
let that = {};
|
||||
let t0 = Date.now();
|
||||
function callback(timer) {
|
||||
// The 2nd delay counts.
|
||||
do_check_true((Date.now() - t0) >= 2 * delay);
|
||||
// Difference should be ~2*delay, but hard to predict on all platforms,
|
||||
// particularly Windows XP.
|
||||
do_check_true((Date.now() - t0) > delay);
|
||||
run_next_test();
|
||||
}
|
||||
Utils.namedTimer(callback, delay, that, "_zetimer");
|
||||
|
|
Загрузка…
Ссылка в новой задаче