Bug 1422915 - Send remote-active after socket has ceased listening. r?whimboo draft
authorAndreas Tolfsen <ato@sny.no>
Mon, 04 Dec 2017 18:54:12 +0000
changeset 707018 e3f95bcc4152c72ba864e14646317c899df38d50
parent 706949 195bb467e6cb5c8c5f5fb2858c0a55b2d0b9552d
child 707019 dca81b9b157d2f5702d87155110c5dff5f3a0ad0
push id92005
push userbmo:ato@sny.no
push dateMon, 04 Dec 2017 18:56:58 +0000
reviewerswhimboo
bugs1422915
milestone59.0a1
Bug 1422915 - Send remote-active after socket has ceased listening. r?whimboo The remote-active system notification is currently sent before the TCP socket has stopped listening. It is marginally safer to send it as the last action. MozReview-Commit-ID: KhB6TMvyCPv
testing/marionette/server.js
--- a/testing/marionette/server.js
+++ b/testing/marionette/server.js
@@ -380,21 +380,20 @@ server.TCPListener = class {
     }
 
     for (let k of this.alteredPrefs) {
       logger.debug(`Resetting recommended pref ${k}`);
       Preferences.reset(k);
     }
     this.alteredPrefs.clear();
 
-    Services.obs.notifyObservers(this, NOTIFY_RUNNING);
-
     // Shutdown server socket, and no longer listen for new connections
     this.acceptConnections = false;
 
+    Services.obs.notifyObservers(this, NOTIFY_RUNNING);
     this.alive = false;
   }
 
   onSocketAccepted(serverSocket, clientSocket) {
     let input = clientSocket.openInputStream(0, 0, 0);
     let output = clientSocket.openOutputStream(0, 0, 0);
     let transport = new DebuggerTransport(input, output);