From 1d2ab66b43b27bdb8c12e1c79d695af3e7b75bd5 Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Mon, 26 Feb 2018 20:36:29 +0000 Subject: [PATCH] Bug 1428795 - Uninitalise Marionette on xpcom-will-shutdown. r=automatedtester Marionette was previously uninitialised when xpcom-shutdown fired. This may be too late to reset preferences and other state related to the browser. This patch moves Marionette to run uninitialisation code on xpcom-will-shutdown. MozReview-Commit-ID: 3ytX2k2rrOp --HG-- extra : rebase_source : 6b9918515b48b2d1166cc985c5d5aeeb82937db0 --- testing/marionette/components/marionette.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testing/marionette/components/marionette.js b/testing/marionette/components/marionette.js index f5a6d3dd95f9..846cebdfc31d 100644 --- a/testing/marionette/components/marionette.js +++ b/testing/marionette/components/marionette.js @@ -462,7 +462,7 @@ class MarionetteMainProcess { if (this.gfxWindow === null || subject === this.gfxWindow) { Services.obs.removeObserver(this, topic); - Services.obs.addObserver(this, "xpcom-shutdown"); + Services.obs.addObserver(this, "xpcom-will-shutdown"); this.finalUIStartup = true; this.init(); } @@ -491,15 +491,15 @@ class MarionetteMainProcess { if (this.gfxWindow) { Services.obs.addObserver(this, "domwindowclosed"); } else { - Services.obs.addObserver(this, "xpcom-shutdown"); + Services.obs.addObserver(this, "xpcom-will-shutdown"); this.finalUIStartup = true; this.init(); } break; - case "xpcom-shutdown": - Services.obs.removeObserver(this, "xpcom-shutdown"); + case "xpcom-will-shutdown": + Services.obs.removeObserver(this, "xpcom-will-shutdown"); this.uninit(); break; }