зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1426467: Part 1: Rewrite test_cache_worker_gc.html to use async functions. r=baku
This just cleans up the function a bit to make the next change easier to see. No behavior change intended. Differential Revision: https://phabricator.services.mozilla.com/D9217 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
1fecf36e2c
Коммит
12b557b02d
|
@ -29,18 +29,19 @@ function gc() {
|
|||
});
|
||||
}
|
||||
|
||||
var weakWorker;
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
startWorker().then(w => {
|
||||
weakWorker = SpecialPowers.Cu.getWeakReference(w);
|
||||
|
||||
async function test() {
|
||||
let w = await startWorker();
|
||||
let weakWorker = SpecialPowers.Cu.getWeakReference(w);
|
||||
ok(weakWorker, 'worker supports weak reference');
|
||||
}).then(_ => {
|
||||
return gc();
|
||||
}).then(_ => {
|
||||
w = null;
|
||||
await gc();
|
||||
ok(!weakWorker.get(), 'worker weak reference should be garbage collected');
|
||||
SimpleTest.finish();
|
||||
});
|
||||
}
|
||||
|
||||
test();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Загрузка…
Ссылка в новой задаче