Bug 963162 - Add WebDriver compatible getWindowHandle alias. r=dburns, a=test-only
authorAndreas Tolfsen <ato@mozilla.com>
Mon, 03 Feb 2014 12:27:25 -0500
changeset 175227 4bf8c252e4782e57fdd0bedc9f5d67949cbbb08b
parent 175226 9a8f844bfa1d031e6c5495d349f42c1a2763e7c5
child 175228 2151d583a45cd86c3a08a2d0d85c945d15172e49
push id3224
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:06:49 +0000
treeherdermozilla-beta@60c04d0987f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdburns, test-only
bugs963162
milestone28.0a2
Bug 963162 - Add WebDriver compatible getWindowHandle alias. r=dburns, a=test-only
testing/marionette/client/marionette/marionette.py
testing/marionette/marionette-server.js
--- a/testing/marionette/client/marionette/marionette.py
+++ b/testing/marionette/client/marionette/marionette.py
@@ -762,17 +762,17 @@ class Marionette(object):
         that uniquely identifies it within this Marionette instance.
         This can be used to switch to this window at a later point.
 
         :returns: unique window handle
         :rtype: string
 
         """
 
-        self.window = self._send_message("getCurrentWindowHandle", "value")
+        self.window = self._send_message("getWindowHandle", "value")
         return self.window
 
     @property
     def title(self):
         '''
         Current title of the active window.
         '''
         response = self._send_message('getTitle', 'value')
--- a/testing/marionette/marionette-server.js
+++ b/testing/marionette/marionette-server.js
@@ -1188,17 +1188,17 @@ MarionetteServerConnection.prototype = {
    * Get the current window's handle.
    *
    * Return an opaque server-assigned identifier to this window that
    * uniquely identifies it within this Marionette instance.  This can
    * be used to switch to this window at a later point.
    *
    * @return unique window handle (string)
    */
-  getCurrentWindowHandle: function MDA_getCurrentWindowHandle() {
+  getWindowHandle: function MDA_getWindowHandle() {
     this.command_id = this.getCommandId();
     for (let i in this.browsers) {
       if (this.curBrowser == this.browsers[i]) {
         this.sendResponse(i, this.command_id);
       }
     }
   },
 
@@ -2435,18 +2435,19 @@ MarionetteServerConnection.prototype.req
   "getPageSource": MarionetteServerConnection.prototype.getPageSource,
   "get": MarionetteServerConnection.prototype.get,
   "goUrl": MarionetteServerConnection.prototype.get,  // deprecated
   "getCurrentUrl": MarionetteServerConnection.prototype.getCurrentUrl,
   "getUrl": MarionetteServerConnection.prototype.getCurrentUrl,  // deprecated
   "goBack": MarionetteServerConnection.prototype.goBack,
   "goForward": MarionetteServerConnection.prototype.goForward,
   "refresh":  MarionetteServerConnection.prototype.refresh,
-  "getCurrentWindowHandle":  MarionetteServerConnection.prototype.getCurrentWindowHandle,
-  "getWindow":  MarionetteServerConnection.prototype.getCurrentWindowHandle,  // deprecated
+  "getWindowHandle": MarionetteServerConnection.prototype.getWindowHandle,
+  "getCurrentWindowHandle":  MarionetteServerConnection.prototype.getWindowHandle,  // Selenium 2 compat
+  "getWindow":  MarionetteServerConnection.prototype.getWindowHandle,  // deprecated
   "getWindowHandles": MarionetteServerConnection.prototype.getWindowHandles,
   "getCurrentWindowHandles": MarionetteServerConnection.prototype.getWindowHandles,  // Selenium 2 compat
   "getWindows":  MarionetteServerConnection.prototype.getWindowHandles,  // deprecated
   "getActiveFrame": MarionetteServerConnection.prototype.getActiveFrame,
   "switchToFrame": MarionetteServerConnection.prototype.switchToFrame,
   "switchToWindow": MarionetteServerConnection.prototype.switchToWindow,
   "deleteSession": MarionetteServerConnection.prototype.deleteSession,
   "emulatorCmdResult": MarionetteServerConnection.prototype.emulatorCmdResult,