diff --git a/.eslintignore b/.eslintignore index 12ed20999a0c..3d076b89b3fe 100644 --- a/.eslintignore +++ b/.eslintignore @@ -155,7 +155,6 @@ python/ # These are (mainly) imported code that we don't want to lint to make imports easier. remote/cdp/Protocol.jsm remote/cdp/test/browser/chrome-remote-interface.js -remote/marionette/atom.js # services/ exclusions @@ -171,6 +170,7 @@ servo/ # Test files that we don't want to lint (preprocessed, minified etc) testing/condprofile/condprof/tests/profile +testing/marionette/atom.js testing/mozbase/mozprofile/tests/files/prefs_with_comments.js testing/talos/talos/scripts/jszip.min.js testing/talos/talos/startup_test/sessionrestore/profile/sessionstore.js diff --git a/docs/conf.py b/docs/conf.py index 97ec6f532283..d5783571d82d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -55,7 +55,7 @@ extensions = [ js_source_path = [ "../browser/components/extensions", "../browser/components/uitour", - "../remote/marionette", + "../testing/marionette", "../toolkit/components/extensions", "../toolkit/components/extensions/parent", "../toolkit/components/featuregates", diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 1438ff7b867c..8e9f21e03c42 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -4475,16 +4475,6 @@ pref("services.common.log.logger.tokenserverclient", "Debug"); // Sets recommended automation preferences when Marionette is started. pref("marionette.prefs.recommended", true); - // Defines the protocols that will be active for the Remote Agent. - // 1: WebDriver BiDi - // 2: CDP (Chrome DevTools Protocol) - // 3: WebDriver BiDi + CDP - #if defined(NIGHTLY_BUILD) - pref("remote.active-protocols", 3); - #else - pref("remote.active-protocols", 2); - #endif - // Limits remote agent to listen on loopback devices, // e.g. 127.0.0.1, localhost, and ::1. pref("remote.force-local", true); diff --git a/remote/components/RemoteAgent.jsm b/remote/components/RemoteAgent.jsm index 33b5e08dcb3c..fd43324c3534 100644 --- a/remote/components/RemoteAgent.jsm +++ b/remote/components/RemoteAgent.jsm @@ -23,31 +23,13 @@ XPCOMUtils.defineLazyModuleGetters(this, { XPCOMUtils.defineLazyGetter(this, "logger", () => Log.get()); -const PREF_ACTIVE_PROTOCOLS = ["remote.active-protocols"]; -const PREF_FORCE_LOCAL = "remote.force-local"; - -const BIDI_ACTIVE = 0x1; -const CDP_ACTIVE = 0x2; +const FORCE_LOCAL = "remote.force-local"; const LOOPBACKS = ["localhost", "127.0.0.1", "[::1]"]; class RemoteAgentClass { constructor() { this.alteredPrefs = new Set(); - - const protocols = Services.prefs.getIntPref(PREF_ACTIVE_PROTOCOLS); - if (protocols < 1 || protocols > 3) { - throw Error(`Invalid remote protocol identifier: ${protocols}`); - } - this._activeProtocols = protocols; - } - - get isBiDiEnabled() { - return (this._activeProtocols & BIDI_ACTIVE) == BIDI_ACTIVE; - } - - get isCDPEnabled() { - return (this._activeProtocols & CDP_ACTIVE) == CDP_ACTIVE; } get listening() { @@ -79,7 +61,7 @@ class RemoteAgentClass { } let { host, port } = url; - if (Preferences.get(PREF_FORCE_LOCAL) && !LOOPBACKS.includes(host)) { + if (Preferences.get(FORCE_LOCAL) && !LOOPBACKS.includes(host)) { throw Components.Exception( "Restricted to loopback devices", Cr.NS_ERROR_ILLEGAL_VALUE @@ -100,39 +82,33 @@ class RemoteAgentClass { } this.server = new HttpServer(); + this.server.registerPrefixHandler("/json/", new JSONHandler(this)); - if (this.isCDPEnabled) { - this.server.registerPrefixHandler("/json/", new JSONHandler(this)); - - this.targetList = new TargetList(); - this.targetList.on("target-created", (eventName, target) => { - this.server.registerPathHandler(target.path, target); - }); - this.targetList.on("target-destroyed", (eventName, target) => { - this.server.registerPathHandler(target.path, null); - }); - } + this.targetList = new TargetList(); + this.targetList.on("target-created", (eventName, target) => { + this.server.registerPathHandler(target.path, target); + }); + this.targetList.on("target-destroyed", (eventName, target) => { + this.server.registerPathHandler(target.path, null); + }); return this.asyncListen(host, port); } async asyncListen(host, port) { try { + await this.targetList.watchForTargets(); + + // Immediatly instantiate the main process target in order + // to be accessible via HTTP endpoint on startup + const mainTarget = this.targetList.getMainProcessTarget(); + this.server._start(port, host); - - if (this.isCDPEnabled) { - await this.targetList.watchForTargets(); - - // Immediatly instantiate the main process target in order - // to be accessible via HTTP endpoint on startup - const mainTarget = this.targetList.getMainProcessTarget(); - - Services.obs.notifyObservers( - null, - "remote-listening", - `DevTools listening on ${mainTarget.wsDebuggerURL}` - ); - } + Services.obs.notifyObservers( + null, + "remote-listening", + `DevTools listening on ${mainTarget.wsDebuggerURL}` + ); } catch (e) { await this.close(); logger.error(`Unable to start remote agent: ${e.message}`, e); @@ -147,12 +123,10 @@ class RemoteAgentClass { } this.alteredPrefs.clear(); - if (this.isCDPEnabled) { - // destroy targetList before stopping server, - // otherwise the HTTP will fail to stop - if (this.targetList) { - this.targetList.destructor(); - } + // destroy targetList before stopping server, + // otherwise the HTTP will fail to stop + if (this.targetList) { + this.targetList.destructor(); } if (this.listening) { diff --git a/remote/components/moz.build b/remote/components/moz.build index e09e5ade4371..c278b0398a46 100644 --- a/remote/components/moz.build +++ b/remote/components/moz.build @@ -6,21 +6,7 @@ DIRS += [ "rust", ] -EXTRA_COMPONENTS += [ - "marionette.js", - "marionette.manifest", -] - XPIDL_MODULE = "remote" - -XPIDL_SOURCES += [ - "nsIMarionette.idl", - "nsIRemoteAgent.idl", -] +XPIDL_SOURCES += ["nsIRemoteAgent.idl"] XPCOM_MANIFESTS += ["components.conf"] - -with Files("marionette.*"): - BUG_COMPONENT = ("Testing", "Marionette") -with Files("nsIMarionette.idl"): - BUG_COMPONENT = ("Testing", "Marionette") diff --git a/remote/marionette/moz.build b/remote/marionette/moz.build deleted file mode 100644 index 1fad2197de72..000000000000 --- a/remote/marionette/moz.build +++ /dev/null @@ -1,15 +0,0 @@ -# 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/. - -JAR_MANIFESTS += ["jar.mn"] - -XPCSHELL_TESTS_MANIFESTS += ["test/xpcshell/xpcshell.ini"] - -with Files("**"): - BUG_COMPONENT = ("Testing", "Marionette") - -SPHINX_TREES["/testing/marionette"] = "doc" - -with Files("doc/**"): - SCHEDULES.exclusive = ["docs"] diff --git a/remote/moz.build b/remote/moz.build index c971370bb6fc..0c661790253e 100644 --- a/remote/moz.build +++ b/remote/moz.build @@ -5,7 +5,6 @@ DIRS += [ "cdp", "components", - "marionette", "shared", ] diff --git a/testing/geckodriver/doc/Profiles.md b/testing/geckodriver/doc/Profiles.md index 27840780d467..c7ff656ac8fa 100644 --- a/testing/geckodriver/doc/Profiles.md +++ b/testing/geckodriver/doc/Profiles.md @@ -75,7 +75,7 @@ Firefox (1), and a set of recommended preferences set on startup (2). These can be perused here: 1. [testing/geckodriver/src/prefs.rs](https://searchfox.org/mozilla-central/source/testing/geckodriver/src/prefs.rs) - 2. [remote/components/marionette.js](https://searchfox.org/mozilla-central/source/remote/components/marionette.js) + 2. [testing/marionette/components/marionette/marionette.js](https://searchfox.org/mozilla-central/source/testing/marionette/components/marionette.js) As mentioned, these are _recommended_ preferences, and any user-defined preferences in the [user.js file] or as part of the [`prefs` capability] diff --git a/remote/marionette/.eslintrc.js b/testing/marionette/.eslintrc.js similarity index 100% rename from remote/marionette/.eslintrc.js rename to testing/marionette/.eslintrc.js diff --git a/remote/marionette/README b/testing/marionette/README similarity index 82% rename from remote/marionette/README rename to testing/marionette/README index d077a5136c40..6dd268afec28 100644 --- a/remote/marionette/README +++ b/testing/marionette/README @@ -11,10 +11,10 @@ Marionette [ ˌmarɪəˈnɛt] is Marionette provides interfaces for interacting with both the internal JavaScript runtime and UI elements of Gecko-based browsers, such -as Firefox on desktop and mobile. It can control both the chrome- and content +as Firefox and Fennec. It can control both the chrome- and content documents, giving a high level of control and ability to replicate, or emulate, user interaction. Head on to the Marionette documentation to find out more: - https://firefox-source-docs.mozilla.org/testing/marionette/ + https://firefox-source-docs.mozilla.org/testing/marionette/marionette/ diff --git a/remote/marionette/accessibility.js b/testing/marionette/accessibility.js similarity index 100% rename from remote/marionette/accessibility.js rename to testing/marionette/accessibility.js diff --git a/remote/marionette/action.js b/testing/marionette/action.js similarity index 100% rename from remote/marionette/action.js rename to testing/marionette/action.js diff --git a/remote/marionette/actors/MarionetteCommandsChild.jsm b/testing/marionette/actors/MarionetteCommandsChild.jsm similarity index 100% rename from remote/marionette/actors/MarionetteCommandsChild.jsm rename to testing/marionette/actors/MarionetteCommandsChild.jsm diff --git a/remote/marionette/actors/MarionetteCommandsParent.jsm b/testing/marionette/actors/MarionetteCommandsParent.jsm similarity index 100% rename from remote/marionette/actors/MarionetteCommandsParent.jsm rename to testing/marionette/actors/MarionetteCommandsParent.jsm diff --git a/remote/marionette/actors/MarionetteEventsChild.jsm b/testing/marionette/actors/MarionetteEventsChild.jsm similarity index 100% rename from remote/marionette/actors/MarionetteEventsChild.jsm rename to testing/marionette/actors/MarionetteEventsChild.jsm diff --git a/remote/marionette/actors/MarionetteEventsParent.jsm b/testing/marionette/actors/MarionetteEventsParent.jsm similarity index 100% rename from remote/marionette/actors/MarionetteEventsParent.jsm rename to testing/marionette/actors/MarionetteEventsParent.jsm diff --git a/remote/marionette/actors/MarionetteReftestChild.jsm b/testing/marionette/actors/MarionetteReftestChild.jsm similarity index 100% rename from remote/marionette/actors/MarionetteReftestChild.jsm rename to testing/marionette/actors/MarionetteReftestChild.jsm diff --git a/remote/marionette/actors/MarionetteReftestParent.jsm b/testing/marionette/actors/MarionetteReftestParent.jsm similarity index 100% rename from remote/marionette/actors/MarionetteReftestParent.jsm rename to testing/marionette/actors/MarionetteReftestParent.jsm diff --git a/remote/marionette/addon.js b/testing/marionette/addon.js similarity index 100% rename from remote/marionette/addon.js rename to testing/marionette/addon.js diff --git a/remote/marionette/appinfo.js b/testing/marionette/appinfo.js similarity index 100% rename from remote/marionette/appinfo.js rename to testing/marionette/appinfo.js diff --git a/remote/marionette/assert.js b/testing/marionette/assert.js similarity index 100% rename from remote/marionette/assert.js rename to testing/marionette/assert.js diff --git a/remote/marionette/atom.js b/testing/marionette/atom.js similarity index 100% rename from remote/marionette/atom.js rename to testing/marionette/atom.js diff --git a/remote/marionette/browser.js b/testing/marionette/browser.js similarity index 100% rename from remote/marionette/browser.js rename to testing/marionette/browser.js diff --git a/remote/marionette/capture.js b/testing/marionette/capture.js similarity index 100% rename from remote/marionette/capture.js rename to testing/marionette/capture.js diff --git a/remote/marionette/cert.js b/testing/marionette/cert.js similarity index 100% rename from remote/marionette/cert.js rename to testing/marionette/cert.js diff --git a/remote/marionette/chrome/test.xhtml b/testing/marionette/chrome/test.xhtml similarity index 100% rename from remote/marionette/chrome/test.xhtml rename to testing/marionette/chrome/test.xhtml diff --git a/remote/marionette/chrome/test2.xhtml b/testing/marionette/chrome/test2.xhtml similarity index 100% rename from remote/marionette/chrome/test2.xhtml rename to testing/marionette/chrome/test2.xhtml diff --git a/remote/marionette/chrome/test_dialog.dtd b/testing/marionette/chrome/test_dialog.dtd similarity index 100% rename from remote/marionette/chrome/test_dialog.dtd rename to testing/marionette/chrome/test_dialog.dtd diff --git a/remote/marionette/chrome/test_dialog.properties b/testing/marionette/chrome/test_dialog.properties similarity index 100% rename from remote/marionette/chrome/test_dialog.properties rename to testing/marionette/chrome/test_dialog.properties diff --git a/remote/marionette/chrome/test_dialog.xhtml b/testing/marionette/chrome/test_dialog.xhtml similarity index 100% rename from remote/marionette/chrome/test_dialog.xhtml rename to testing/marionette/chrome/test_dialog.xhtml diff --git a/remote/marionette/chrome/test_menupopup.xhtml b/testing/marionette/chrome/test_menupopup.xhtml similarity index 100% rename from remote/marionette/chrome/test_menupopup.xhtml rename to testing/marionette/chrome/test_menupopup.xhtml diff --git a/remote/marionette/chrome/test_nested_iframe.xhtml b/testing/marionette/chrome/test_nested_iframe.xhtml similarity index 100% rename from remote/marionette/chrome/test_nested_iframe.xhtml rename to testing/marionette/chrome/test_nested_iframe.xhtml diff --git a/remote/components/marionette.js b/testing/marionette/components/marionette.js similarity index 100% rename from remote/components/marionette.js rename to testing/marionette/components/marionette.js diff --git a/remote/components/marionette.manifest b/testing/marionette/components/marionette.manifest similarity index 100% rename from remote/components/marionette.manifest rename to testing/marionette/components/marionette.manifest diff --git a/testing/marionette/components/moz.build b/testing/marionette/components/moz.build new file mode 100644 index 000000000000..1771ec39d652 --- /dev/null +++ b/testing/marionette/components/moz.build @@ -0,0 +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"] diff --git a/remote/components/nsIMarionette.idl b/testing/marionette/components/nsIMarionette.idl similarity index 100% rename from remote/components/nsIMarionette.idl rename to testing/marionette/components/nsIMarionette.idl diff --git a/remote/marionette/cookie.js b/testing/marionette/cookie.js similarity index 100% rename from remote/marionette/cookie.js rename to testing/marionette/cookie.js diff --git a/remote/marionette/doc/Building.md b/testing/marionette/doc/Building.md similarity index 100% rename from remote/marionette/doc/Building.md rename to testing/marionette/doc/Building.md diff --git a/remote/marionette/doc/CodeStyle.md b/testing/marionette/doc/CodeStyle.md similarity index 92% rename from remote/marionette/doc/CodeStyle.md rename to testing/marionette/doc/CodeStyle.md index 5e1895e1a306..bc332fb17a44 100644 --- a/remote/marionette/doc/CodeStyle.md +++ b/testing/marionette/doc/CodeStyle.md @@ -14,7 +14,7 @@ For the overall Marionette project, a few rough rules are: * Code is mutable and not written in stone. Nothing that is checked in is sacred and we encourage change to make - remote/marionette a pleasant ecosystem to work in. + testing/marionette a pleasant ecosystem to work in. JavaScript @@ -166,14 +166,14 @@ to make this happen! 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 +Firefox when changing code. Any change to testing/marionette/*.js will be picked up on restarting Firefox. The only notable exception -is remote/components/marionette.js, which does require +is testing/marionette/components/marionette.js, which does require a re-build. [XPCOM]: https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM [strict mode]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode -[our own specialisations]: https://searchfox.org/mozilla-central/source/remote/marionette/.eslintrc.js +[our own specialisations]: https://searchfox.org/mozilla-central/source/testing/marionette/.eslintrc.js [linter]: #linting [copying header]: https://www.mozilla.org/en-US/MPL/headers/ [public domain]: https://creativecommons.org/publicdomain/zero/1.0/ @@ -190,7 +190,7 @@ TODO Documentation ------------- -We keep our documentation in-tree under [remote/marionette/doc] +We keep our documentation in-tree under [testing/marionette/doc] and [testing/geckodriver/doc]. Updates and minor changes to documentation should ideally not be scrutinised to the same degree as code changes to encourage frequent updates so that the documentation @@ -207,17 +207,16 @@ These include public functions—or command implementations—on the `GeckoDriver` class, as well as all exported symbols from other modules. Documentation for non-exported symbols is not required. -The API documentation can be regenerated to [remote/marionette/doc/internals] +The API documentation can be regenerated to [testing/marionette/doc/api] so: -The API documentation uses [jsdoc] and is generated to on Taskcluster. You may also build the documentation locally: +The API documentation uses [jsdoc] and is generated to on Taskcluster. You may also build the documentation locally: % ./mach doc [Mozilla eslint rules]: https://searchfox.org/mozilla-central/source/.eslintrc.js -[remote/marionette/doc]: https://searchfox.org/mozilla-central/source/remote/marionette/doc -[remote/marionette/doc/internals]: https://searchfox.org/mozilla-central/source/remote/marionette/doc/internals [testing/geckodriver/doc]: https://searchfox.org/mozilla-central/source/testing/geckodriver/doc +[testing/marionette/doc]: https://searchfox.org/mozilla-central/source/testing/marionette/doc [jsdoc]: http://usejsdoc.org/ @@ -230,13 +229,13 @@ which harmonises the output from [eslint] and [flake8]. To run the linter with a sensible output: - % ./mach lint -funix remote/marionette + % ./mach lint -funix testing/marionette For certain classes of style violations the eslint linter has an automatic mode for fixing and formatting your code. This is particularly useful to keep to whitespace and indentation rules: - % ./mach eslint --fix remote/marionette + % ./mach eslint --fix testing/marionette The linter is also run as a try job (shorthand `ES`) which means any style violations will automatically block a patch from landing diff --git a/remote/marionette/doc/Contributing.md b/testing/marionette/doc/Contributing.md similarity index 99% rename from remote/marionette/doc/Contributing.md rename to testing/marionette/doc/Contributing.md index f146568d9499..e325b1a95263 100644 --- a/remote/marionette/doc/Contributing.md +++ b/testing/marionette/doc/Contributing.md @@ -56,7 +56,7 @@ code in our [code style document], which we highly recommend you read. [ask questions]: ./index.html#communication [reach out to us]: ./index.html#communication -[mozilla-central]: https://searchfox.org/mozilla-central/source/remote/marionette/ +[mozilla-central]: https://searchfox.org/mozilla-central/source/testing/marionette/ [good first bugs]: https://codetribute.mozilla.org/projects/automation [code style document]: CodeStyle.html diff --git a/remote/marionette/doc/Debugging.md b/testing/marionette/doc/Debugging.md similarity index 100% rename from remote/marionette/doc/Debugging.md rename to testing/marionette/doc/Debugging.md diff --git a/remote/marionette/doc/Intro.md b/testing/marionette/doc/Intro.md similarity index 100% rename from remote/marionette/doc/Intro.md rename to testing/marionette/doc/Intro.md diff --git a/remote/marionette/doc/NewContributors.md b/testing/marionette/doc/NewContributors.md similarity index 92% rename from remote/marionette/doc/NewContributors.md rename to testing/marionette/doc/NewContributors.md index d01937c02d4a..5411b32862ba 100644 --- a/remote/marionette/doc/NewContributors.md +++ b/testing/marionette/doc/NewContributors.md @@ -64,8 +64,7 @@ your patches are laid out in [Patches.md](Patches.html). Resources --------- - * Search Mozilla's code repository with searchfox to find the [code for - Marionette] and the [Marionette client/harness]. + * Search Mozilla's code repositories with [searchfox]. * Another [guide for new contributors]. It has not been updated in a long time but it's a good general resource if you ever get stuck on something. @@ -82,8 +81,7 @@ Resources * If you'd rather use git instead of hg, see [git workflow for Gecko development] and/or [this blog post by :ato]. -[code for Marionette]: https://searchfox.org/mozilla-central/source/remote/marionette/ -[Marionette client/harness]: https://searchfox.org/mozilla-central/source/testing/marionette/ +[searchfox]: https://searchfox.org/mozilla-central/source/testing/marionette/ [guide for new contributors]: https://ateam-bootcamp.readthedocs.org/en/latest/guide/index.html#new-contributor-guide [Mercurial for Mozillians]: https://mozilla-version-control-tools.readthedocs.org/en/latest/hgmozilla/index.html [guide]: https://gist.github.com/mjzffr/d2adef328a416081f543 diff --git a/remote/marionette/doc/Patches.md b/testing/marionette/doc/Patches.md similarity index 100% rename from remote/marionette/doc/Patches.md rename to testing/marionette/doc/Patches.md diff --git a/remote/marionette/doc/Prefs.md b/testing/marionette/doc/Prefs.md similarity index 100% rename from remote/marionette/doc/Prefs.md rename to testing/marionette/doc/Prefs.md diff --git a/remote/marionette/doc/Protocol.md b/testing/marionette/doc/Protocol.md similarity index 100% rename from remote/marionette/doc/Protocol.md rename to testing/marionette/doc/Protocol.md diff --git a/remote/marionette/doc/PythonTests.md b/testing/marionette/doc/PythonTests.md similarity index 100% rename from remote/marionette/doc/PythonTests.md rename to testing/marionette/doc/PythonTests.md diff --git a/remote/marionette/doc/SeleniumAtoms.md b/testing/marionette/doc/SeleniumAtoms.md similarity index 97% rename from remote/marionette/doc/SeleniumAtoms.md rename to testing/marionette/doc/SeleniumAtoms.md index ef114595ff8c..9f5a73f36c5c 100644 --- a/remote/marionette/doc/SeleniumAtoms.md +++ b/testing/marionette/doc/SeleniumAtoms.md @@ -17,7 +17,7 @@ To use one of those atoms Javascript modules will have to import [Selenium atoms]: https://github.com/SeleniumHQ/selenium/tree/master/javascript/webdriver/atoms [WebDriver specification]: https://w3c.github.io/webdriver/webdriver-spec.html -[atom.js]: https://searchfox.org/mozilla-central/source/remote/marionette/atom.js +[atom.js]: https://searchfox.org/mozilla-central/source/testing/marionette/atom.js Update required Selenium atoms diff --git a/remote/marionette/doc/Taskcluster.md b/testing/marionette/doc/Taskcluster.md similarity index 100% rename from remote/marionette/doc/Taskcluster.md rename to testing/marionette/doc/Taskcluster.md diff --git a/remote/marionette/doc/Testing.md b/testing/marionette/doc/Testing.md similarity index 97% rename from remote/marionette/doc/Testing.md rename to testing/marionette/doc/Testing.md index 2b3fb87e723e..f95b9d100c72 100644 --- a/remote/marionette/doc/Testing.md +++ b/testing/marionette/doc/Testing.md @@ -23,14 +23,14 @@ xpcshell unit tests ------------------- Marionette has a set of [xpcshell] unit tests located in -_remote/marionette/test/xpcshell. These can be run this way: +_testing/marionette/test/unit. These can be run this way: - % ./mach test remote/marionette/test/unit + % ./mach test testing/marionette/test/unit Because tests are run in parallel and xpcshell itself is quite chatty, it can sometimes be useful to run the tests sequentially: - % ./mach test --sequential remote/marionette/test/xpcshell/test_error.js + % ./mach test --sequential testing/marionette/test/unit/test_error.js These unit tests run as part of the `X` jobs on Treeherder. diff --git a/remote/marionette/doc/index.rst b/testing/marionette/doc/index.rst similarity index 100% rename from remote/marionette/doc/index.rst rename to testing/marionette/doc/index.rst diff --git a/remote/marionette/doc/internals/action.rst b/testing/marionette/doc/internals/action.rst similarity index 100% rename from remote/marionette/doc/internals/action.rst rename to testing/marionette/doc/internals/action.rst diff --git a/remote/marionette/doc/internals/addon.rst b/testing/marionette/doc/internals/addon.rst similarity index 100% rename from remote/marionette/doc/internals/addon.rst rename to testing/marionette/doc/internals/addon.rst diff --git a/remote/marionette/doc/internals/appinfo.rst b/testing/marionette/doc/internals/appinfo.rst similarity index 100% rename from remote/marionette/doc/internals/appinfo.rst rename to testing/marionette/doc/internals/appinfo.rst diff --git a/remote/marionette/doc/internals/assert.rst b/testing/marionette/doc/internals/assert.rst similarity index 100% rename from remote/marionette/doc/internals/assert.rst rename to testing/marionette/doc/internals/assert.rst diff --git a/remote/marionette/doc/internals/browser.rst b/testing/marionette/doc/internals/browser.rst similarity index 100% rename from remote/marionette/doc/internals/browser.rst rename to testing/marionette/doc/internals/browser.rst diff --git a/remote/marionette/doc/internals/capture.rst b/testing/marionette/doc/internals/capture.rst similarity index 100% rename from remote/marionette/doc/internals/capture.rst rename to testing/marionette/doc/internals/capture.rst diff --git a/remote/marionette/doc/internals/cert.rst b/testing/marionette/doc/internals/cert.rst similarity index 100% rename from remote/marionette/doc/internals/cert.rst rename to testing/marionette/doc/internals/cert.rst diff --git a/remote/marionette/doc/internals/cookie.rst b/testing/marionette/doc/internals/cookie.rst similarity index 100% rename from remote/marionette/doc/internals/cookie.rst rename to testing/marionette/doc/internals/cookie.rst diff --git a/remote/marionette/doc/internals/dom.rst b/testing/marionette/doc/internals/dom.rst similarity index 100% rename from remote/marionette/doc/internals/dom.rst rename to testing/marionette/doc/internals/dom.rst diff --git a/remote/marionette/doc/internals/driver.rst b/testing/marionette/doc/internals/driver.rst similarity index 100% rename from remote/marionette/doc/internals/driver.rst rename to testing/marionette/doc/internals/driver.rst diff --git a/remote/marionette/doc/internals/element.rst b/testing/marionette/doc/internals/element.rst similarity index 100% rename from remote/marionette/doc/internals/element.rst rename to testing/marionette/doc/internals/element.rst diff --git a/remote/marionette/doc/internals/error.rst b/testing/marionette/doc/internals/error.rst similarity index 100% rename from remote/marionette/doc/internals/error.rst rename to testing/marionette/doc/internals/error.rst diff --git a/remote/marionette/doc/internals/evaluate.rst b/testing/marionette/doc/internals/evaluate.rst similarity index 100% rename from remote/marionette/doc/internals/evaluate.rst rename to testing/marionette/doc/internals/evaluate.rst diff --git a/remote/marionette/doc/internals/event.rst b/testing/marionette/doc/internals/event.rst similarity index 100% rename from remote/marionette/doc/internals/event.rst rename to testing/marionette/doc/internals/event.rst diff --git a/remote/marionette/doc/internals/format.rst b/testing/marionette/doc/internals/format.rst similarity index 100% rename from remote/marionette/doc/internals/format.rst rename to testing/marionette/doc/internals/format.rst diff --git a/remote/marionette/doc/internals/index.rst b/testing/marionette/doc/internals/index.rst similarity index 100% rename from remote/marionette/doc/internals/index.rst rename to testing/marionette/doc/internals/index.rst diff --git a/remote/marionette/doc/internals/interaction.rst b/testing/marionette/doc/internals/interaction.rst similarity index 100% rename from remote/marionette/doc/internals/interaction.rst rename to testing/marionette/doc/internals/interaction.rst diff --git a/remote/marionette/doc/internals/log.rst b/testing/marionette/doc/internals/log.rst similarity index 100% rename from remote/marionette/doc/internals/log.rst rename to testing/marionette/doc/internals/log.rst diff --git a/remote/marionette/doc/internals/message.rst b/testing/marionette/doc/internals/message.rst similarity index 100% rename from remote/marionette/doc/internals/message.rst rename to testing/marionette/doc/internals/message.rst diff --git a/remote/marionette/doc/internals/modal.rst b/testing/marionette/doc/internals/modal.rst similarity index 100% rename from remote/marionette/doc/internals/modal.rst rename to testing/marionette/doc/internals/modal.rst diff --git a/remote/marionette/doc/internals/navigate.rst b/testing/marionette/doc/internals/navigate.rst similarity index 100% rename from remote/marionette/doc/internals/navigate.rst rename to testing/marionette/doc/internals/navigate.rst diff --git a/remote/marionette/doc/internals/packets.rst b/testing/marionette/doc/internals/packets.rst similarity index 100% rename from remote/marionette/doc/internals/packets.rst rename to testing/marionette/doc/internals/packets.rst diff --git a/remote/marionette/doc/internals/prefs.rst b/testing/marionette/doc/internals/prefs.rst similarity index 100% rename from remote/marionette/doc/internals/prefs.rst rename to testing/marionette/doc/internals/prefs.rst diff --git a/remote/marionette/doc/internals/reftest.rst b/testing/marionette/doc/internals/reftest.rst similarity index 100% rename from remote/marionette/doc/internals/reftest.rst rename to testing/marionette/doc/internals/reftest.rst diff --git a/remote/marionette/doc/internals/server.rst b/testing/marionette/doc/internals/server.rst similarity index 100% rename from remote/marionette/doc/internals/server.rst rename to testing/marionette/doc/internals/server.rst diff --git a/remote/marionette/doc/internals/session.rst b/testing/marionette/doc/internals/session.rst similarity index 100% rename from remote/marionette/doc/internals/session.rst rename to testing/marionette/doc/internals/session.rst diff --git a/remote/marionette/doc/internals/sync.rst b/testing/marionette/doc/internals/sync.rst similarity index 100% rename from remote/marionette/doc/internals/sync.rst rename to testing/marionette/doc/internals/sync.rst diff --git a/remote/marionette/doc/internals/window-manager.rst b/testing/marionette/doc/internals/window-manager.rst similarity index 100% rename from remote/marionette/doc/internals/window-manager.rst rename to testing/marionette/doc/internals/window-manager.rst diff --git a/remote/marionette/dom.js b/testing/marionette/dom.js similarity index 100% rename from remote/marionette/dom.js rename to testing/marionette/dom.js diff --git a/remote/marionette/driver.js b/testing/marionette/driver.js similarity index 100% rename from remote/marionette/driver.js rename to testing/marionette/driver.js diff --git a/remote/marionette/element.js b/testing/marionette/element.js similarity index 100% rename from remote/marionette/element.js rename to testing/marionette/element.js diff --git a/remote/marionette/error.js b/testing/marionette/error.js similarity index 100% rename from remote/marionette/error.js rename to testing/marionette/error.js diff --git a/remote/marionette/evaluate.js b/testing/marionette/evaluate.js similarity index 100% rename from remote/marionette/evaluate.js rename to testing/marionette/evaluate.js diff --git a/remote/marionette/event.js b/testing/marionette/event.js similarity index 100% rename from remote/marionette/event.js rename to testing/marionette/event.js diff --git a/remote/marionette/format.js b/testing/marionette/format.js similarity index 100% rename from remote/marionette/format.js rename to testing/marionette/format.js diff --git a/remote/marionette/interaction.js b/testing/marionette/interaction.js similarity index 100% rename from remote/marionette/interaction.js rename to testing/marionette/interaction.js diff --git a/remote/marionette/jar.mn b/testing/marionette/jar.mn similarity index 98% rename from remote/marionette/jar.mn rename to testing/marionette/jar.mn index 110e99b8c50a..e814b230eded 100644 --- a/remote/marionette/jar.mn +++ b/testing/marionette/jar.mn @@ -39,7 +39,7 @@ marionette.jar: content/prefs.js (prefs.js) content/print.js (print.js) content/reftest.js (reftest.js) - content/reftest.xhtml (chrome/reftest.xhtml) + content/reftest.xhtml (reftest.xhtml) content/reftest-content.js (reftest-content.js) content/server.js (server.js) content/session.js (session.js) diff --git a/remote/marionette/l10n.js b/testing/marionette/l10n.js similarity index 100% rename from remote/marionette/l10n.js rename to testing/marionette/l10n.js diff --git a/remote/marionette/legacyaction.js b/testing/marionette/legacyaction.js similarity index 100% rename from remote/marionette/legacyaction.js rename to testing/marionette/legacyaction.js diff --git a/remote/marionette/log.js b/testing/marionette/log.js similarity index 100% rename from remote/marionette/log.js rename to testing/marionette/log.js diff --git a/remote/marionette/message.js b/testing/marionette/message.js similarity index 100% rename from remote/marionette/message.js rename to testing/marionette/message.js diff --git a/remote/marionette/modal.js b/testing/marionette/modal.js similarity index 100% rename from remote/marionette/modal.js rename to testing/marionette/modal.js diff --git a/testing/marionette/moz.build b/testing/marionette/moz.build index b66a3abdd542..c7d091102086 100644 --- a/testing/marionette/moz.build +++ b/testing/marionette/moz.build @@ -2,7 +2,12 @@ # 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/. +DIRS += ["components"] + +JAR_MANIFESTS += ["jar.mn"] + MARIONETTE_UNIT_MANIFESTS += ["harness/marionette_harness/tests/unit/unit-tests.ini"] +XPCSHELL_TESTS_MANIFESTS += ["test/unit/xpcshell.ini"] with Files("**"): BUG_COMPONENT = ("Testing", "Marionette") @@ -10,4 +15,8 @@ with Files("**"): with Files("harness/**"): SCHEDULES.exclusive = ["marionette", "firefox-ui"] +SPHINX_TREES["/testing/marionette"] = "doc" SPHINX_PYTHON_PACKAGE_DIRS += ["client/marionette_driver"] + +with Files("doc/**"): + SCHEDULES.exclusive = ["docs"] diff --git a/remote/marionette/navigate.js b/testing/marionette/navigate.js similarity index 100% rename from remote/marionette/navigate.js rename to testing/marionette/navigate.js diff --git a/remote/marionette/packets.js b/testing/marionette/packets.js similarity index 100% rename from remote/marionette/packets.js rename to testing/marionette/packets.js diff --git a/remote/marionette/permissions.js b/testing/marionette/permissions.js similarity index 100% rename from remote/marionette/permissions.js rename to testing/marionette/permissions.js diff --git a/remote/marionette/prefs.js b/testing/marionette/prefs.js similarity index 100% rename from remote/marionette/prefs.js rename to testing/marionette/prefs.js diff --git a/remote/marionette/print.js b/testing/marionette/print.js similarity index 100% rename from remote/marionette/print.js rename to testing/marionette/print.js diff --git a/remote/marionette/reftest-content.js b/testing/marionette/reftest-content.js similarity index 100% rename from remote/marionette/reftest-content.js rename to testing/marionette/reftest-content.js diff --git a/remote/marionette/reftest.js b/testing/marionette/reftest.js similarity index 100% rename from remote/marionette/reftest.js rename to testing/marionette/reftest.js diff --git a/remote/marionette/chrome/reftest.xhtml b/testing/marionette/reftest.xhtml similarity index 100% rename from remote/marionette/chrome/reftest.xhtml rename to testing/marionette/reftest.xhtml diff --git a/remote/marionette/server.js b/testing/marionette/server.js similarity index 100% rename from remote/marionette/server.js rename to testing/marionette/server.js diff --git a/remote/marionette/session.js b/testing/marionette/session.js similarity index 100% rename from remote/marionette/session.js rename to testing/marionette/session.js diff --git a/remote/marionette/stream-utils.js b/testing/marionette/stream-utils.js similarity index 100% rename from remote/marionette/stream-utils.js rename to testing/marionette/stream-utils.js diff --git a/remote/marionette/sync.js b/testing/marionette/sync.js similarity index 100% rename from remote/marionette/sync.js rename to testing/marionette/sync.js diff --git a/remote/marionette/test/README b/testing/marionette/test/README similarity index 100% rename from remote/marionette/test/README rename to testing/marionette/test/README diff --git a/remote/marionette/test/xpcshell/.eslintrc.js b/testing/marionette/test/unit/.eslintrc.js similarity index 100% rename from remote/marionette/test/xpcshell/.eslintrc.js rename to testing/marionette/test/unit/.eslintrc.js diff --git a/remote/marionette/test/xpcshell/README b/testing/marionette/test/unit/README similarity index 81% rename from remote/marionette/test/xpcshell/README rename to testing/marionette/test/unit/README index ce516d17ca4f..06eca782e766 100644 --- a/remote/marionette/test/xpcshell/README +++ b/testing/marionette/test/unit/README @@ -1,11 +1,11 @@ To run the tests in this directory, from the top source directory, either invoke the test despatcher in mach: - % ./mach test remote/marionette/test/xpcshell + % ./mach test testing/marionette/test/unit Or call out the harness specifically: - % ./mach xpcshell-test remote/marionette/test/xpcshell + % ./mach xpcshell-test testing/marionette/test/unit The latter gives you the --sequential option which can be useful when debugging to prevent tests from running in parallel. diff --git a/remote/marionette/test/xpcshell/test_action.js b/testing/marionette/test/unit/test_action.js similarity index 100% rename from remote/marionette/test/xpcshell/test_action.js rename to testing/marionette/test/unit/test_action.js diff --git a/remote/marionette/test/xpcshell/test_actors.js b/testing/marionette/test/unit/test_actors.js similarity index 100% rename from remote/marionette/test/xpcshell/test_actors.js rename to testing/marionette/test/unit/test_actors.js diff --git a/remote/marionette/test/xpcshell/test_appinfo.js b/testing/marionette/test/unit/test_appinfo.js similarity index 100% rename from remote/marionette/test/xpcshell/test_appinfo.js rename to testing/marionette/test/unit/test_appinfo.js diff --git a/remote/marionette/test/xpcshell/test_assert.js b/testing/marionette/test/unit/test_assert.js similarity index 100% rename from remote/marionette/test/xpcshell/test_assert.js rename to testing/marionette/test/unit/test_assert.js diff --git a/remote/marionette/test/xpcshell/test_browser.js b/testing/marionette/test/unit/test_browser.js similarity index 100% rename from remote/marionette/test/xpcshell/test_browser.js rename to testing/marionette/test/unit/test_browser.js diff --git a/remote/marionette/test/xpcshell/test_cookie.js b/testing/marionette/test/unit/test_cookie.js similarity index 100% rename from remote/marionette/test/xpcshell/test_cookie.js rename to testing/marionette/test/unit/test_cookie.js diff --git a/remote/marionette/test/xpcshell/test_dom.js b/testing/marionette/test/unit/test_dom.js similarity index 100% rename from remote/marionette/test/xpcshell/test_dom.js rename to testing/marionette/test/unit/test_dom.js diff --git a/remote/marionette/test/xpcshell/test_element.js b/testing/marionette/test/unit/test_element.js similarity index 100% rename from remote/marionette/test/xpcshell/test_element.js rename to testing/marionette/test/unit/test_element.js diff --git a/remote/marionette/test/xpcshell/test_error.js b/testing/marionette/test/unit/test_error.js similarity index 100% rename from remote/marionette/test/xpcshell/test_error.js rename to testing/marionette/test/unit/test_error.js diff --git a/remote/marionette/test/xpcshell/test_evaluate.js b/testing/marionette/test/unit/test_evaluate.js similarity index 100% rename from remote/marionette/test/xpcshell/test_evaluate.js rename to testing/marionette/test/unit/test_evaluate.js diff --git a/remote/marionette/test/xpcshell/test_format.js b/testing/marionette/test/unit/test_format.js similarity index 100% rename from remote/marionette/test/xpcshell/test_format.js rename to testing/marionette/test/unit/test_format.js diff --git a/remote/marionette/test/xpcshell/test_message.js b/testing/marionette/test/unit/test_message.js similarity index 100% rename from remote/marionette/test/xpcshell/test_message.js rename to testing/marionette/test/unit/test_message.js diff --git a/remote/marionette/test/xpcshell/test_modal.js b/testing/marionette/test/unit/test_modal.js similarity index 100% rename from remote/marionette/test/xpcshell/test_modal.js rename to testing/marionette/test/unit/test_modal.js diff --git a/remote/marionette/test/xpcshell/test_navigate.js b/testing/marionette/test/unit/test_navigate.js similarity index 100% rename from remote/marionette/test/xpcshell/test_navigate.js rename to testing/marionette/test/unit/test_navigate.js diff --git a/remote/marionette/test/xpcshell/test_prefs.js b/testing/marionette/test/unit/test_prefs.js similarity index 100% rename from remote/marionette/test/xpcshell/test_prefs.js rename to testing/marionette/test/unit/test_prefs.js diff --git a/remote/marionette/test/xpcshell/test_session.js b/testing/marionette/test/unit/test_session.js similarity index 100% rename from remote/marionette/test/xpcshell/test_session.js rename to testing/marionette/test/unit/test_session.js diff --git a/remote/marionette/test/xpcshell/test_store.js b/testing/marionette/test/unit/test_store.js similarity index 100% rename from remote/marionette/test/xpcshell/test_store.js rename to testing/marionette/test/unit/test_store.js diff --git a/remote/marionette/test/xpcshell/test_sync.js b/testing/marionette/test/unit/test_sync.js similarity index 100% rename from remote/marionette/test/xpcshell/test_sync.js rename to testing/marionette/test/unit/test_sync.js diff --git a/remote/marionette/test/xpcshell/xpcshell.ini b/testing/marionette/test/unit/xpcshell.ini similarity index 100% rename from remote/marionette/test/xpcshell/xpcshell.ini rename to testing/marionette/test/unit/xpcshell.ini diff --git a/remote/marionette/transport.js b/testing/marionette/transport.js similarity index 100% rename from remote/marionette/transport.js rename to testing/marionette/transport.js diff --git a/remote/marionette/window-manager.js b/testing/marionette/window-manager.js similarity index 100% rename from remote/marionette/window-manager.js rename to testing/marionette/window-manager.js diff --git a/toolkit/moz.configure b/toolkit/moz.configure index 81d09848f25d..ac7ab6c2efe5 100644 --- a/toolkit/moz.configure +++ b/toolkit/moz.configure @@ -1075,7 +1075,7 @@ add_old_configure_assignment("FT2_CFLAGS", ft2_info.cflags) # It also backs ../testing/geckodriver, which is Mozilla's WebDriver # implementation. # -# The source of Marionette lives in ../remote/marionette. +# The source of Marionette lives in ../testing/marionette. # # For more information, see: # https://firefox-source-docs.mozilla.org/testing/marionette/index.html diff --git a/tools/lint/codespell.yml b/tools/lint/codespell.yml index ec753c5ff18a..9c097084c4f1 100644 --- a/tools/lint/codespell.yml +++ b/tools/lint/codespell.yml @@ -35,11 +35,11 @@ codespell: - python/mach/docs/ - python/mozlint/ - remote/doc/ - - remote/marionette/doc/ - security/manager/locales/en-US/ - services/sync/locales/en-US/ - taskcluster/docs/ - testing/geckodriver/doc/ + - testing/marionette/doc/ - testing/mozbase/docs/ - toolkit/components/extensions/docs/ - toolkit/components/normandy/docs/