From dbfee71802ae7075325cf9639701c7bcf33390b4 Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Wed, 3 Feb 2016 19:25:28 +0000 Subject: [PATCH] Bug 1245153 - Rename actions.js to action.js; r=automatedtester MozReview-Commit-ID: 58v7aMH2deS --- testing/marionette/{actions.js => action.js} | 22 ++++++++++---------- testing/marionette/driver.js | 4 ++-- testing/marionette/event.js | 2 +- testing/marionette/jar.mn | 2 +- testing/marionette/listener.js | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) rename testing/marionette/{actions.js => action.js} (95%) diff --git a/testing/marionette/actions.js b/testing/marionette/action.js similarity index 95% rename from testing/marionette/actions.js rename to testing/marionette/action.js index c5db838dd09..c74d667bde1 100644 --- a/testing/marionette/actions.js +++ b/testing/marionette/action.js @@ -12,16 +12,16 @@ Cu.import("chrome://marionette/content/event.js"); const CONTEXT_MENU_DELAY_PREF = "ui.click_hold_context_menus.delay"; const DEFAULT_CONTEXT_MENU_DELAY = 750; // ms -this.EXPORTED_SYMBOLS = ["actions"]; +this.EXPORTED_SYMBOLS = ["action"]; const logger = Log.repository.getLogger("Marionette"); -this.actions = {}; +this.action = {}; /** * Functionality for (single finger) action chains. */ -actions.Chain = function(checkForInterrupted) { +action.Chain = function(checkForInterrupted) { // for assigning unique ids to all touches this.nextTouchId = 1000; // keep track of active Touches @@ -47,7 +47,7 @@ actions.Chain = function(checkForInterrupted) { this.inputSource = null; }; -actions.Chain.prototype.dispatchActions = function( +action.Chain.prototype.dispatchActions = function( args, touchId, container, @@ -105,7 +105,7 @@ actions.Chain.prototype.dispatchActions = function( * @param {Object} modifiers * An object of modifier keys present. */ -actions.Chain.prototype.emitMouseEvent = function( +action.Chain.prototype.emitMouseEvent = function( doc, type, elClientX, @@ -147,7 +147,7 @@ actions.Chain.prototype.emitMouseEvent = function( /** * Reset any persisted values after a command completes. */ -actions.Chain.prototype.resetValues = function() { +action.Chain.prototype.resetValues = function() { this.onSuccess = null; this.onError = null; this.container = null; @@ -163,7 +163,7 @@ actions.Chain.prototype.resetValues = function() { * keyModifiers is an object keeping track keyDown/keyUp pairs through * an action chain. */ -actions.Chain.prototype.actions = function(chain, touchId, i, keyModifiers) { +action.Chain.prototype.actions = function(chain, touchId, i, keyModifiers) { if (i == chain.length) { this.onSuccess(touchId || null); this.resetValues(); @@ -323,7 +323,7 @@ actions.Chain.prototype.actions = function(chain, touchId, i, keyModifiers) { * Y coordinate relative to target. If unspecified, the centre of * the target is used. */ -actions.Chain.prototype.coordinates = function(target, x, y) { +action.Chain.prototype.coordinates = function(target, x, y) { let box = target.getBoundingClientRect(); if (x == null) { x = box.width / 2; @@ -341,7 +341,7 @@ actions.Chain.prototype.coordinates = function(target, x, y) { * Given an element and a pair of coordinates, returns an array of the * form [clientX, clientY, pageX, pageY, screenX, screenY]. */ -actions.Chain.prototype.getCoordinateInfo = function(el, corx, cory) { +action.Chain.prototype.getCoordinateInfo = function(el, corx, cory) { let win = el.ownerDocument.defaultView; return [ corx, // clientX @@ -361,7 +361,7 @@ actions.Chain.prototype.getCoordinateInfo = function(el, corx, cory) { * Y coordinate of the location to generate the event that is relative * to the viewport. */ -actions.Chain.prototype.generateEvents = function( +action.Chain.prototype.generateEvents = function( type, x, y, touchId, target, keyModifiers) { this.lastCoordinates = [x, y]; let doc = this.container.frame.document; @@ -494,7 +494,7 @@ actions.Chain.prototype.generateEvents = function( this.checkForInterrupted(); }; -actions.Chain.prototype.mouseTap = function(doc, x, y, button, count, mod) { +action.Chain.prototype.mouseTap = function(doc, x, y, button, count, mod) { this.emitMouseEvent(doc, "mousemove", x, y, button, count, mod); this.emitMouseEvent(doc, "mousedown", x, y, button, count, mod); this.emitMouseEvent(doc, "mouseup", x, y, button, count, mod); diff --git a/testing/marionette/driver.js b/testing/marionette/driver.js index a308b553e3e..c56416ed50a 100644 --- a/testing/marionette/driver.js +++ b/testing/marionette/driver.js @@ -23,7 +23,7 @@ this.DevToolsUtils = devtools.require("devtools/shared/DevToolsUtils"); XPCOMUtils.defineLazyServiceGetter( this, "cookieManager", "@mozilla.org/cookiemanager;1", "nsICookieManager2"); -Cu.import("chrome://marionette/content/actions.js"); +Cu.import("chrome://marionette/content/action.js"); Cu.import("chrome://marionette/content/atom.js"); Cu.import("chrome://marionette/content/interaction.js"); Cu.import("chrome://marionette/content/element.js"); @@ -133,7 +133,7 @@ this.GeckoDriver = function(appName, device, stopSignal, emulator) { this.oopFrameId = null; this.observing = null; this._browserIds = new WeakMap(); - this.actions = new actions.Chain(); + this.actions = new action.Chain(); this.sessionCapabilities = { // mandated capabilities diff --git a/testing/marionette/event.js b/testing/marionette/event.js index f54e1be45d0..4abbeb32ff7 100644 --- a/testing/marionette/event.js +++ b/testing/marionette/event.js @@ -160,7 +160,7 @@ event.sendKey = function(key, window = undefined) { event.synthesizeKey(keyName, {shiftKey: false}, window); }; -// TODO(ato): Unexpose this when actions.Chain#emitMouseEvent +// TODO(ato): Unexpose this when action.Chain#emitMouseEvent // no longer emits its own events event.parseModifiers_ = function(event) { let mval = 0; diff --git a/testing/marionette/jar.mn b/testing/marionette/jar.mn index a54c0e7862b..2864cc4a838 100644 --- a/testing/marionette/jar.mn +++ b/testing/marionette/jar.mn @@ -6,7 +6,7 @@ marionette.jar: % content marionette %content/ content/server.js (server.js) content/driver.js (driver.js) - content/actions.js (actions.js) + content/action.js (action.js) content/interaction.js (interaction.js) content/accessibility.js (accessibility.js) content/listener.js (listener.js) diff --git a/testing/marionette/listener.js b/testing/marionette/listener.js index e52a7b8d5af..cc11b3c8029 100644 --- a/testing/marionette/listener.js +++ b/testing/marionette/listener.js @@ -13,7 +13,7 @@ var loader = Cc["@mozilla.org/moz/jssubscript-loader;1"] loader.loadSubScript("chrome://marionette/content/simpletest.js"); loader.loadSubScript("chrome://marionette/content/common.js"); -Cu.import("chrome://marionette/content/actions.js"); +Cu.import("chrome://marionette/content/action.js"); Cu.import("chrome://marionette/content/atom.js"); Cu.import("chrome://marionette/content/capture.js"); Cu.import("chrome://marionette/content/cookies.js"); @@ -45,7 +45,7 @@ var elementManager = new ElementManager([]); var capabilities = {}; var interactions = new Interactions(() => capabilities); -var actions = new actions.Chain(checkForInterrupted); +var actions = new action.Chain(checkForInterrupted); var importedScripts = null; // Contains the last file input element that was the target of