Bug 1337743 - Rename quitApplication command quit; r=whimboo
authorAndreas Tolfsen <ato@mozilla.com>
Mon, 27 Mar 2017 12:53:27 +0100
changeset 349811 5a5fd4594fd2831c27eab7da97c9e3a54df58497
parent 349810 8d5389290dacedf0d3ba77799a75d7b17cd21056
child 349812 c7a1b14752f4e5a1ff793d646903ebab2ed90b45
push id39580
push useratolfsen@mozilla.com
push dateMon, 27 Mar 2017 13:57:21 +0000
treeherderautoland@5a5fd4594fd2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo
bugs1337743
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1337743 - Rename quitApplication command quit; r=whimboo This shortens the name of the quitApplication Marionette command to `quit'. The client is not updated since it is used for Firefox upgrade tests. It can be updated to use `quit' when Firefox 56 ships. MozReview-Commit-ID: Gq5KWMS1AzF
testing/marionette/client/marionette_driver/marionette.py
testing/marionette/driver.js
testing/marionette/harness/marionette_harness/tests/unit/test_quit_restart.py
--- a/testing/marionette/client/marionette_driver/marionette.py
+++ b/testing/marionette/client/marionette_driver/marionette.py
@@ -1142,17 +1142,17 @@ class Marionette(object):
             flags ending with `"Quit"` are present.
 
         :throws InvalidArgumentException: If there are multiple
             `shutdown_flags` ending with `"Quit"`.
 
         """
 
         # The vast majority of this function was implemented inside
-        # the quitApplication command as part of bug 1337743, and can be
+        # the quit command as part of bug 1337743, and can be
         # removed from here in Firefox 55 at the earliest.
 
         # remove duplicates
         flags = set(shutdown_flags)
 
         # add eAttemptQuit if there are no *Quits
         if not any(flag.endswith("Quit") for flag in flags):
             flags = flags | set(("eAttemptQuit",))
@@ -1170,16 +1170,19 @@ class Marionette(object):
                 """)
             if canceled:
                 raise errors.MarionetteException(
                     "Something cancelled the quit application request")
 
         body = None
         if len(flags) > 0:
             body = {"flags": list(flags)}
+
+        # quitApplication was renamed quit in bug 1337743,
+        # and this can safely be renamed when Firefox 56 becomes stable
         self._send_message("quitApplication", body)
 
     @do_process_check
     def quit(self, in_app=False, callback=None):
         """Terminate the currently running instance.
 
         This command will delete the active marionette session. It also allows
         manipulation of eg. the profile data while the application is not running.
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -2732,17 +2732,17 @@ GeckoDriver.prototype.acceptConnections 
  *     Explaining the reason why the application quit.  This can be
  *     in response to a normal shutdown or restart, yielding "shutdown"
  *     or "restart", respectively.
  *
  * @throws {InvalidArgumentError}
  *     If |flags| contains unknown or incompatible flags, for example
  *     multiple Quit flags.
  */
-GeckoDriver.prototype.quitApplication = function* (cmd, resp) {
+GeckoDriver.prototype.quit = function* (cmd, resp) {
   const quits = ["eConsiderQuit", "eAttemptQuit", "eForceQuit"];
 
   let flags = [];
   if (typeof cmd.parameters.flags != "undefined") {
     flags = assert.array(cmd.parameters.flags);
   }
 
   // bug 1298921
@@ -3050,17 +3050,18 @@ GeckoDriver.prototype.commands = {
   "getWindowSize": GeckoDriver.prototype.getWindowSize,
   "setWindowSize": GeckoDriver.prototype.setWindowSize,
   "maximizeWindow": GeckoDriver.prototype.maximizeWindow,
   "dismissDialog": GeckoDriver.prototype.dismissDialog,
   "acceptDialog": GeckoDriver.prototype.acceptDialog,
   "getTextFromDialog": GeckoDriver.prototype.getTextFromDialog,
   "sendKeysToDialog": GeckoDriver.prototype.sendKeysToDialog,
   "acceptConnections": GeckoDriver.prototype.acceptConnections,
-  "quitApplication": GeckoDriver.prototype.quitApplication,
+  "quitApplication": GeckoDriver.prototype.quit,  // deprecated, can be removed in Firefox 56
+  "quit": GeckoDriver.prototype.quit,
 
   "localization:l10n:localizeEntity": GeckoDriver.prototype.localizeEntity,
   "localization:l10n:localizeProperty": GeckoDriver.prototype.localizeProperty,
 
   "addon:install": GeckoDriver.prototype.installAddon,
   "addon:uninstall": GeckoDriver.prototype.uninstallAddon,
 };
 
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_quit_restart.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_quit_restart.py
@@ -14,17 +14,17 @@ class TestServerQuitApplication(Marionet
             self.marionette.start_session()
 
     def quit(self, flags=None):
         body = None
         if flags is not None:
             body = {"flags": list(flags)}
 
         try:
-            resp = self.marionette._send_message("quitApplication", body)
+            resp = self.marionette._send_message("quit", body)
         finally:
             self.marionette.session_id = None
             self.marionette.session = None
             self.marionette.process_id = None
             self.marionette.profile = None
             self.marionette.window = None
 
         self.assertIn("cause", resp)
@@ -33,17 +33,17 @@ class TestServerQuitApplication(Marionet
         self.marionette.instance.runner.wait()
 
         return resp["cause"]
 
     def test_types(self):
         for typ in [42, True, "foo", []]:
             print("testing type {}".format(type(typ)))
             with self.assertRaises(errors.InvalidArgumentException):
-                self.marionette._send_message("quitApplication", typ)
+                self.marionette._send_message("quit", typ)
 
         with self.assertRaises(errors.InvalidArgumentException):
             self.quit("foo")
 
     def test_undefined_default(self):
         cause = self.quit()
         self.assertEqual("shutdown", cause)