blob: e67d771690b94e360f1842b8d2e39a0e1d3ba945 [file] [log] [blame]
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from fuzzy_check import FuzzyCheck
import mtlib.gesture_log
from validators import *
def Validate(raw, events, gestures):
fuzzy = FuzzyCheck()
# Most important thing about this test: make sure that we don't get any motion
# after the original finger departs
for gs in gestures:
if isinstance(gs, mtlib.gesture_log.MotionGesture):
if gs.end > 699.14048:
return False, ('Error: Move end time is too late: %f' % gs.end)
fuzzy.expected = [
MotionValidator(merge=True),
ButtonDownValidator(1),
MotionValidator(merge=True),
ButtonUpValidator(1),
]
fuzzy.unexpected = [
FlingStopValidator("<10"),
]
return fuzzy.Check(gestures)