We can reconstruct the CDP error and print a better error message
using RemoteAgentError. This is better than the current output,
which in a lot of cases will be "CDP Exception: [object Object]".
A possible future improvement to this involves extending the CDP
protocol to send the individual components of the error individually,
so that we don't have to parse the string.
Differential Revision: https://phabricator.services.mozilla.com/D28703
--HG--
extra : moz-landing-system : lando
There are two concepts of targets in CDP: the target web document,
and the Target domain. The remote/targets/ subfolder is related
to the first, which should have bugs filed under Remote Protocol ::
Agent, covered by the preceding rule.
DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D28689
--HG--
extra : moz-landing-system : lando
Patch unfortunately has to add a few domain stubs so that mach does
not complain about not finding any files associated with these new
bug components.
Differential Revision: https://phabricator.services.mozilla.com/D28688
--HG--
extra : moz-landing-system : lando
The tests are instrumented to automatically set the remote.enabled
preference as part of their manifests. In the case of xpcshell,
it is also technically not need it as they do not trigger the
command-line-handler.js code path.
DONTBUILD
There are two concepts of targets in CDP: the target web document,
and the Target domain. The remote/targets/ subfolder is related
to the first, which should have bugs filed under Remote Protocol ::
Agent, covered by the preceding rule.
DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D28689
--HG--
extra : moz-landing-system : lando
FatalError uses Services.startup.quit and this is apparently fine
to run in an xpcshell test with an optimised build, but not with
debug builds where it causes MOZ_CRASH() to be hit.
This removes test_FatalError so that we can run test_Error.js on try.
Differential Revision: https://phabricator.services.mozilla.com/D28705
--HG--
extra : moz-landing-system : lando
The remote debugger mochitest browser-chrome tests do not have to
be run in a separate subsuite. Removing the subsuite condition
will make them appear as part of the normal M-bc* jobs on try.
Differential Revision: https://phabricator.services.mozilla.com/D27932
--HG--
extra : moz-landing-system : lando
The previous commit disabled the remote agent by flipping the
remote.enabled preference to false. That prevented the remote
agent from initialising or being included in the --help message.
This patch implies --enable-cdp in the default Firefox build on Firefox
Nightly. Firefox for Android is not supported. This will cause
builds to include the remote agent component that lives under remote/.
Since the remote agent is disabled by default, users will first
have to set the remote.enabled preference to true in order to use it.
If you wish to explicitly opt out of including the remote agent
when building Firefox, you may do so by using the --disable-cdp
build flag in your mozconfig:
ac_add_options --disable-cdp
Differential Revision: https://phabricator.services.mozilla.com/D27540
--HG--
extra : moz-landing-system : lando
This disables the remote agent through flipping the remote.enabled
preference to false. This will cause the help text to disappear from
--help and the RemoteAgent#init() (in remote/RemoteAgent.jsm) to fail.
We also change RemoteAgent.jsm to being loaded lazily so that it
isn't imported.
Differential Revision: https://phabricator.services.mozilla.com/D27539
--HG--
extra : moz-landing-system : lando
The browser.fission.simulate preference has been split
into two preferences: fission.frontend.simulate-events and
fission.frontend.simulate-messages.
The remote agent briefly used the child actor system from the
Firefox frontend code when we prototyped the initial remote agent,
but it no longer relies on it. This means we can drop the reference
to browser.fission.simulate altogether.
DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D27538
--HG--
extra : moz-landing-system : lando
The remote debugger mochitest browser-chrome tests do not have to
be run in a separate subsuite. Removing the subsuite condition
will make them appear as part of the normal M-bc* jobs on try.
Differential Revision: https://phabricator.services.mozilla.com/D27932
--HG--
extra : moz-landing-system : lando
The previous commit disabled the remote agent by flipping the
remote.enabled preference to false. That prevented the remote
agent from initialising or being included in the --help message.
This patch implies --enable-cdp in the default Firefox build on Firefox
Nightly. Firefox for Android is not supported. This will cause
builds to include the remote agent component that lives under remote/.
Since the remote agent is disabled by default, users will first
have to set the remote.enabled preference to true in order to use it.
If you wish to explicitly opt out of including the remote agent
when building Firefox, you may do so by using the --disable-cdp
build flag in your mozconfig:
ac_add_options --disable-cdp
Differential Revision: https://phabricator.services.mozilla.com/D27540
--HG--
extra : moz-landing-system : lando
This disables the remote agent through flipping the remote.enabled
preference to false. This will cause the help text to disappear from
--help and the RemoteAgent#init() (in remote/RemoteAgent.jsm) to fail.
We also change RemoteAgent.jsm to being loaded lazily so that it
isn't imported.
Differential Revision: https://phabricator.services.mozilla.com/D27539
--HG--
extra : moz-landing-system : lando
The browser.fission.simulate preference has been split
into two preferences: fission.frontend.simulate-events and
fission.frontend.simulate-messages.
The remote agent briefly used the child actor system from the
Firefox frontend code when we prototyped the initial remote agent,
but it no longer relies on it. This means we can drop the reference
to browser.fission.simulate altogether.
DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D27538
--HG--
extra : moz-landing-system : lando
TabManager.addTab(), and consequently gBrowser.addTab(), causes
tabs to open before Target#createTarget() gets time to install an
listener for a new target.
Since targets are created on the TabOpen event, we must install the
listener before we open the tab. This has the consequence that we
cannot reliably tell where the first target that connects comes from.
For this reason, this makes a functional change to return an error
if such an eventuality should arise.
This patch fixes the failing remote/test/browser/browser_target.js
browser-chrome test.
Differential Revision: https://phabricator.services.mozilla.com/D28492
--HG--
extra : moz-landing-system : lando
The remote debugger mochitest browser-chrome tests do not have to
be run in a separate subsuite. Removing the subsuite condition
will make them appear as part of the normal M-bc* jobs on try.
Differential Revision: https://phabricator.services.mozilla.com/D27932
--HG--
extra : moz-landing-system : lando
The previous commit disabled the remote agent by flipping the
remote.enabled preference to false. That prevented the remote
agent from initialising or being included in the --help message.
This patch implies --enable-cdp in the default Firefox build on Firefox
Nightly. Firefox for Android is not supported. This will cause
builds to include the remote agent component that lives under remote/.
Since the remote agent is disabled by default, users will first
have to set the remote.enabled preference to true in order to use it.
If you wish to explicitly opt out of including the remote agent
when building Firefox, you may do so by using the --disable-cdp
build flag in your mozconfig:
ac_add_options --disable-cdp
Differential Revision: https://phabricator.services.mozilla.com/D27540
--HG--
extra : moz-landing-system : lando
This disables the remote agent through flipping the remote.enabled
preference to false. This will cause the help text to disappear from
--help and the RemoteAgent#init() (in remote/RemoteAgent.jsm) to fail.
We also change RemoteAgent.jsm to being loaded lazily so that it
isn't imported.
Differential Revision: https://phabricator.services.mozilla.com/D27539
--HG--
extra : moz-landing-system : lando
The browser.fission.simulate preference has been split
into two preferences: fission.frontend.simulate-events and
fission.frontend.simulate-messages.
The remote agent briefly used the child actor system from the
Firefox frontend code when we prototyped the initial remote agent,
but it no longer relies on it. This means we can drop the reference
to browser.fission.simulate altogether.
DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D27538
--HG--
extra : moz-landing-system : lando
It is illegal for any code to depend on
Preferences.jsm before first paint. This enforced by
browser/base/content/test/performance/browser_startup.js, so we
must change remote/RemoteAgent.jsm to use an alternate mechanism
for getting at the preferences it needs.
Differential Revision: https://phabricator.services.mozilla.com/D27246
--HG--
extra : moz-landing-system : lando
These files became redundant after we started serving WebSocket
connections from the HTTPD.
This fixes the test
browser/base/content/test/static/browser_all_files_referenced.js,
which checks for unreferenced JSMs.
Differential Revision: https://phabricator.services.mozilla.com/D27247
--HG--
extra : moz-landing-system : lando
As we don't actually build anything inside remote/test, this
shouldn't make any functional difference at all.
Differential Revision: https://phabricator.services.mozilla.com/D26305
--HG--
extra : moz-landing-system : lando
The eslint max-len rule is not enforced in the top-level eslint
config, rendering this rule (and file) unnecessary.
Differential Revision: https://phabricator.services.mozilla.com/D26088
--HG--
extra : moz-landing-system : lando
This moves the assertions related to the well-formedness of the method
from the TabSession consumer to Domains.splitMethod. Following the
introduction of TabSession, this was missing from the superclass Session.
This also fixes the "Foo.bar.baz" test case in
remote/test/unit/test_Domains.js by removing the split() function
and instead relying on String#split() inside Domains.splitMethod.
Thanks-to: Alexandre Poirot <ochameau@mozilla.com>
Differential Revision: https://phabricator.services.mozilla.com/D25947
--HG--
extra : moz-landing-system : lando
The remote agent currently uses "method" interchangably for the
full method string as extracted from JSON input as well as for the
function part following the first dot after the method has been split.
To avoid namespace clashes, this patch makes a distinction between
method, being the input JSON field; the first substring prior to the
dot being the domain; and the rest that follows being called the command:
method = "<domain>.<command>"
This naming seems to be supported by chrome-remote-interface:
https://github.com/cyrus-and/chrome-remote-interface/blob/master/lib/api.js#L32
Differential Revision: https://phabricator.services.mozilla.com/D25946
--HG--
extra : moz-landing-system : lando
A session is bound to a browsing context, not just one document.
`unload` is fired when navigating to another document. The document goes
away, but not the browsing context. So, we should keep the session up and running
when the current document is destroyed and we navigate to another URL.
Depends on D25577
Differential Revision: https://phabricator.services.mozilla.com/D25578
--HG--
extra : moz-landing-system : lando
Error messages contained extraneous colons that were inconsistent
with how JavaScript errors are usually formatted.
Examples of ill-formed formatting:
FooError:
FooError: bar:
The trailing colons should not be present in either of these cases.
Colons should only be printed when something follows. For example:
FooError
FooError: bar
FooError: bar:
test.js:42
Differential Revision: https://phabricator.services.mozilla.com/D25608
--HG--
extra : moz-landing-system : lando
remote/Error.jsm is completely untested and that is suboptimal.
This commit adds tests for remote/Error.jsm's current behaviour.
Note that the subsequent commits make some changes to this behaviour,
but it's a conscious decision to have tests before making those
behavioural changes.
Differential Revision: https://phabricator.services.mozilla.com/D25607
--HG--
extra : moz-landing-system : lando
When remote/JSONHandler.jsm intercepts errors thrown during the
handling of an HTTP request, it is without except the underlying
cause of the problem you wish RemoteAgentError#notify() to give you.
Under no circumstances are you interested in where the error is re-thrown.
Differential Revision: https://phabricator.services.mozilla.com/D25617
--HG--
extra : moz-landing-system : lando
When `Target.setDiscoverTargets` is called, one `Target.targetCreated` event
should be sent per already opened tab.
Differential Revision: https://phabricator.services.mozilla.com/D25558
--HG--
extra : moz-landing-system : lando
This will later help register the component statically in bug 1536862.
And already ease using the remote agent from other JSM files.
Differential Revision: https://phabricator.services.mozilla.com/D24227
--HG--
rename : remote/RemoteAgent.js => remote/RemoteAgent.jsm
extra : moz-landing-system : lando