Bug 1400256 - Use web element references in action tests. r?whimboo
MozReview-Commit-ID: 2D3PdriqjYz
--- 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,