Fix cancellation of double tap gesture, add some unit tests

Change-Id: I79270fce42ff48df10cbba9f655631b33a2f3b2a