| # 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 __future__ import absolute_import | |
| from __future__ import division | |
| from __future__ import print_function | |
| from fuzzy_check import FuzzyCheck | |
| from validators import * | |
| # originally generated gestures: | |
| # FlingStop | |
| # Motion d=428.9 x=355.1 y=203.8 r=3.168 s=542.7 | |
| # Motion d=0.2979 x=0 y=0.2979 r=5.551e-17 s=27.62 | |
| def Validate(raw, events, gestures): | |
| fuzzy = FuzzyCheck() | |
| fuzzy.expected = [ | |
| MotionValidator("> 465~50", merge=True), | |
| ] | |
| fuzzy.unexpected = [ | |
| FlingStopValidator("<10"), | |
| ] | |
| return fuzzy.Check(gestures) |