зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1629951 - Ensure we terminate worker if prefs are changed causing worker to be impacted. r=gvn
Differential Revision: https://phabricator.services.mozilla.com/D70928
This commit is contained in:
Родитель
4b4e5fcf9d
Коммит
fd839b1dfd
|
@ -110,6 +110,9 @@ this.PersonalityProvider = class PersonalityProvider {
|
|||
teardown() {
|
||||
this.teardownSyncAttachment(RECIPE_NAME);
|
||||
this.teardownSyncAttachment(MODELS_NAME);
|
||||
if (this._personalityProviderWorker) {
|
||||
this._personalityProviderWorker.terminate();
|
||||
}
|
||||
}
|
||||
|
||||
setupSyncAttachment(collection) {
|
||||
|
|
|
@ -130,6 +130,14 @@ describe("Personality Provider", () => {
|
|||
instance.teardown();
|
||||
assert.calledTwice(instance.teardownSyncAttachment);
|
||||
});
|
||||
it("should terminate worker", () => {
|
||||
const terminateStub = sandbox.stub().returns();
|
||||
instance._personalityProviderWorker = {
|
||||
terminate: terminateStub,
|
||||
};
|
||||
instance.teardown();
|
||||
assert.calledOnce(terminateStub);
|
||||
});
|
||||
});
|
||||
describe("#setupSyncAttachment", () => {
|
||||
it("should call remote settings on twice for setupSyncAttachment", () => {
|
||||
|
|
Загрузка…
Ссылка в новой задаче