Skip to content

Commit

Permalink
Backed out 4 changesets (bug 1533831) for xpcshell failures on remote…
Browse files Browse the repository at this point in the history
…/test/unit/test_Error.js. CLOSED TREE

Backed out changeset a3014b38cc5f (bug 1533831)
Backed out changeset 57a319eeed2d (bug 1533831)
Backed out changeset afcfdae88bf7 (bug 1533831)
Backed out changeset c03450df8660 (bug 1533831)
  • Loading branch information
CosminSabou committed Apr 24, 2019
1 parent ea6fe15 commit 6e8934b
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 62 deletions.
11 changes: 8 additions & 3 deletions remote/README
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ layer.

See https://firefox-source-docs.mozilla.org/remote/ for documentation.

The remote agent is disabled by default, but can be enabled by
setting a preference before running it:
The remote agent is not by default included in Firefox builds. To
build it, put this in your mozconfig:

% ./mach run --setpref "remote.enabled=true" --remote-debugger
ac_add_options --enable-cdp

This exposes a --remote-debugger flag you can use to start the
remote agent:

% ./mach run --setpref "browser.fission.simulate=true" -- --remote-debugger
9 changes: 1 addition & 8 deletions remote/command-line-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,14 @@

// Stopgap module until we can land bug 1536862 and remove this temporary file

const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
const {RemoteAgent} = ChromeUtils.import("chrome://remote/content/RemoteAgent.jsm");
const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");

ChromeUtils.defineModuleGetter(this, "RemoteAgent",
"chrome://remote/content/RemoteAgent.jsm");

const RemoteAgentFactory = {
createInstance(outer, iid) {
if (outer) {
throw Cr.NS_ERROR_NO_AGGREGATION;
}
// we can't use Preferences.jsm before first paint
if (!Services.prefs.getBoolPref("remote.enabled")) {
return {};
}

return RemoteAgent.QueryInterface(iid);
},
Expand Down
46 changes: 11 additions & 35 deletions remote/doc/Building.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,25 @@
Building
========

The remote agent is included in the default Firefox build, but
disabled by default. To expose the remote agent you can set the
`remote.enabled` preference to true before running it:
The remote agent is by default not included in Firefox builds.
To build it, put this in your [mozconfig]:

% ./mach run --setpref="remote.enabled=true" --remote-debugger
ac_add_options --enable-cdp

The source code is found under `$(topsrcdir)/remote`.
This exposes a `--remote-debugger` flag you can use to start the
remote agent:

Full build mode
---------------
% ./mach run --setpref "browser.fission.simulate=true" -- --remote-debugger

The remote agent supports only Firefox, and is included when you
build in the usual way:

% ./mach build

When you make changes to XPCOM component files you need to rebuild
When you make changes to the XPCOM component you need to rebuild
in order for the changes to take effect. The most efficient way to
do this, provided you haven’t touched any compiled code (C++ or Rust):

% ./mach build faster

Component files include the likes of command-line-handler.js,
RemoteAgent.manifest, moz.build files, prefs/remote.js, and jar.mn.
All the JS modules (files ending with `.jsm`) are symlinked into
the build and can be changed without rebuilding.

You may also opt out of building the remote agent entirely by setting
the `--disable-cdp` build flag in your [mozconfig]:

ac_add_options --disable-cdp


Artifact mode
-------------

You may also use [artifact builds] when working on the remote agent.
This fast build mode downloads pre-built components from the Mozilla
build servers, rendering local compilation unnecessary. To use
them, place this in your [mozconfig]:

ac_add_options --enable-artifact-builds

Component files include the likes of RemoteAgent.js, RemoteAgent.manifest,
moz.build files, prefs/remote.js, and jar.mn. All the JS modules
(files ending with `.jsm`) are symlinked into the build and can be
changed without rebuilding.

[mozconfig]: ../build/buildsystem/mozconfigs.html
[artifact builds]: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Artifact_builds
2 changes: 1 addition & 1 deletion remote/doc/Debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ To increase the internal logging verbosity you can use the

If you use mach to start the Firefox:

./mach run --setpref "remote.enabled=true" --setpref "remote.log.level=Debug" --remote-debugger
./mach run --setpref "browser.fission.simulate=true" --setpref "remote.log.level=Debug" -- --remote-debugger

[preference]: ./Prefs.md
4 changes: 1 addition & 3 deletions remote/doc/Prefs.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ Configurable preferences
### `remote.enabled`

Indicates whether the remote agent is enabled. When the remote
agent is enabled, it exposes a [`--remote-debugger` flag] for Firefox.
agent is enabled, it exposes a `--remote-debugger` flag for Firefox.
When set to false, the remote agent will not be loaded on startup.

[`--remote-debugger` flag]: Usage.html

### `remote.force-local`

Limits the remote agent to be allowed to listen on loopback devices,
Expand Down
6 changes: 3 additions & 3 deletions remote/doc/Testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The remote agent has unit- and functional tests located under

You may run all the tests locally using `mach test` like this:

% ./mach test --setpref "remote.enabled=true" remote/test
% ./mach test remote/test

The tests are currently not run on try.

Expand All @@ -17,7 +17,7 @@ Unit tests
Because tests are run in parallel and [xpcshell] itself is quite
chatty, it can sometimes be useful to run the tests in sequence:

% ./mach xcpshell-test --setpref "remote.enabled=true" --sequential remote/test/unit/test_Assert.js
% ./mach xcpshell --sequential remote/test/unit/test_Assert.js

The unit tests will appear as part of the `X` jobs on Treeherder.

Expand All @@ -30,6 +30,6 @@ Functional tests
We also have a set of functional [browser chrome] tests located
under _remote/test/browser_:

% ./mach mochitest --setpref "remote.enabled=true" -f browser remote/test/browser/browser_cdp.js
% ./mach mochitest -f browser remote/test/browser/browser_cdp.js

[browser chrome]: https://developer.mozilla.org/en-US/docs/Mozilla/Browser_chrome_tests
2 changes: 1 addition & 1 deletion remote/pref/remote.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Indicates whether the remote agent is enabled.
// If it is false, the remote agent will not be loaded.
pref("remote.enabled", false);
pref("remote.enabled", true);

// Limits remote agent to listen on loopback devices,
// e.g. 127.0.0.1, localhost, and ::1.
Expand Down
2 changes: 1 addition & 1 deletion remote/test/browser/browser.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[DEFAULT]
tags = remote
prefs = remote.enabled=true
subsuite = remote
support-files =
chrome-remote-interface.js
head.js
Expand Down
9 changes: 2 additions & 7 deletions toolkit/moz.configure
Original file line number Diff line number Diff line change
Expand Up @@ -919,14 +919,9 @@ add_old_configure_assignment('FT2_CFLAGS',
# See https://firefox-source-docs.mozilla.org/remote/ for more.
# The source code lives under ../remote.

@depends(target, milestone)
def remote_default(target, milestone):
return target.os != 'Android' and milestone.is_nightly
option('--enable-cdp', help='{Enable|Disable} remote agent')

option('--disable-cdp', default=remote_default,
help='{Enable|Disable} remote agent')

@depends('--disable-cdp')
@depends('--enable-cdp')
def remote(value):
if value:
return True
Expand Down

0 comments on commit 6e8934b

Please sign in to comment.