зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1338255 - Remove remaining legacy generator from js/xpconnect/tests/. r=bholley
This commit is contained in:
Родитель
470c96cd31
Коммит
014382051d
|
@ -95,18 +95,14 @@ function checkWatchdog(expectInterrupt, continuation) {
|
|||
});
|
||||
}
|
||||
|
||||
var gGenerator;
|
||||
function continueTest() {
|
||||
gGenerator.next();
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
|
||||
// Run async.
|
||||
do_test_pending();
|
||||
|
||||
// Instantiate the generator and kick it off.
|
||||
gGenerator = testBody();
|
||||
gGenerator.next();
|
||||
// Run the async function.
|
||||
testBody().then(() => {
|
||||
do_test_finished();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -2,11 +2,8 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
function testBody() {
|
||||
async function testBody() {
|
||||
// Check that we properly implement whatever behavior is specified by the
|
||||
// default profile for this configuration.
|
||||
checkWatchdog(isWatchdogEnabled(), continueTest);
|
||||
yield;
|
||||
do_test_finished();
|
||||
yield;
|
||||
await checkWatchdog(isWatchdogEnabled());
|
||||
}
|
||||
|
|
|
@ -2,10 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
function testBody() {
|
||||
async function testBody() {
|
||||
setWatchdogEnabled(false);
|
||||
checkWatchdog(false, continueTest);
|
||||
yield;
|
||||
do_test_finished();
|
||||
yield;
|
||||
await checkWatchdog(false);
|
||||
}
|
||||
|
|
|
@ -2,10 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
function testBody() {
|
||||
async function testBody() {
|
||||
setWatchdogEnabled(true);
|
||||
checkWatchdog(true, continueTest);
|
||||
yield;
|
||||
do_test_finished();
|
||||
yield;
|
||||
await checkWatchdog(true);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
function testBody() {
|
||||
async function testBody() {
|
||||
|
||||
setWatchdogEnabled(true);
|
||||
|
||||
|
@ -23,10 +23,11 @@ function testBody() {
|
|||
// scheduling, we should never have more than 3 seconds of inactivity without
|
||||
// hibernating. To add some padding for automation, we mandate that hibernation
|
||||
// must begin between 2 and 5 seconds from now.
|
||||
await new Promise(resolve => {
|
||||
var timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
timer.initWithCallback(continueTest, 10000, Ci.nsITimer.TYPE_ONE_SHOT);
|
||||
timer.initWithCallback(resolve, 10000, Ci.nsITimer.TYPE_ONE_SHOT);
|
||||
simulateActivityCallback(false);
|
||||
yield;
|
||||
});
|
||||
|
||||
simulateActivityCallback(true);
|
||||
busyWait(1000); // Give the watchdog time to wake up on the condvar.
|
||||
|
@ -47,7 +48,4 @@ function testBody() {
|
|||
do_check_true(startHibernation > now + 2*1000*1000 - FUZZ_FACTOR);
|
||||
do_check_true(startHibernation < now + 5*1000*1000 + FUZZ_FACTOR);
|
||||
do_check_true(stopHibernation > now + 10*1000*1000 - FUZZ_FACTOR);
|
||||
|
||||
do_test_finished();
|
||||
yield;
|
||||
}
|
||||
|
|
|
@ -2,12 +2,9 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
function testBody() {
|
||||
async function testBody() {
|
||||
var defaultBehavior = isWatchdogEnabled();
|
||||
setWatchdogEnabled(!defaultBehavior);
|
||||
setWatchdogEnabled(defaultBehavior);
|
||||
checkWatchdog(defaultBehavior, continueTest);
|
||||
yield;
|
||||
do_test_finished();
|
||||
yield;
|
||||
await checkWatchdog(defaultBehavior);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче