mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 08:13:35 +00:00
Bug 1586393, part 1 - Add test-complete observer notification. r=mconley
This allows generic code, like a testing JSM, to do clean up when a test completes, in a way that will work in different test suites. Differential Revision: https://phabricator.services.mozilla.com/D50648 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
b114ae02a3
commit
9cdc76e45f
@ -589,6 +589,8 @@ Tester.prototype = {
|
||||
}
|
||||
}
|
||||
|
||||
Services.obs.notifyObservers(null, "test-complete");
|
||||
|
||||
if (
|
||||
this.currentTest.passCount === 0 &&
|
||||
this.currentTest.failCount === 0 &&
|
||||
|
@ -1249,6 +1249,8 @@ SimpleTest.finish = function() {
|
||||
};
|
||||
|
||||
executeCleanupFunction();
|
||||
|
||||
SpecialPowers.notifyObservers(null, "test-complete");
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -647,6 +647,8 @@ function _execute_test() {
|
||||
.then(() => (complete = true));
|
||||
_Services.tm.spinEventLoopUntil(() => complete);
|
||||
|
||||
_Services.obs.notifyObservers(null, "test-complete");
|
||||
|
||||
// Restore idle service to avoid leaks.
|
||||
_fakeIdleService.deactivate();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user