Commit Graph

77 Commits

Author SHA1 Message Date
Andreas Tolfsen
de8c9e85cf bug 1553317: remote: improve error message on missing method; r=remote-protocol-reviewers,ochameau CLOSED TREE
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
2019-05-27 11:39:16 +00:00
Brindusan Cristian
1f36d9b150 Backed out changeset f3d44dbce7e3 (bug 1553317) for bc failures at browser_parsable_css.js. CLOSED TREE 2019-05-27 17:51:56 +03:00
Andreas Tolfsen
26201b29a2 bug 1553317: remote: improve error message on missing method; r=remote-protocol-reviewers,ochameau
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
2019-05-27 11:39:16 +00:00
Julian Descottes
12d5dff1f5 Bug 1535102 - Extract shared helper to setup remote CDP mochitests r=ato
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
2019-05-27 08:04:11 +00:00
Julian Descottes
2456aa785c Bug 1535102 - Implement Page.bringToFront and introduce parent Page domain r=ato
Differential Revision: https://phabricator.services.mozilla.com/D32538

--HG--
extra : moz-landing-system : lando
2019-05-27 08:52:03 +00:00
Julian Descottes
a1552ab73e Bug 1554374 - ContentProcess domains should call super.destructor r=ato
This should avoid the test failures in debug.

Differential Revision: https://phabricator.services.mozilla.com/D32559

--HG--
extra : moz-landing-system : lando
2019-05-25 17:36:37 +00:00
Julian Descottes
0efd6acf34 Bug 1549786 - Add test for Page.navigate reloads the page with the same URL r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D32027

--HG--
extra : moz-landing-system : lando
2019-05-22 08:58:08 +00:00
Alexandre Poirot
23a00baa72 Bug 1549785 - Fix Remote object support for Node/Elements objects. r=remote-protocol-reviewers,ato
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
2019-05-14 20:05:32 +00:00
Alexandre Poirot
768c21fdb9 Bug 1549785 - Implement Runtime.releaseObject. r=remote-protocol-reviewers,ato
Differential Revision: https://phabricator.services.mozilla.com/D30231

--HG--
extra : moz-landing-system : lando
2019-05-14 21:59:50 +00:00
Alexandre Poirot
2797f9402a Bug 1548102 - Coordinate Page.frameNavigated and Runtime.executionContextDestroyed/Created events. r=remote-protocol-reviewers,ato
Differential Revision: https://phabricator.services.mozilla.com/D30237

--HG--
extra : moz-landing-system : lando
2019-05-14 15:18:51 +00:00
Alexandre Poirot
a26a2fc84b Bug 1549384 - Implement Page.getFrameTree. r=remote-protocol-reviewers,ato
Differential Revision: https://phabricator.services.mozilla.com/D30207

--HG--
extra : moz-landing-system : lando
2019-05-14 09:07:36 +00:00
Alexandre Poirot
d3544d3efb Bug 1548098 - Implement Runtime.callFunctionOn's objectId argument. r=remote-protocol-reviewers,ato
Differential Revision: https://phabricator.services.mozilla.com/D30267

--HG--
extra : moz-landing-system : lando
2019-05-13 16:11:49 +00:00
Alexandre Poirot
91d75827c5 Bug 1548098 - Implement Runtime.callFunctionOn's awaitPromise argument. r=remote-protocol-reviewers,ato
Differential Revision: https://phabricator.services.mozilla.com/D30266

--HG--
extra : moz-landing-system : lando
2019-05-13 16:10:30 +00:00
Alexandre Poirot
839bd8dbb2 Bug 1548098 - Implement Runtime.callFunctionOn's returnByValue argument. r=remote-protocol-reviewers,ato
Differential Revision: https://phabricator.services.mozilla.com/D30265

--HG--
extra : moz-landing-system : lando
2019-05-13 16:10:22 +00:00
Alexandre Poirot
ae4c521034 Bug 1548098 - Implement Runtime.callFunctionOn. r=remote-protocol-reviewers,ato
Differential Revision: https://phabricator.services.mozilla.com/D30264

--HG--
extra : moz-landing-system : lando
2019-05-13 16:10:20 +00:00
Alexandre Poirot
25a90f109b Bug 1544445 - Implement Page.reload. r=remote-protocol-reviewers,ato
Differential Revision: https://phabricator.services.mozilla.com/D30189

--HG--
extra : moz-landing-system : lando
2019-05-07 12:52:49 +00:00
Alexandre Poirot
6141376ca9 Bug 1537768 - Override add_task to translate cdp exception from head.js. r=remote-protocol-reviewers,ato
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
2019-05-02 12:00:39 +00:00
Alexandre Poirot
b45bb32493 Bug 1537768 - Simplify RemoteAgent initialization. r=remote-protocol-reviewers,ato
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
2019-05-02 12:00:37 +00:00
Alexandre Poirot
fcb2aa8735 Bug 1543099 - Implement Runtime.evaluate. r=remote-protocol-reviewers,ato
Differential Revision: https://phabricator.services.mozilla.com/D27525

