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 683313 d6a40344deebcf3529bda13b895af412924b73f2
parent 683312 e8e3450ce2047088c7354a885538a998648acab7
child 683314 07818bbb5ba78bb9281d86468e3b4bf08c414f9c
push id85331
push userbmo:ato@sny.no
push dateThu, 19 Oct 2017 14:55:23 +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,