Make it easier to start the remote agent from tests
Categories
(Remote Protocol :: Agent, enhancement, P1)
Tracking
(Not tracked)
People
(Reporter: ochameau, Assigned: ochameau)
References
Details
Attachments
(2 files, 1 obsolete file)
For now, tests have to do the following in order to start a remote server:
https://searchfox.org/mozilla-central/rev/7c20ad925005fbad7b8e08813115f1ec7fa1c248/remote/test/browser/browser_cdp.js#30-33
// Start the CDP server
const RemoteAgent = Cc["@mozilla.org/remote/agent"].getService(Ci.nsISupports).wrappedJSObject;
RemoteAgent.tabs.start();
RemoteAgent.listen(Services.io.newURI("http://localhost:9222"));
The first line, to retrieve the RemoteAgent singleton is going to be simplified in bug 1536888. But there will still be the second line, where the tests have to know that internally, the remote agent has to start its TabsObserver.
It would be helpful if that step can be done as part of listen
or something.
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 1•6 years ago
|
||
Assignee | ||
Comment 2•6 years ago
|
||
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
.
Assignee | ||
Comment 3•6 years ago
|
||
Automatically initialize the agent from listen
in order to only
have to call this one method in order to start it.
Assignee | ||
Comment 4•6 years ago
|
||
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.
Updated•6 years ago
|
Updated•6 years ago
|
Comment 6•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/216940ec115d
https://hg.mozilla.org/mozilla-central/rev/6586c6e89759
Description
•