* TabObserver is rather an helper class of Targets rather than RemoteAgent.
Targets is the class which holds all the targets and reports about their
creation and destructor. It feels legitimate to have it directly integrate
with TabObserver.
* To better sort of the files. i.e. avoid having "random files" in /remote/
I'm renaming and moving TabObserver according to its usage.
* We were emitting "connect" and "disconnect" event when a target was created
or destroyed. But this is misleading as there is no connection to anything
being made. Only later, a CDP client might connect to a target HTTP endpoint
and initiate a connection. These events are making this hard to understand
that the connection actually happens when Target.handle is called.
Differential Revision: https://phabricator.services.mozilla.com/D37043
--HG--
rename : remote/WindowManager.jsm => remote/targets/TabObserver.jsm
extra : moz-landing-system : lando
My preference was to annotate most of the failing tests with `fail-if` so that
if they start passing, the `fail-if` needs to be removed and they need to keep
passing. That doesn't work for tests that timeout, or which trigger failures
from their cleanup functions, however, so those tests need skip-if. And tests
with fail in their cleanup functions likely leave the browser in an
inconsistent state for subsequent tests, anyway, so really should be skipped
regardless.
There are some remaining tests which still fail because of crashes. I chose
not to skip them here, but to fix the crashes in separate bugs instead.
Differential Revision: https://phabricator.services.mozilla.com/D38247
--HG--
extra : rebase_source : 39ba8fec2e882cfe577c5f2b58ab7e4b461f1178
This helps sharing a single implementation of how the JSON objects
are read and written from/to the WebSocket connection.
Also, by delegating the command calls to the Session via `Session.execute`
and expecting a promise with a resolution or rejection, we make error
handling of command calls clearer and unified.
Differential Revision: https://phabricator.services.mozilla.com/D37046
--HG--
extra : moz-landing-system : lando
The test was relying on selectionchange events fired on an input text element.
This event is behind a pref, flip the pref to true during the test in order to make it
pass on all channels
Differential Revision: https://phabricator.services.mozilla.com/D36330
--HG--
extra : moz-landing-system : lando
We return with this rather omnious message when we are missing the
implementation of a CDP method:
Error: Protocol error (Target.createBrowserContext): TypeError: inst[command] is not a function:
This patch improves the error message so that debugging is not
necessary to find out which domain or command is missing.
Ideally Session.jsm and ContentProcessSession.jsm would share the
same execute() function (there's really not reason they don't),
but that involves more work.
Differential Revision: https://phabricator.services.mozilla.com/D32069
--HG--
extra : source : f3d44dbce7e3d1b529ce37b21a4d7471a918edd4
extra : histedit_source : df4d534565efb3e2babbc277a3aecce5d534ac39
We return with this rather omnious message when we are missing the
implementation of a CDP method:
Error: Protocol error (Target.createBrowserContext): TypeError: inst[command] is not a function:
This patch improves the error message so that debugging is not
necessary to find out which domain or command is missing.
Ideally Session.jsm and ContentProcessSession.jsm would share the
same execute() function (there's really not reason they don't),
but that involves more work.
Differential Revision: https://phabricator.services.mozilla.com/D32069
--HG--
extra : moz-landing-system : lando
Depends on D32538.
Not mandatory, but we have some duplicated code shared by several mochitests, maybe we could have a shared helper?
Differential Revision: https://phabricator.services.mozilla.com/D32539
--HG--
extra : moz-landing-system : lando
Debugger.Object's class isn't "Object" for DOM Elements.
Instead, it is specific to each element tag name.
Differential Revision: https://phabricator.services.mozilla.com/D31084
--HG--
extra : moz-landing-system : lando
This allows improving all tests exceptions without requiring
any specific to be done in each tests.
I'm also moving a few imports to head.js to share the most into head.js.
Differential Revision: https://phabricator.services.mozilla.com/D29414
--HG--
extra : moz-landing-system : lando
Start the `TabObserver` from `RemoteAgent.listen` in order to prevent
having the tests to manually start it.
Start it from `listen` instead of `init` as we do stop the `TabObserver` from
`stop` and `stop` is the reverse of `listen`, not the reverse of `init`.
Differential Revision: https://phabricator.services.mozilla.com/D29412
--HG--
extra : moz-landing-system : lando