Bug 1355890 - Add Marionette XPCOM interface draft
authorAndreas Tolfsen <ato@mozilla.com>
Fri, 12 May 2017 18:13:25 +0100
changeset 578797 549cc74d1ffd25ab1e9fb784ab75ee5ee08bd7c4
parent 578796 0adb3ae3f57f54f2c56e2079a2686e9936a3499e
child 578798 eb789fe2ea997047936745c3bf4a5e3031ff6e91
push id59067
push userbmo:ato@mozilla.com
push dateTue, 16 May 2017 16:07:44 +0000
bugs1355890
milestone55.0a1
Bug 1355890 - Add Marionette XPCOM interface This adds a minimal XPCOM interface to access Marionette as a service. All it does for now is to expose whether the Marionette server is running, which will report true when the TCP listener socket is open and false otherwise. This will be used in browser/base/content/browser.js to determine whether or not to add a visual UX cue on newly started <xul:browser>s. MozReview-Commit-ID: 4Q9Oy2B9GQ1
browser/installer/package-manifest.in
testing/marionette/components/marionette.js
testing/marionette/components/moz.build
testing/marionette/components/nsIMarionette.idl
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -304,16 +304,19 @@
 @RESPATH@/components/saxparser.xpt
 @RESPATH@/browser/components/sessionstore.xpt
 @RESPATH@/components/services-crypto-component.xpt
 @RESPATH@/components/captivedetect.xpt
 @RESPATH@/browser/components/shellservice.xpt
 @RESPATH@/components/shistory.xpt
 @RESPATH@/components/spellchecker.xpt
 @RESPATH@/components/storage.xpt
+#ifdef ENABLE_MARIONETTE
+@RESPATH@/components/remote.xpt
+#endif
 @RESPATH@/components/toolkit_asyncshutdown.xpt
 @RESPATH@/components/toolkit_filewatcher.xpt
 @RESPATH@/components/toolkit_finalizationwitness.xpt
 @RESPATH@/components/toolkit_osfile.xpt
 @RESPATH@/components/toolkit_securityreporter.xpt
 @RESPATH@/components/toolkit_perfmonitoring.xpt
 @RESPATH@/components/toolkit_xulstore.xpt
 @RESPATH@/components/toolkitprofile.xpt
--- a/testing/marionette/components/marionette.js
+++ b/testing/marionette/components/marionette.js
@@ -132,16 +132,17 @@ function MarionetteComponent() {
 }
 
 MarionetteComponent.prototype = {
   classDescription: "Marionette component",
   classID: MARIONETTE_CID,
   contractID: MARIONETTE_CONTRACT_ID,
   QueryInterface: XPCOMUtils.generateQI([
     Ci.nsICommandLineHandler,
+    Ci.nsIMarionette,
   ]),
   _xpcom_categories: [
     {category: "command-line-handler", entry: "b-marionette"},
     {category: "profile-after-change", service: true},
   ],
   helpInfo: "  --marionette       Enable remote control server.\n",
 };
 
--- a/testing/marionette/components/moz.build
+++ b/testing/marionette/components/moz.build
@@ -1,8 +1,11 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 EXTRA_COMPONENTS += [
     "marionette.js",
     "marionette.manifest",
 ]
+
+XPIDL_MODULE = "remote"
+XPIDL_SOURCES += ["nsIMarionette.idl"]
new file mode 100644
--- /dev/null
+++ b/testing/marionette/components/nsIMarionette.idl
@@ -0,0 +1,13 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "nsISupports.idl"
+
+/** Interface for accessing the Marionette server instance. */
+[scriptable, uuid(13fa7d76-f976-4711-a00c-29ac9c1881e1)]
+interface nsIMarionette : nsISupports
+{
+  /** Indicates whether the remote protocol is enabled. */
+  readonly attribute boolean running;
+};