Bug 1337133 - Remove references to pen and touch in test_action.js; r=jgraham
authorMaja Frydrychowicz <mjzffr@gmail.com>
Wed, 22 Feb 2017 16:57:55 -0500
changeset 490201 b2fc3f9520fe5e12ee55ac71bb29a0fa39e3c6b3
parent 490200 6d895016018647064a2edc78836b97ea0b6dfc27
child 490202 aba48a32380e0c1fffd26dee09b2eb7970ac0b29
push id47030
push userbmo:ttromey@mozilla.com
push dateMon, 27 Feb 2017 20:32:32 +0000
reviewersjgraham
bugs1337133
milestone54.0a1
Bug 1337133 - Remove references to pen and touch in test_action.js; r=jgraham Pen and touch support will be added this quarter. MozReview-Commit-ID: GH7CVNoDOIm
testing/marionette/test_action.js
--- a/testing/marionette/test_action.js
+++ b/testing/marionette/test_action.js
@@ -35,19 +35,19 @@ add_test(function test_processPointerPar
   let check = (regex, message, arg) => checkErrors(
       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 = "pen";
+  parametersData.pointerType = "mouse"; //TODO "pen";
   deepEqual(action.PointerParameters.fromJson(parametersData),
-      {pointerType: action.PointerType.Pen});
+      {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"]) {
@@ -183,17 +183,17 @@ add_test(function test_processPointerMov
   run_next_test();
 });
 
 add_test(function test_processPointerAction() {
   let actionSequence = {
     type: "pointer",
     id: "some_id",
     parameters: {
-      pointerType: "touch"
+      pointerType: "mouse" //TODO "touch"
     },
   };
   let actionItems = [
     {
       duration: 2000,
       type: "pause",
     },
     {
@@ -320,17 +320,17 @@ add_test(function test_processInputSourc
 
 add_test(function test_processInputSourceActionSequencePointer() {
   let actionItem = {type: "pointerDown", button: 1};
   let actionSequence = {
     type: "pointer",
     id: "9",
     actions: [actionItem],
     parameters: {
-      pointerType: "pen"
+      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);
   equal(actions.length, 1);
@@ -384,23 +384,24 @@ add_test(function test_processPointerAct
   let wrongInputState = new action.InputState.Key();
   action.inputStateMap.set(id, wrongInputState);
   checkErrors(
       /to be mapped to InputState whose type is/, action.processPointerAction,
       [id, parameters, a],
       `type "pointer" with ${wrongInputState.type} in inputState`);
   action.inputStateMap.clear();
 
-  wrongInputState = new action.InputState.Pointer("pen");
-  action.inputStateMap.set(id, wrongInputState);
-  checkErrors(
-      /to be mapped to InputState whose subtype is/, action.processPointerAction,
-      [id, parameters, a],
-      `subtype ${parameters.pointerType} with ${wrongInputState.subtype} in inputState`);
-  action.inputStateMap.clear();
+  // TODO - uncomment once pen is supported
+  //wrongInputState = new action.InputState.Pointer("pen");
+  //action.inputStateMap.set(id, wrongInputState);
+  //checkErrors(
+  //    /to be mapped to InputState whose subtype is/, action.processPointerAction,
+  //    [id, parameters, a],
+  //    `subtype ${parameters.pointerType} with ${wrongInputState.subtype} in inputState`);
+  //action.inputStateMap.clear();
 
   let rightInputState = new action.InputState.Pointer("mouse");
   action.inputStateMap.set(id, rightInputState);
   action.processPointerAction(id, parameters, a);
   action.inputStateMap.clear();
   run_next_test();
 });
 
@@ -469,17 +470,17 @@ add_test(function test_extractActionChai
       button: 2,
     },
   ];
   let mouseActionSequence = {
     type: "pointer",
     id: "7",
     actions: mouseActionItems,
     parameters: {
-      pointerType: "touch"
+      pointerType: "mouse" //TODO "touch"
     },
   };
   let keyActionItems = [
     {
       type: "keyDown",
       value: "a",
     },
     {