--HG--
extra : moz-landing-system : lando
2019-05-02 11:55:55 +00:00
Alexandre Poirot
2731109ae0 Bug 1543099 - Split browser_runtime_executionContext into multiple functions r=remote-protocol-reviewers,ato
Differential Revision: https://phabricator.services.mozilla.com/D29385

--HG--
extra : moz-landing-system : lando
2019-05-02 10:11:40 +00:00
Alexandre Poirot
4acc49f558 Bug 1543098 - Emit executionContextDestroyed and executionContextCreated when the page goes into/out of the BF Cache. r=ato
Differential Revision: https://phabricator.services.mozilla.com/D28959

--HG--
extra : moz-landing-system : lando
2019-05-02 10:22:13 +00:00
Alexandre Poirot
2e7bacc0d1 Bug 1543098 - Emit executionContextCreated for existing context when calling Runtime.enable. r=ato
Differential Revision: https://phabricator.services.mozilla.com/D28958

--HG--
extra : moz-landing-system : lando
2019-05-02 10:22:04 +00:00
Alexandre Poirot
308a953c12 Bug 1543098 - Implement Runtime.executionContextCreated. r=ato
Differential Revision: https://phabricator.services.mozilla.com/D27523

--HG--
extra : moz-landing-system : lando
2019-05-02 10:21:56 +00:00
Ciure Andrei
b63cc4d20a Backed out 4 changesets (bug 1543098) for high frequency browser_runtime_executionContext.js failures CLOSED TREE
Backed out changeset a414e99fbbc8 (bug 1543098)
Backed out changeset f5645934c8ec (bug 1543098)
Backed out changeset 142fc2db9173 (bug 1543098)
Backed out changeset 0a13ac4fa9d7 (bug 1543098)
2019-05-01 14:53:50 +03:00
Alexandre Poirot
b17e090d38 Bug 1543098 - Emit executionContextDestroyed and executionContextCreated when the page goes into/out of the BF Cache. r=ato
Differential Revision: https://phabricator.services.mozilla.com/D28959

--HG--
extra : moz-landing-system : lando
2019-04-29 14:59:07 +00:00
Alexandre Poirot
d19d0f5a17 Bug 1543098 - Emit executionContextCreated for existing context when calling Runtime.enable. r=ato
Differential Revision: https://phabricator.services.mozilla.com/D28958

--HG--
extra : moz-landing-system : lando
2019-04-29 14:58:57 +00:00
Alexandre Poirot
f0c55a6dc9 Bug 1543098 - Implement Runtime.executionContextCreated. r=ato
Differential Revision: https://phabricator.services.mozilla.com/D27523

--HG--
extra : moz-landing-system : lando
2019-04-29 14:58:55 +00:00
Alexandre Poirot
ff0fe13c9f Bug 1543095 - Pass frameId to all Page events. r=ato
Differential Revision: https://phabricator.services.mozilla.com/D28957

--HG--
extra : moz-landing-system : lando
2019-04-29 13:42:55 +00:00
Alexandre Poirot
5a549b8d58 Bug 1543095 - Implement Page.frameNavigated. r=ato
Differential Revision: https://phabricator.services.mozilla.com/D27522

--HG--
extra : moz-landing-system : lando
2019-04-30 11:09:30 +00:00
Andreas Tolfsen
19ce910c3c bug 1547679: remote: disable browser-chrome tests on asan; r=remote-protocol-reviewers,ochameau
We should also disable browser-chrome tests on ASan, as some of
the leaks reported were caught by LeakSanitizer, which is run as
part of AddressSanitizer.

Follow-up from https://bugzilla.mozilla.org/show_bug.cgi?id=1547679#c3.

Differential Revision: https://phabricator.services.mozilla.com/D29327

--HG--
extra : moz-landing-system : lando
2019-04-30 10:00:35 +00:00
Andreas Tolfsen
a73b899266 bug 1547679: remote: disable all browser-chrome tests on debug; r=remote-protocol-reviewers,ochameau
Before landing the remote agent in Firefox Nightly, we had to disable
remote/test/browser/browser_cdp.js because it caused a permafailure
on debug due to a memory leak.  We thought the problem was limited
to this specific test, but over the weekend two more intermittent
leaks were discovered:

  * https://bugzilla.mozilla.org/show_bug.cgi?id=1546850
  * https://bugzilla.mozilla.org/show_bug.cgi?id=1547303

Until we have had time to investigate and plug the leak, we will
disable all the browser-chrome tests on all debug platforms.

