Bug 1400256 - Use web element references in action tests. r?whimboo draft
authorAndreas Tolfsen <ato@sny.no>
Mon, 09 Oct 2017 16:40:11 +0100
changeset 680854 128a046e3d97adfaa454ff3d36573571d898ba37
parent 680853 e1d6eb435c74772ff6d9f639c5877badf1061fc5
child 680855 d7011dca867526a107124442103babbfdcd919db
push id84656
push userbmo:ato@sny.no
push dateMon, 16 Oct 2017 14:02:26 +0000
reviewerswhimboo
bugs1400256
milestone58.0a1
Bug 1400256 - Use web element references in action tests. r?whimboo MozReview-Commit-ID: 2D3PdriqjYz
testing/marionette/test_action.js
--- a/testing/marionette/test_action.js
+++ b/testing/marionette/test_action.js
@@ -2,17 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {utils: Cu} = Components;
 
 Cu.import("chrome://marionette/content/action.js");
-Cu.import("chrome://marionette/content/element.js");
+const {ContentWebElement} = Cu.import("chrome://marionette/content/element.js", {});
 Cu.import("chrome://marionette/content/error.js");
 
 action.inputStateMap = new Map();
 
 add_test(function test_createAction() {
   Assert.throws(() => new action.Action(), InvalidArgumentError,
       "Missing Action constructor args");
   Assert.throws(() => new action.Action(1, 2), InvalidArgumentError,
@@ -117,17 +117,17 @@ add_test(function test_processPointerMov
   }
 
   run_next_test();
 });
 
 add_test(function test_processPointerMoveActionElementOrigin() {
   let actionSequence = {type: "pointer", id: "some_id"};
   let actionItem = {duration: 5000, type: "pointerMove"};
-  actionItem.origin = {[element.Key]: "something"};
+  actionItem.origin = {[ContentWebElement.Identifier]: "something"};
   let a = action.Action.fromJSON(actionSequence, actionItem);
   deepEqual(a.origin, actionItem.origin);
   run_next_test();
 });
 
 add_test(function test_processPointerMoveActionDefaultOrigin() {
   let actionSequence = {type: "pointer", id: "some_id"};
   // origin left undefined
@@ -145,17 +145,17 @@ add_test(function test_processPointerMov
       type: "pointerMove",
       origin: undefined,
       x: undefined,
       y: undefined,
     },
     {
       duration: undefined,
       type: "pointerMove",
-      origin: {[element.Key]: "id", [element.LegacyKey]: "id"},
+      origin: {[ContentWebElement.Identifier]: "id", [ContentWebElement.LegacyKey]: "id"},
       x: undefined,
       y: undefined,
     },
     {
       duration: 5000,
       type: "pointerMove",
       x: 0,
       y: undefined,