Bug 1328726 - Style fix ups in Marionette key actions implementation. r=ato, a=test-only
authorMaja Frydrychowicz <mjzffr@gmail.com>
Wed, 04 Jan 2017 17:48:11 -0500
changeset 378808 a43ef146176a4ab0338d96de4d1218520ad52fc4
parent 378807 04b3d879b97a5b85e2309780243e9e9a9c6085cb
child 378809 d9e64da4d0419653bd6b4b22864e0a386f2702b4
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato, test-only
bugs1328726, 1320389
milestone53.0a2
Bug 1328726 - Style fix ups in Marionette key actions implementation. r=ato, a=test-only These are leftover from review of Bug 1320389. I must have forgotten to re-push to MozReview. MozReview-Commit-ID: ENTFdmCsv6I
testing/marionette/action.js
testing/marionette/assert.js
--- a/testing/marionette/action.js
+++ b/testing/marionette/action.js
@@ -667,17 +667,17 @@ action.Chain = class extends Array {
    *     Transpose of |actions| such that actions to be performed in a single tick
    *     are grouped together.
    *
    * @throws {InvalidArgumentError}
    *     If |actions| is not an Array.
    */
   static fromJson(actions) {
     assert.array(actions,
-              error.pprint`Expected 'actions' to be an Array, got: ${actions}`);
+        error.pprint`Expected 'actions' to be an Array, got: ${actions}`);
     let actionsByTick = new action.Chain();
     //  TODO check that each actionSequence in actions refers to a different input ID
     for (let actionSequence of actions) {
       let inputSourceActions = action.Sequence.fromJson(actionSequence);
       for (let i = 0; i < inputSourceActions.length; i++) {
         // new tick
         if (actionsByTick.length < (i + 1)) {
           actionsByTick.push([]);
@@ -1004,20 +1004,20 @@ function dispatchKeyUp(a, inputState, wi
  *     Action to dispatch.
  * @param {number} tickDuration
  *     Duration in milliseconds of this tick.
  *
  * @return {Promise}
  *     Promise that is resolved after the specified time interval.
  */
 function dispatchPause(a, tickDuration) {
-  const TIMER = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
+  const timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
   let duration = typeof a.duration == "undefined" ? tickDuration : a.duration;
   return new Promise(resolve =>
-      TIMER.initWithCallback(resolve, duration, Ci.nsITimer.TYPE_ONE_SHOT)
+      timer.initWithCallback(resolve, duration, Ci.nsITimer.TYPE_ONE_SHOT)
   );
 }
 
 // helpers
 /**
  * Force any pending DOM events to fire.
  *
  * @param {?} container
--- a/testing/marionette/assert.js
+++ b/testing/marionette/assert.js
@@ -267,17 +267,17 @@ assert.in = function (prop, obj, msg = "
  * @return {Object}
  *     |obj| is returned unaltered.
  *
  * @throws {InvalidArgumentError}
  *     If |obj| is not an Array.
  */
 assert.array = function (obj, msg = "") {
   msg = msg || error.pprint`Expected ${obj} to be an Array`;
-  return assert.that(o => Array.isArray(o), msg)(obj);
+  return assert.that(Array.isArray, msg)(obj);
 };
 
 /**
  * Returns a function that is used to assert the |predicate|.
  *
  * @param {function(?): boolean} predicate
  *     Evaluated on calling the return value of this function.  If its
  *     return value of the inner function is false, |error| is thrown