Bug 1362528 - Let getWindowHandles and getChromeWindowHandles return list of strings draft
authorHenrik Skupin <mail@hskupin.info>
Fri, 05 May 2017 22:21:51 +0200
changeset 573476 30c9ff5d169a8eb54d3edfbac1f267dc887b8ea1
parent 573359 23fe0b76a018a5077a0f7234cff91c41e4b6af64
child 627310 879bce6c78a8942aab8a6b3f63a77fbc9fea5e1e
push id57402
push userbmo:hskupin@gmail.com
push dateFri, 05 May 2017 20:22:16 +0000
bugs1362528
milestone55.0a1
Bug 1362528 - Let getWindowHandles and getChromeWindowHandles return list of strings By the webdriver spec both commands have to return a list of strings for the window handles. Right now those are numbers. MozReview-Commit-ID: 5Gn624BaVI1
testing/marionette/driver.js
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -1275,17 +1275,17 @@ GeckoDriver.prototype.getWindowHandle = 
  *
  * Each window handle is assigned by the server and is guaranteed unique,
  * however the return array does not have a specified ordering.
  *
  * @return {Array.<string>}
  *     Unique window handles.
  */
 GeckoDriver.prototype.getWindowHandles = function (cmd, resp) {
-  return this.windowHandles;
+  return this.windowHandles.map(String);
 }
 
 /**
  * Get the current window's handle.  This corresponds to a window that
  * may itself contain tabs.
  *
  * Return an opaque server-assigned identifier to this window that
  * uniquely identifies it within this Marionette instance.  This can
@@ -1308,17 +1308,17 @@ GeckoDriver.prototype.getChromeWindowHan
 /**
  * Returns identifiers for each open chrome window for tests interested in
  * managing a set of chrome windows and tabs separately.
  *
  * @return {Array.<string>}
  *     Unique window handles.
  */
 GeckoDriver.prototype.getChromeWindowHandles = function (cmd, resp) {
-  return this.chromeWindowHandles;
+  return this.chromeWindowHandles.map(String);
 }
 
 /**
  * Get the current position and size of the browser window currently in focus.
  *
  * Will return the current browser window size in pixels. Refers to
  * window outerWidth and outerHeight values, which include scroll bars,
  * title bars, etc.