Bug 1392318 - Use fromJSON convention in action module. r?automatedtester draft
authorAndreas Tolfsen <ato@sny.no>
Mon, 21 Aug 2017 18:00:31 +0100
changeset 652936 4b9fadc0e6b7509f872c61186c5e3a0bccd7d265
parent 652924 b6b8e616de32af50c9a174006b3a7ed914130aa5
child 728243 d61d47c46fbd01c8ed610a35506e7d7a4a8385d4
push id76220
push userbmo:ato@sny.no
push dateFri, 25 Aug 2017 13:32:12 +0000
reviewersautomatedtester
bugs1392318
milestone57.0a1
Bug 1392318 - Use fromJSON convention in action module. r?automatedtester The convention is to use fromJSON (instead of fromJson) because this gives parity to toJSON which is supported by JSON.stringify. MozReview-Commit-ID: 9dX14pFO2Bj
testing/marionette/action.js
testing/marionette/listener.js
testing/marionette/test_action.js
--- a/testing/marionette/action.js
+++ b/testing/marionette/action.js
@@ -452,17 +452,17 @@ class InputState {
    *
    * @return {action.InputState}
    *     An {@link InputState} object for the type of the
    *     {@link actionSequence}.
    *
    * @throws {InvalidArgumentError}
    *     If {@link actionSequence.type} is not valid.
    */
-  static fromJson(obj) {
+  static fromJSON(obj) {
     let type = obj.type;
     assert.in(type, ACTIONS, pprint`Unknown action type: ${type}`);
     let name = type == "none" ? "Null" : capitalize(type);
     if (name == "Pointer") {
       if (!obj.pointerType &&
           (!obj.parameters || !obj.parameters.pointerType)) {
         throw new InvalidArgumentError(
             pprint`Expected obj to have pointerType, got ${obj}`);
@@ -669,33 +669,33 @@ action.Action = class {
    *     An action that can be dispatched; corresponds to |actionItem|.
    *
    * @throws {InvalidArgumentError}
    *     If any <code>actionSequence</code> or <code>actionItem</code>
    *     attributes are invalid.
    * @throws {UnsupportedOperationError}
    *     If <code>actionItem.type</code> is {@link action.PointerCancel}.
    */
-  static fromJson(actionSequence, actionItem) {
+  static fromJSON(actionSequence, actionItem) {
     let type = actionSequence.type;
     let id = actionSequence.id;
     let subtypes = ACTIONS[type];
     if (!subtypes) {
       throw new InvalidArgumentError("Unknown type: " + type);
     }
     let subtype = actionItem.type;
     if (!subtypes.has(subtype)) {
       throw new InvalidArgumentError(
           `Unknown subtype for ${type} action: ${subtype}`);
     }
 
     let item = new action.Action(id, type, subtype);
     if (type === "pointer") {
       action.processPointerAction(id,
-          action.PointerParameters.fromJson(actionSequence.parameters), item);
+          action.PointerParameters.fromJSON(actionSequence.parameters), item);
     }
 
     switch (item.subtype) {
       case action.KeyUp:
       case action.KeyDown:
         let key = actionItem.value;
         // TODO countGraphemes
         // TODO key.value could be a single code point like "\uE012"
@@ -758,31 +758,31 @@ action.Chain = class extends Array {
     return `[chain ${super.toString()}]`;
   }
 
   /**
    * @param {Array.<?>} actions
    *     Array of objects that each represent an action sequence.
    *
    * @return {action.Chain}
-   *     Transpose of |actions| such that actions to be performed in a
-   *     single tick are grouped together.
+   *     Transpose of <var>actions</var> such that actions to be performed
+   *     in a single tick are grouped together.
    *
    * @throws {InvalidArgumentError}
-   *     If |actions| is not an Array.
+   *     If <var>actions</var> is not an Array.
    */
-  static fromJson(actions) {
+  static fromJSON(actions) {
     assert.array(actions,
         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);
+      // TODO(maja_zf): Check that each actionSequence in actions refers
+      // to a different input ID.
+      let inputSourceActions = action.Sequence.fromJSON(actionSequence);
       for (let i = 0; i < inputSourceActions.length; i++) {
         // new tick
         if (actionsByTick.length < (i + 1)) {
           actionsByTick.push([]);
         }
         actionsByTick[i].push(inputSourceActions[i]);
       }
     }
@@ -802,43 +802,46 @@ action.Sequence = class extends Array {
   /**
    * @param {Object.<string, ?>} actionSequence
    *     Object that represents a sequence action items for one input source.
    *
    * @return {action.Sequence}
    *     Sequence of actions that can be dispatched.
    *
    * @throws {InvalidArgumentError}
-   *     If |actionSequence.id| is not a string or it's aleady mapped
-   *     to an |action.InputState} incompatible with |actionSequence.type|.
-   *     If |actionSequence.actions| is not an Array.
+   *     If <code>actionSequence.id</code> is not a
+   *     string or it's aleady mapped to an |action.InputState}
+   *     incompatible with <code>actionSequence.type</code>, or if
+   *     <code>actionSequence.actions</code> is not an <code>Array</code>.
    */
-  static fromJson(actionSequence) {
+  static fromJSON(actionSequence) {
     // used here to validate 'type' in addition to InputState type below
-    let inputSourceState = InputState.fromJson(actionSequence);
+    let inputSourceState = InputState.fromJSON(actionSequence);
     let id = actionSequence.id;
     assert.defined(id, "Expected 'id' to be defined");
     assert.string(id, pprint`Expected 'id' to be a string, got ${id}`);
     let actionItems = actionSequence.actions;
     assert.array(
         actionItems,
         "Expected 'actionSequence.actions' to be an array, " +
         pprint`got ${actionSequence.actions}`);
 
     if (!action.inputStateMap.has(id)) {
       action.inputStateMap.set(id, inputSourceState);
     } else if (!action.inputStateMap.get(id).is(inputSourceState)) {
       throw new InvalidArgumentError(
           `Expected ${id} to be mapped to ${inputSourceState}, ` +
           `got ${action.inputStateMap.get(id)}`);
     }
+
     let actions = new action.Sequence();
     for (let actionItem of actionItems) {
-      actions.push(action.Action.fromJson(actionSequence, actionItem));
+      actions.push(action.Action.fromJSON(actionSequence, actionItem));
     }
+
     return actions;
   }
 };
 
 /**
  * Represents parameters in an action for a pointer input source.
  *
  * @param {string=} pointerType
@@ -856,38 +859,40 @@ action.PointerParameters = class {
 
   /**
    * @param {Object.<string, ?>} parametersData
    *     Object that represents pointer parameters.
    *
    * @return {action.PointerParameters}
    *     Validated pointer paramters.
    */
-  static fromJson(parametersData) {
+  static fromJSON(parametersData) {
     if (typeof parametersData == "undefined") {
       return new action.PointerParameters();
     }
     return new action.PointerParameters(parametersData.pointerType);
   }
 };
 
 /**
- * Adds |pointerType| attribute to Action |act|. Helper function
- * for |action.Action.fromJson|.
+ * Adds <var>pointerType</var> attribute to Action <var>act</var>.
+ *
+ * Helper function for {@link action.Action.fromJSON}.
  *
  * @param {string} id
  *     Input source ID.
  * @param {action.PointerParams} pointerParams
  *     Input source pointer parameters.
  * @param {action.Action} act
  *     Action to be updated.
  *
  * @throws {InvalidArgumentError}
- *     If |id| is already mapped to an |action.InputState| that is
- *     not compatible with |act.type| or |pointerParams.pointerType|.
+ *     If <var>id</var> is already mapped to an
+ *     {@link action.InputState} that is not compatible with
+ *     <code>act.type</code> or <code>pointerParams.pointerType</code>.
  */
 action.processPointerAction = function(id, pointerParams, act) {
   if (action.inputStateMap.has(id) &&
       action.inputStateMap.get(id).type !== act.type) {
     throw new InvalidArgumentError(
         `Expected 'id' ${id} to be mapped to InputState whose type is ` +
         action.inputStateMap.get(id).type +
         pprint` , got ${act.type}`);
--- a/testing/marionette/listener.js
+++ b/testing/marionette/listener.js
@@ -931,17 +931,17 @@ function createATouch(el, corx, cory, to
 /**
  * Perform a series of grouped actions at the specified points in time.
  *
  * @param {obj} msg
  *      Object with an |actions| attribute that is an Array of objects
  *      each of which represents an action sequence.
  */
 async function performActions(msg) {
-  let chain = action.Chain.fromJson(msg.actions);
+  let chain = action.Chain.fromJSON(msg.actions);
   await action.dispatch(chain, seenEls, curContainer.frame);
 }
 
 /**
  * The release actions command is used to release all the keys and pointer
  * buttons that are currently depressed. This causes events to be fired
  * as if the state was released by an explicit series of actions. It also
  * clears all the internal state of the virtual devices.
--- a/testing/marionette/test_action.js
+++ b/testing/marionette/test_action.js
@@ -21,123 +21,123 @@ add_test(function test_createAction() {
       () => new action.Action(1, 2, "sometype"), /Expected string/, "Non-string arguments.");
   ok(new action.Action("id", "sometype", "sometype"));
 
   run_next_test();
 });
 
 add_test(function test_defaultPointerParameters() {
   let defaultParameters = {pointerType: action.PointerType.Mouse};
-  deepEqual(action.PointerParameters.fromJson(), defaultParameters);
+  deepEqual(action.PointerParameters.fromJSON(), defaultParameters);
 
   run_next_test();
 });
 
 add_test(function test_processPointerParameters() {
   let check = (regex, message, arg) => checkErrors(
-      regex, action.PointerParameters.fromJson, [arg], message);
+      regex, action.PointerParameters.fromJSON, [arg], message);
   let parametersData;
   for (let d of ["foo", "", "get", "Get"]) {
     parametersData = {pointerType: d};
     let message = `parametersData: [pointerType: ${parametersData.pointerType}]`;
     check(/Unknown pointerType/, message, parametersData);
   }
   parametersData.pointerType = "mouse"; //TODO "pen";
-  deepEqual(action.PointerParameters.fromJson(parametersData),
+  deepEqual(action.PointerParameters.fromJSON(parametersData),
       {pointerType: "mouse"}); //TODO action.PointerType.Pen});
 
   run_next_test();
 });
 
 add_test(function test_processPointerUpDownAction() {
   let actionItem = {type: "pointerDown"};
   let actionSequence = {type: "pointer", id: "some_id"};
   for (let d of [-1, "a"]) {
     actionItem.button = d;
     checkErrors(
-        /Expected 'button' \(.*\) to be >= 0/, action.Action.fromJson, [actionSequence, actionItem],
+        /Expected 'button' \(.*\) to be >= 0/, action.Action.fromJSON, [actionSequence, actionItem],
         `button: ${actionItem.button}`);
   }
   actionItem.button = 5;
-  let act = action.Action.fromJson(actionSequence, actionItem);
+  let act = action.Action.fromJSON(actionSequence, actionItem);
   equal(act.button, actionItem.button);
 
   run_next_test();
 });
 
 add_test(function test_validateActionDurationAndCoordinates() {
   let actionItem = {};
   let actionSequence = {id: "some_id"};
   let check = function (type, subtype, message = undefined) {
     message = message || `duration: ${actionItem.duration}, subtype: ${subtype}`;
     actionItem.type = subtype;
     actionSequence.type = type;
     checkErrors(/Expected '.*' \(.*\) to be >= 0/,
-        action.Action.fromJson, [actionSequence, actionItem], message);
+        action.Action.fromJSON, [actionSequence, actionItem], message);
   };
   for (let d of [-1, "a"]) {
     actionItem.duration = d;
     check("none", "pause");
     check("pointer", "pointerMove");
   }
   actionItem.duration = 5000;
   for (let name of ["x", "y"]) {
     actionItem[name] = "a";
     actionItem.type = "pointerMove";
     actionSequence.type = "pointer";
     checkErrors(/Expected '.*' \(.*\) to be an Integer/,
-        action.Action.fromJson, [actionSequence, actionItem],
+        action.Action.fromJSON, [actionSequence, actionItem],
         `duration: ${actionItem.duration}, subtype: pointerMove`);
   }
   run_next_test();
 });
 
 add_test(function test_processPointerMoveActionOriginValidation() {
   let actionSequence = {type: "pointer", id: "some_id"};
   let actionItem = {duration: 5000, type: "pointerMove"};
   for (let d of [-1, {a: "blah"}, []]) {
     actionItem.origin = d;
 
     checkErrors(/Expected \'origin\' to be a string or a web element reference/,
-        action.Action.fromJson,
+        action.Action.fromJSON,
         [actionSequence, actionItem],
         `actionItem.origin: (${getTypeString(d)})`);
   }
 
   run_next_test();
 });
 
 add_test(function test_processPointerMoveActionOriginStringValidation() {
   let actionSequence = {type: "pointer", id: "some_id"};
   let actionItem = {duration: 5000, type: "pointerMove"};
   for (let d of ["a", "", "get", "Get"]) {
     actionItem.origin = d;
     checkErrors(/Unknown pointer-move origin/,
-        action.Action.fromJson,
+        action.Action.fromJSON,
         [actionSequence, actionItem],
         `actionItem.origin: ${d}`);
   }
 
   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"};
-  let a = action.Action.fromJson(actionSequence, actionItem);
+  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
   let actionItem = {duration: 5000, type: "pointerMove"};
-  let a = action.Action.fromJson(actionSequence, actionItem);
+  let a = action.Action.fromJSON(actionSequence, actionItem);
   deepEqual(a.origin, action.PointerOrigin.Viewport);
   run_next_test();
 });
 
 add_test(function test_processPointerMoveAction() {
   let actionSequence = {id: "some_id", type: "pointer"};
   let actionItems = [
     {
@@ -165,17 +165,17 @@ add_test(function test_processPointerMov
       duration: 5000,
       type: "pointerMove",
       x: 1,
       y: 2,
       origin: undefined,
     },
   ];
   for (let expected of actionItems) {
-    let actual = action.Action.fromJson(actionSequence, expected);
+    let actual = action.Action.fromJSON(actionSequence, expected);
     ok(actual instanceof action.Action);
     equal(actual.duration, expected.duration);
     equal(actual.x, expected.x);
     equal(actual.y, expected.y);
 
     let origin = expected.origin;
     if (typeof origin == "undefined") {
       origin = action.PointerOrigin.Viewport;
@@ -253,17 +253,17 @@ add_test(function test_processPointerAct
       duration: 2000,
     },
     {
       type: "pointerUp",
       button: 1,
     }
   ];
   for (let expected of actionItems) {
-    let actual = action.Action.fromJson(actionSequence, expected);
+    let actual = action.Action.fromJSON(actionSequence, expected);
     equal(actual.type, actionSequence.type);
     equal(actual.subtype, expected.type);
     equal(actual.id, actionSequence.id);
     if (expected.type === "pointerUp") {
       equal(actual.button, expected.button);
     } else {
       equal(actual.duration, expected.duration);
     }
@@ -275,72 +275,72 @@ add_test(function test_processPointerAct
   run_next_test();
 });
 
 add_test(function test_processPauseAction() {
   let actionItem = {type: "pause", duration: 5000};
   let actionSequence = {id: "some_id"};
   for (let type of ["none", "key", "pointer"]) {
     actionSequence.type = type;
-    let act = action.Action.fromJson(actionSequence, actionItem);
+    let act = action.Action.fromJSON(actionSequence, actionItem);
     ok(act instanceof action.Action);
     equal(act.type, type);
     equal(act.subtype, actionItem.type);
     equal(act.id, actionSequence.id);
     equal(act.duration, actionItem.duration);
   }
   actionItem.duration = undefined;
-  let act = action.Action.fromJson(actionSequence, actionItem);
+  let act = action.Action.fromJSON(actionSequence, actionItem);
   equal(act.duration, actionItem.duration);
 
   run_next_test();
 });
 
 add_test(function test_processActionSubtypeValidation() {
   let actionItem = {type: "dancing"};
   let actionSequence = {id: "some_id"};
   let check = function (regex) {
     let message = `type: ${actionSequence.type}, subtype: ${actionItem.type}`;
-    checkErrors(regex, action.Action.fromJson, [actionSequence, actionItem], message);
+    checkErrors(regex, action.Action.fromJSON, [actionSequence, actionItem], message);
   };
   for (let type of ["none", "key", "pointer"]) {
     actionSequence.type = type;
     check(new RegExp(`Unknown subtype for ${type} action`));
   }
   run_next_test();
 });
 
 add_test(function test_processKeyActionUpDown() {
   let actionSequence = {type: "key", id: "some_id"};
   let actionItem = {type: "keyDown"};
 
   for (let v of [-1, undefined, [], ["a"], {length: 1}, null]) {
     actionItem.value = v;
     let message = `actionItem.value: (${getTypeString(v)})`;
-    Assert.throws(() => action.Action.fromJson(actionSequence, actionItem),
+    Assert.throws(() => action.Action.fromJSON(actionSequence, actionItem),
         InvalidArgumentError, message);
-    Assert.throws(() => action.Action.fromJson(actionSequence, actionItem),
+    Assert.throws(() => action.Action.fromJSON(actionSequence, actionItem),
         /Expected 'value' to be a string that represents single code point/, message);
   }
 
   actionItem.value = "\uE004";
-  let act = action.Action.fromJson(actionSequence, actionItem);
+  let act = action.Action.fromJSON(actionSequence, actionItem);
   ok(act instanceof action.Action);
   equal(act.type, actionSequence.type);
   equal(act.subtype, actionItem.type);
   equal(act.id, actionSequence.id);
   equal(act.value, actionItem.value);
 
   run_next_test();
 });
 
 add_test(function test_processInputSourceActionSequenceValidation() {
   let actionSequence = {type: "swim", id: "some id"};
   let check = (message, regex) => checkErrors(
-      regex, action.Sequence.fromJson, [actionSequence], message);
+      regex, action.Sequence.fromJSON, [actionSequence], message);
   check(`actionSequence.type: ${actionSequence.type}`, /Unknown action type/);
   action.inputStateMap.clear();
 
   actionSequence.type = "none";
   actionSequence.id = -1;
   check(`actionSequence.id: ${getTypeString(actionSequence.id)}`,
       /Expected 'id' to be a string/);
   action.inputStateMap.clear();
@@ -363,17 +363,17 @@ add_test(function test_processInputSourc
   let actionItem = { type: "pause", duration: 5};
   let actionSequence = {
     type: "none",
     id: "some id",
     actions: [actionItem],
   };
   let expectedAction = new action.Action(actionSequence.id, "none", actionItem.type);
   expectedAction.duration = actionItem.duration;
-  let actions = action.Sequence.fromJson(actionSequence);
+  let actions = action.Sequence.fromJSON(actionSequence);
   equal(actions.length, 1);
   deepEqual(actions[0], expectedAction);
   action.inputStateMap.clear();
   run_next_test();
 });
 
 add_test(function test_processInputSourceActionSequencePointer() {
   let actionItem = {type: "pointerDown", button: 1};
@@ -384,34 +384,34 @@ add_test(function test_processInputSourc
     parameters: {
       pointerType: "mouse" // TODO "pen"
     },
   };
   let expectedAction = new action.Action(
       actionSequence.id, actionSequence.type, actionItem.type);
   expectedAction.pointerType = actionSequence.parameters.pointerType;
   expectedAction.button = actionItem.button;
-  let actions = action.Sequence.fromJson(actionSequence);
+  let actions = action.Sequence.fromJSON(actionSequence);
   equal(actions.length, 1);
   deepEqual(actions[0], expectedAction);
   action.inputStateMap.clear();
   run_next_test();
 });
 
 add_test(function test_processInputSourceActionSequenceKey() {
   let actionItem = {type: "keyUp", value: "a"};
   let actionSequence = {
     type: "key",
     id: "9",
     actions: [actionItem],
   };
   let expectedAction = new action.Action(
       actionSequence.id, actionSequence.type, actionItem.type);
   expectedAction.value = actionItem.value;
-  let actions = action.Sequence.fromJson(actionSequence);
+  let actions = action.Sequence.fromJSON(actionSequence);
   equal(actions.length, 1);
   deepEqual(actions[0], expectedAction);
   action.inputStateMap.clear();
   run_next_test();
 });
 
 
 add_test(function test_processInputSourceActionSequenceInputStateMap() {
@@ -419,22 +419,22 @@ add_test(function test_processInputSourc
   let actionItem = {type: "pause", duration: 5000};
   let actionSequence = {
     type: "key",
     id: id,
     actions: [actionItem],
   };
   let wrongInputState = new action.InputState.Null();
   action.inputStateMap.set(actionSequence.id, wrongInputState);
-  checkErrors(/to be mapped to/, action.Sequence.fromJson, [actionSequence],
+  checkErrors(/to be mapped to/, action.Sequence.fromJSON, [actionSequence],
       `${actionSequence.type} using ${wrongInputState}`);
   action.inputStateMap.clear();
   let rightInputState = new action.InputState.Key();
   action.inputStateMap.set(id, rightInputState);
-  let acts = action.Sequence.fromJson(actionSequence);
+  let acts = action.Sequence.fromJSON(actionSequence);
   equal(acts.length, 1);
   action.inputStateMap.clear();
   run_next_test();
 });
 
 add_test(function test_processPointerActionInputStateMap() {
   let actionItem = {type: "pointerDown"};
   let id = "1";
@@ -484,39 +484,39 @@ add_test(function test_createInputState(
   Assert.throws(() => new action.InputState.Pointer("foo"), InvalidArgumentError,
       "Invalid InputState.Pointer constructor arg");
   run_next_test();
 });
 
 add_test(function test_extractActionChainValidation() {
   for (let actions of [-1, "a", undefined, null]) {
     let message = `actions: ${getTypeString(actions)}`;
-    Assert.throws(() => action.Chain.fromJson(actions),
+    Assert.throws(() => action.Chain.fromJSON(actions),
         InvalidArgumentError, message);
-    Assert.throws(() => action.Chain.fromJson(actions),
+    Assert.throws(() => action.Chain.fromJSON(actions),
         /Expected 'actions' to be an array/, message);
   }
   run_next_test();
 });
 
 add_test(function test_extractActionChainEmpty() {
-  deepEqual(action.Chain.fromJson([]), []);
+  deepEqual(action.Chain.fromJSON([]), []);
   run_next_test();
 });
 
 add_test(function test_extractActionChain_oneTickOneInput() {
   let actionItem = {type: "pause", duration: 5000};
   let actionSequence = {
     type: "none",
     id: "some id",
     actions: [actionItem],
   };
   let expectedAction = new action.Action(actionSequence.id, "none", actionItem.type);
   expectedAction.duration = actionItem.duration;
-  let actionsByTick = action.Chain.fromJson([actionSequence]);
+  let actionsByTick = action.Chain.fromJSON([actionSequence]);
   equal(1, actionsByTick.length);
   equal(1, actionsByTick[0].length);
   deepEqual(actionsByTick, [[expectedAction]]);
   action.inputStateMap.clear();
   run_next_test();
 });
 
 add_test(function test_extractActionChain_twoAndThreeTicks() {
@@ -552,29 +552,29 @@ add_test(function test_extractActionChai
       value: "a",
     },
   ];
   let keyActionSequence = {
     type: "key",
     id: "1",
     actions: keyActionItems,
   };
-  let actionsByTick = action.Chain.fromJson([keyActionSequence, mouseActionSequence]);
+  let actionsByTick = action.Chain.fromJSON([keyActionSequence, mouseActionSequence]);
   // number of ticks is same as longest action sequence
   equal(keyActionItems.length, actionsByTick.length);
   equal(2, actionsByTick[0].length);
   equal(2, actionsByTick[1].length);
   equal(1, actionsByTick[2].length);
   let expectedAction = new action.Action(keyActionSequence.id, "key", keyActionItems[2].type);
   expectedAction.value = keyActionItems[2].value;
   deepEqual(actionsByTick[2][0], expectedAction);
   action.inputStateMap.clear();
 
   // one empty action sequence
-  actionsByTick = action.Chain.fromJson(
+  actionsByTick = action.Chain.fromJSON(
       [keyActionSequence, {type: "none", id: "some", actions: []}]);
   equal(keyActionItems.length, actionsByTick.length);
   equal(1, actionsByTick[0].length);
   action.inputStateMap.clear();
   run_next_test();
 });
 
 add_test(function test_computeTickDuration() {