| # 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 |
| from validators import * |
| |
| # originally generated gestures: |
| # FlingStop |
| # Scroll d=594.8 x=46 y=553 r=7.387 s=367.1 |
| # Fling d=630 x=21.6 y=629.6 r=0 s=5.773e+04 |
| |
| def Validate(raw, events, gestures): |
| fuzzy = FuzzyCheck() |
| fuzzy.expected = [ |
| ScrollValidator("= 251.7 ~ 25.0", merge=True), |
| FlingValidator() |
| ] |
| fuzzy.unexpected = [ |
| FlingStopValidator("<10"), |
| ] |
| return fuzzy.Check(gestures) |