Closed Bug 1422915 Opened 7 years ago Closed 7 years ago

System notification remote-active should send false explicitly

Categories

(Remote Protocol :: Marionette, enhancement)

Version 3
enhancement
Not set
normal

Tracking

(firefox59 fixed)

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: ato, Assigned: ato)

References

Details

Attachments

(2 files)

When Marionette starts and shuts down it emits the remote-active
system notification.  On starting the data is set to true (a boolean),
but on shutdown it is left undefined which according to [1] defaults
to null.

We should use false (boolean) explicitly.

  [1] https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIObserverService#notifyObservers()
Assignee: nobody → ato
Status: NEW → ASSIGNED
Comment on attachment 8934256 [details]
Bug 1422915 - Send remote-active after socket has ceased listening.

https://reviewboard.mozilla.org/r/205172/#review211180

::: testing/marionette/server.js:391
(Diff revision 1)
> -    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);

Maybe it would be better to move it closer to the code which enables/disables the TCP server. So why can't we have it in `acceptConnections` directly?
Comment on attachment 8934256 [details]
Bug 1422915 - Send remote-active after socket has ceased listening.

https://reviewboard.mozilla.org/r/205172/#review211180

> Maybe it would be better to move it closer to the code which enables/disables the TCP server. So why can't we have it in `acceptConnections` directly?

We want to fire this at the outer bounds of when Marionette is
initialised and torn down.  The Marionette component’s lifetime
ends when this stop() function is called – it is the only place we
can be absolutely sure everything has come to a halt.
Comment on attachment 8934256 [details]
Bug 1422915 - Send remote-active after socket has ceased listening.

https://reviewboard.mozilla.org/r/205172/#review211180

> We want to fire this at the outer bounds of when Marionette is
> initialised and torn down.  The Marionette component’s lifetime
> ends when this stop() function is called – it is the only place we
> can be absolutely sure everything has come to a halt.

Ok, that makes sense.
Comment on attachment 8934256 [details]
Bug 1422915 - Send remote-active after socket has ceased listening.

https://reviewboard.mozilla.org/r/205172/#review211406
Attachment #8934256 - Flags: review?(hskupin) → review+
Comment on attachment 8934257 [details]
Bug 1422915 - Be explicit about remote-active data when shutting down.

https://reviewboard.mozilla.org/r/205174/#review211408
Attachment #8934257 - Flags: review?(hskupin) → review+
Pushed by atolfsen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a30ad544bf0f
Send remote-active after socket has ceased listening. r=whimboo
https://hg.mozilla.org/integration/autoland/rev/d61481e31a93
Be explicit about remote-active data when shutting down. r=whimboo
OK, fine I’ll drop this if eslint complains.  Will still land the first commit.
Flags: needinfo?(ato)
Pushed by atolfsen@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/7d3eb0f3887b
Send remote-active after socket has ceased listening. r=whimboo
https://hg.mozilla.org/mozilla-central/rev/7d3eb0f3887b
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: