Bug 1337133 - Remove references to pen and touch in test_action.js; r?jgraham draft
authorMaja Frydrychowicz <mjzffr@gmail.com>
Wed, 22 Feb 2017 16:57:55 -0500
changeset 490015 aa12c04f031718cf5f6891d26003a3fa0a2f90d1
parent 490014 5c9bb060a305cb93f4876780be51c591d2e55c94
child 490016 a47b2b5ecdb4000f9198f29a053066f04aad6ffe
push id46970
push userbmo:mjzffr@gmail.com
push dateMon, 27 Feb 2017 14:54:25 +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",
     },
     {