Differential Revision: https://phabricator.services.mozilla.com/D29181

--HG--
extra : moz-landing-system : lando
2019-04-29 12:50:15 +00:00
Andreas Tolfsen
09e148f159 bug 1546945: remote: disable browser_cdp.js browser-chrome test on debug; r=ochameau
As detailed in https://bugzilla.mozilla.org/show_bug.cgi?id=1546945,
there is a memory leak in the remote agent that is triggered by
code paths in the remote/test/browser/browser_cdp.js browser-chrome test.

It is possible the memory leak is related to holding onto a reference
of the XPConnect C++ object nsSocketTransportService, but this has
yet to be confirmed.

This patch disables the test in question on debug builds, where
we run reference counting leakchecks, in order to get the remote
agent enabled in default Firefox Nightly builds.

Thanks-to: Alexandre Poirot <poirot.alex@gmail.com>

Differential Revision: https://phabricator.services.mozilla.com/D28872

--HG--
extra : moz-landing-system : lando
2019-04-25 18:27:05 +00:00
Andreas Tolfsen
3c8ae0e869 bug 1546722: remote: print better errors in browser chrome tests; r=yulia
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
2019-04-25 15:16:46 +00:00
Andreas Tolfsen
5107d02ac8 bug 1533831: remote: remove test_FatalError; r=ochameau
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
2019-04-24 17:28:14 +00:00
Andreas Tolfsen
942eecb096 bug 1533831: remote: run bc tests as part of regular batch; r=ochameau
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
2019-04-24 17:18:14 +00:00
Andreas Tolfsen
a3273a8312 bug 1533831: remote: disable remote agent; r=ochameau
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
2019-04-24 17:18:37 +00:00
Cosmin Sabou
6e8934bb87 Backed out 4 changesets (bug 1533831) for xpcshell failures on remote/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)
2019-04-24 19:55:51 +03:00
Andreas Tolfsen
28ce4058ed bug 1533831: remote: run bc tests as part of regular batch; r=ochameau
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
2019-04-24 15:18:28 +00:00
Andreas Tolfsen
e3303b3d92 bug 1533831: remote: disable remote agent; r=ochameau
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
2019-04-24 15:18:02 +00:00
Andreas Tolfsen
888b647600 bug 1546385: remote: listen for target to connect sooner; r=ochameau
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
2019-04-24 07:45:19 +00:00
Gurzau Raul
9b30abf7c9 Backed out 4 changesets (bug 1533831) for failing at /browser/browser_target.js on a CLOSED TREE.
Backed out changeset 94fd0790781a (bug 1533831)
Backed out changeset d32384388e3d (bug 1533831)
Backed out changeset bd363475667f (bug 1533831)
Backed out changeset b818d6ca606d (bug 1533831)
2019-04-18 05:35:54 +03:00
Andreas Tolfsen
77f0eda9ee bug 1533831: remote: run bc tests as part of regular batch; r=ochameau
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
2019-04-17 17:46:04 +00:00
Andreas Tolfsen
6d913ac017 bug 1533831: remote: disable remote agent; r=ochameau
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
2019-04-17 16:41:52 +00:00
Andreas Tolfsen
ab0b38e5c0 bug 1537775: remote: move method sanity check into Domains.splitMethod; r=ochameau
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
2019-04-04 09:39:28 +00:00
Alexandre Poirot
a9c172506d Bug 1539210 - Add support for Target.sendMessageToTarget and Target.receivedMessageFromTarget. r=ato
Differential Revision: https://phabricator.services.mozilla.com/D25577

--HG--
extra : moz-landing-system : lando
2019-04-04 11:29:27 +00:00
Alexandre Poirot
5cae2c807d Bug 1539221 - Register main process target on server start. r=ato
Depends on D25556

Differential Revision: https://phabricator.services.mozilla.com/D25557

--HG--
rename : remote/test/browser/browser_target.js => remote/test/browser/browser_main_target.js
extra : moz-landing-system : lando
2019-04-04 11:16:27 +00:00
Andreas Tolfsen
9936854ecf bug 1540684: remote: fix stray colons in error formatting; r=ochameau
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
2019-04-04 09:55:14 +00:00
Andreas Tolfsen
924a19a629 bug 1540684: remote: write tests for Error.jsm's current behaviour; r=ochameau
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
2019-04-04 09:57:29 +00:00
Alexandre Poirot
0b2e8e6e9d Bug 1539213 - Emit Target.targetCreated for already-opened tabs. r=ato
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
2019-04-01 14:25:28 +00:00
Mark Banner
dba6983e75 Bug 1415265 - Remove now unnecessary .eslintrc.js files or entries. r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D23850

--HG--
extra : moz-landing-system : lando
2019-03-28 09:38:14 +00:00