Bug 1274550 - Return web element from Get Active Element; r=automatedtester a=test-only
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 26 May 2016 13:04:22 +0100
changeset 333266 d56843a09b07e760793a7b4672829e24d3a421b9
parent 333265 0bdbf947bce3d9eaecd44b1dd8e563a6c23b860e
child 333267 46a8549641ff87ed60e5a993cfe989fa49898ee3
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatedtester, test-only
bugs1274550
milestone48.0a2
Bug 1274550 - Return web element from Get Active Element; r=automatedtester a=test-only MozReview-Commit-ID: I5WHfJbMfPZ
testing/marionette/listener.js
--- a/testing/marionette/listener.js
+++ b/testing/marionette/listener.js
@@ -1064,29 +1064,20 @@ function* findElementsContent(strategy, 
   }
 
   let els = yield element.find(curContainer, strategy, selector, opts);
   let elRefs = seenEls.addAll(els);
   let webEls = elRefs.map(element.makeWebElement);
   return webEls;
 }
 
-/**
- * Find and return the active element on the page.
- *
- * @return {WebElement}
- *     Reference to web element.
- */
+/** Find and return the active element on the page. */
 function getActiveElement() {
   let el = curContainer.frame.document.activeElement;
-  let elRef = seenEls.add(el);
-  // TODO(ato): This incorrectly returns
-  // the element's associated UUID as a string
-  // instead of a web element.
-  return elRef;
+  return element.toJson(el, seenEls);
 }
 
 /**
  * Send click event to element.
  *
  * @param {WebElement} id
  *     Reference to the web element to click.
  */