public void testMultitouchEvents() throws InterruptedException {
  generateRecordedPinchTouchEvents();
  waitForBridgeAndUIIdle();
  List<String> calls=mRecordingModule.getCalls();
  int moveWithBothPointersEventIndex=-1;
  int startEventIndex=-1;
  int startExtraPointerEventIndex=-1;
  int endEventIndex=-1;
  int endExtraPointerEventIndex=-1;
  for (int i=0; i < calls.size(); i++) {
    String call=calls.get(i);
    if (call.equals("start;ExtraPointer")) {
      assertEquals(-1,startExtraPointerEventIndex);
      startExtraPointerEventIndex=i;
    }
 else     if (call.equals("end;ExtraPointer")) {
      assertEquals(-1,endExtraPointerEventIndex);
      endExtraPointerEventIndex=i;
    }
 else     if (call.equals("start;1")) {
      assertEquals(-1,startEventIndex);
      startEventIndex=i;
    }
 else     if (call.equals("end;0")) {
      assertEquals(-1,endEventIndex);
      endEventIndex=i;
    }
 else     if (call.equals("move;2")) {
      moveWithBothPointersEventIndex=i;
    }
  }
  assertEquals(0,startEventIndex);
  assertTrue(-1 != startExtraPointerEventIndex);
  assertTrue(-1 != moveWithBothPointersEventIndex);
  assertTrue(-1 != endExtraPointerEventIndex);
  assertTrue(startExtraPointerEventIndex < moveWithBothPointersEventIndex);
  assertTrue(endExtraPointerEventIndex > moveWithBothPointersEventIndex);
  assertEquals(calls.size() - 1,endEventIndex);
}

public void testMultitouchEvents ( ) throws InterruptedException { generateRecordedPinchTouchEvents ( ) ; waitForBridgeAndUIIdle ( ) ; List < String > calls = mRecordingModule . getCalls ( ) ; int moveWithBothPointersEventIndex = - 1 ; int startEventIndex = - 1 ; int startExtraPointerEventIndex = - 1 ; int endEventIndex = - 1 ; int endExtraPointerEventIndex = - 1 ; for ( int i = 0 ; i < calls . size ( ) ; i ++ ) { String call = calls . get ( i ) ; if ( call . equals ( "start;ExtraPointer" ) ) { assertEquals ( - 1 , startExtraPointerEventIndex ) ; startExtraPointerEventIndex = i ; } else if ( call . equals ( "end;ExtraPointer" ) ) { assertEquals ( - 1 , endExtraPointerEventIndex ) ; endExtraPointerEventIndex = i ; } else if ( call . equals ( "start;1" ) ) { assertEquals ( - 1 , startEventIndex ) ; startEventIndex = i ; } else if ( call . equals ( "end;0" ) ) { assertEquals ( - 1 , endEventIndex ) ; endEventIndex = i ; } else if ( call . equals ( "move;2" ) ) { moveWithBothPointersEventIndex = i ; } } assertEquals ( 0 , startEventIndex ) ; assertTrue ( - 1 != startExtraPointerEventIndex ) ; assertTrue ( - 1 != moveWithBothPointersEventIndex ) ; assertTrue ( - 1 != endExtraPointerEventIndex ) ; assertTrue ( startExtraPointerEventIndex < moveWithBothPointersEventIndex ) ; assertTrue ( endExtraPointerEventIndex > moveWithBothPointersEventIndex ) ; assertEquals ( calls . size ( ) - 1 , endEventIndex ) ; }
in this test case we send pre - recorded stream of pinch out gesture and verify that we have recorded important touch events in js module
