зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1720676 - [marionette] Move component registration into components.conf. r=webdriver-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D121095
This commit is contained in:
Родитель
555b7c9143
Коммит
38d311bf45
|
@ -197,8 +197,6 @@
|
|||
|
||||
; WebDriver (Marionette, Remote Agent) remote protocols
|
||||
#ifdef ENABLE_WEBDRIVER
|
||||
@RESPATH@/components/marionette.manifest
|
||||
@RESPATH@/components/marionette.js
|
||||
@RESPATH@/chrome/remote@JAREXT@
|
||||
@RESPATH@/chrome/remote.manifest
|
||||
#endif
|
||||
|
|
|
@ -208,8 +208,6 @@
|
|||
|
||||
; WebDriver (Marionette, Remote Agent) remote protocols
|
||||
#ifdef ENABLE_WEBDRIVER
|
||||
@BINPATH@/components/marionette.manifest
|
||||
@BINPATH@/components/marionette.js
|
||||
@BINPATH@/chrome/remote@JAREXT@
|
||||
@BINPATH@/chrome/remote.manifest
|
||||
#endif
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var EXPORTED_SYMBOLS = ["Marionette", "MarionetteFactory"];
|
||||
|
||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
const { XPCOMUtils } = ChromeUtils.import(
|
||||
"resource://gre/modules/XPCOMUtils.jsm"
|
||||
);
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
ComponentUtils: "resource://gre/modules/ComponentUtils.jsm",
|
||||
|
||||
EnvironmentPrefs: "chrome://remote/content/marionette/prefs.js",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
MarionettePrefs: "chrome://remote/content/marionette/prefs.js",
|
||||
|
@ -69,6 +69,9 @@ class MarionetteParentProcess {
|
|||
constructor() {
|
||||
this.server = null;
|
||||
|
||||
this.classID = Components.ID("{786a1369-dca5-4adc-8486-33d23c88010a}");
|
||||
this.helpInfo = " --marionette Enable remote control server.\n";
|
||||
|
||||
// holds reference to ChromeWindow
|
||||
// used to run GFX sanity tests on Windows
|
||||
this.gfxWindow = null;
|
||||
|
@ -300,6 +303,10 @@ class MarionetteParentProcess {
|
|||
}
|
||||
|
||||
class MarionetteContentProcess {
|
||||
constructor() {
|
||||
this.classID = Components.ID("{786a1369-dca5-4adc-8486-33d23c88010a}");
|
||||
}
|
||||
|
||||
get running() {
|
||||
let reply = Services.cpmm.sendSyncMessage("Marionette:IsRunning");
|
||||
if (reply.length == 0) {
|
||||
|
@ -314,37 +321,14 @@ class MarionetteContentProcess {
|
|||
}
|
||||
}
|
||||
|
||||
const MarionetteFactory = {
|
||||
instance_: null,
|
||||
var Marionette;
|
||||
if (isRemote) {
|
||||
Marionette = new MarionetteContentProcess();
|
||||
} else {
|
||||
Marionette = new MarionetteParentProcess();
|
||||
}
|
||||
|
||||
createInstance(outer, iid) {
|
||||
if (outer) {
|
||||
throw Components.Exception("", Cr.NS_ERROR_NO_AGGREGATION);
|
||||
}
|
||||
|
||||
if (!this.instance_) {
|
||||
if (isRemote) {
|
||||
this.instance_ = new MarionetteContentProcess();
|
||||
} else {
|
||||
this.instance_ = new MarionetteParentProcess();
|
||||
}
|
||||
}
|
||||
|
||||
return this.instance_.QueryInterface(iid);
|
||||
},
|
||||
// This is used by the XPCOM codepath which expects a constructor
|
||||
const MarionetteFactory = function() {
|
||||
return Marionette;
|
||||
};
|
||||
|
||||
function Marionette() {}
|
||||
|
||||
Marionette.prototype = {
|
||||
classDescription: "Marionette component",
|
||||
classID: Components.ID("{786a1369-dca5-4adc-8486-33d23c88010a}"),
|
||||
contractID: "@mozilla.org/remote/marionette;1",
|
||||
|
||||
/* eslint-disable-next-line camelcase */
|
||||
_xpcom_factory: MarionetteFactory,
|
||||
|
||||
helpInfo: " --marionette Enable remote control server.\n",
|
||||
};
|
||||
|
||||
this.NSGetFactory = ComponentUtils.generateNSGetFactory([Marionette]);
|
|
@ -3,6 +3,7 @@
|
|||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
Classes = [
|
||||
# Remote Agent
|
||||
{
|
||||
"cid": "{8f685a9d-8181-46d6-a71d-869289099c6d}",
|
||||
"contract_ids": ["@mozilla.org/remote/agent;1"],
|
||||
|
@ -16,4 +17,16 @@ Classes = [
|
|||
"headers": ["RemoteAgentHandler.h"],
|
||||
"constructor": "GetRemoteAgentHandler",
|
||||
},
|
||||
|
||||
# Marionette
|
||||
{
|
||||
"cid": "{786a1369-dca5-4adc-8486-33d23c88010a}",
|
||||
"contract_ids": ["@mozilla.org/remote/marionette;1"],
|
||||
"categories": {
|
||||
"command-line-handler": "m-marionette",
|
||||
"profile-after-change": "Marionette",
|
||||
},
|
||||
"jsm": "chrome://remote/content/components/Marionette.jsm",
|
||||
"constructor": "MarionetteFactory",
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
component {786a1369-dca5-4adc-8486-33d23c88010a} marionette.js
|
||||
contract @mozilla.org/remote/marionette;1 {786a1369-dca5-4adc-8486-33d23c88010a}
|
||||
category command-line-handler b-marionette @mozilla.org/remote/marionette;1
|
||||
category profile-after-change Marionette @mozilla.org/remote/marionette;1
|
|
@ -6,11 +6,6 @@ DIRS += [
|
|||
"rust",
|
||||
]
|
||||
|
||||
EXTRA_COMPONENTS += [
|
||||
"marionette.js",
|
||||
"marionette.manifest",
|
||||
]
|
||||
|
||||
XPIDL_MODULE = "remote"
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
|
@ -20,7 +15,7 @@ XPIDL_SOURCES += [
|
|||
|
||||
XPCOM_MANIFESTS += ["components.conf"]
|
||||
|
||||
with Files("marionette.*"):
|
||||
with Files("Marionette.jsm"):
|
||||
BUG_COMPONENT = ("Testing", "Marionette")
|
||||
with Files("nsIMarionette.idl"):
|
||||
BUG_COMPONENT = ("Testing", "Marionette")
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
remote.jar:
|
||||
% content remote %content/
|
||||
content/components/Marionette.jsm (components/Marionette.jsm)
|
||||
content/components/RemoteAgent.jsm (components/RemoteAgent.jsm)
|
||||
|
||||
# transport layer (http / websocket)
|
||||
|
|
|
@ -168,7 +168,7 @@ The practical details of working on the Marionette code is outlined
|
|||
in [Contributing.md], but generally you do not have to re-build
|
||||
Firefox when changing code. Any change to remote/marionette/*.js
|
||||
will be picked up on restarting Firefox. The only notable exception
|
||||
is remote/components/marionette.js, which does require
|
||||
is remote/components/Marionette.jsm, which does require
|
||||
a re-build.
|
||||
|
||||
[XPCOM]: https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM
|
||||
|
|
Загрузка…
Ссылка в новой задаче