Bug 941140 - getWindow not matching webdriver command. r=dburns, a=test-only
authorAndreas Tolfsen <ato@mozilla.com>
Tue, 21 Jan 2014 11:40:20 -0500
changeset 225603 eac6313b75f58fdd2aefacafded95b4cbe12edca
parent 225602 3d9d920ca43b30e85ec8ead854a813f4a953287b
child 225604 286d29768633fc7410fa1bd5aad3ad4e25edff6f
push id6
push userryanvm@gmail.com
push dateMon, 12 Jan 2015 22:04:06 +0000
treeherdermozilla-b2g37_v2_2@895c8fc7b734 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdburns, test-only
bugs941140
milestone28.0a2
Bug 941140 - getWindow not matching webdriver command. 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
@@ -751,20 +751,28 @@ class Marionette(object):
 
         :param timeout: Timeout in milliseconds.
         '''
         response = self._send_message('setSearchTimeout', 'ok', ms=timeout)
         return response
 
     @property
     def current_window_handle(self):
-        '''
-        A reference to the current window.
-        '''
-        self.window = self._send_message('getWindow', 'value')
+        """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.
+
+        :returns: unique window handle
+        :rtype: string
+
+        """
+
+        self.window = self._send_message("getCurrentWindowHandle", "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
@@ -1180,19 +1180,25 @@ MarionetteServerConnection.prototype = {
    * Refresh the page
    */
   refresh: function MDA_refresh() {
     this.command_id = this.getCommandId();
     this.sendAsync("refresh", {}, this.command_id);
   },
 
   /**
-   * Get the current window's server-assigned ID
+   * 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)
    */
-  getWindow: function MDA_getWindow() {
+  getCurrentWindowHandle: function MDA_getCurrentWindowHandle() {
     this.command_id = this.getCommandId();
     for (let i in this.browsers) {
       if (this.curBrowser == this.browsers[i]) {
         this.sendResponse(i, this.command_id);
       }
     }
   },
 
@@ -2418,17 +2424,18 @@ 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,
-  "getWindow":  MarionetteServerConnection.prototype.getWindow,
+  "getCurrentWindowHandle":  MarionetteServerConnection.prototype.getCurrentWindowHandle,
+  "getWindow":  MarionetteServerConnection.prototype.getCurrentWindowHandle,  // deprecated
   "getWindows":  MarionetteServerConnection.prototype.getWindows,
   "getActiveFrame": MarionetteServerConnection.prototype.getActiveFrame,
   "switchToFrame": MarionetteServerConnection.prototype.switchToFrame,
   "switchToWindow": MarionetteServerConnection.prototype.switchToWindow,
   "deleteSession": MarionetteServerConnection.prototype.deleteSession,
   "emulatorCmdResult": MarionetteServerConnection.prototype.emulatorCmdResult,
   "importScript": MarionetteServerConnection.prototype.importScript,
   "clearImportedScripts": MarionetteServerConnection.prototype.clearImportedScripts,