gecko-dev/accessible/tests/mochitest/jsat/gestures.json
Yura Zenevich b6f26535eb Bug 981015 - added a number of improvements to make the TouchAdapter(now called PointerAdapter) more reliable. Fixed and updated tests for stability. r=eeejay, marcoz
---
 accessible/src/jsat/AccessFu.jsm                   |   9 +-
 accessible/src/jsat/Gestures.jsm                   | 948 +++++++++++++++++++++
 accessible/src/jsat/PointerAdapter.jsm             | 210 +++++
 accessible/src/jsat/TouchAdapter.jsm               | 431 ----------
 accessible/src/jsat/Utils.jsm                      |  10 +
 accessible/src/jsat/moz.build                      |   3 +-
 accessible/tests/mochitest/jsat/a11y.ini           |   4 +-
 accessible/tests/mochitest/jsat/dom_helper.js      |  74 +-
 accessible/tests/mochitest/jsat/gestures.json      | 253 +++---
 ...ouch_adapter.html => test_gesture_tracker.html} |  42 +-
 .../tests/mochitest/jsat/test_pointer_relay.html   |  95 +++
 11 files changed, 1499 insertions(+), 580 deletions(-)
 create mode 100644 accessible/src/jsat/Gestures.jsm
 create mode 100644 accessible/src/jsat/PointerAdapter.jsm
 delete mode 100644 accessible/src/jsat/TouchAdapter.jsm
 rename accessible/tests/mochitest/jsat/{test_touch_adapter.html => test_gesture_tracker.html} (51%)
 create mode 100644 accessible/tests/mochitest/jsat/test_pointer_relay.html

--HG--
rename : accessible/tests/mochitest/jsat/test_touch_adapter.html => accessible/tests/mochitest/jsat/test_gesture_tracker.html
2014-04-11 10:30:37 -04:00

250 lines
9.6 KiB
JSON

[
{
"events": [
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 1, "y": 1, "identifier": 1}]}
],
"expectedGestures": "tap"
},
{
"events": [
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointermove",
"points": [{"x": 1.03, "y": 1.03, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 1.03, "y": 1.03, "identifier": 1}]}
],
"expectedGestures": "tap"
},
{
"events": [
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1}],
"removeDwellThreshold": true},
{"type": "pointerup", "points": [{"x": 1, "y": 1, "identifier": 1}]}
],
"expectedGestures": ["dwell", "dwellend"]
},
{
"events": [
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointermove",
"points": [{"x": 1.03, "y": 1.02, "identifier": 1}]},
{"type": "pointerup",
"points": [{"x": 1.03, "y": 1.02, "identifier": 1}]},
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointermove",
"points": [{"x": 0.97, "y": 1.01, "identifier": 1}]},
{"type": "pointerup",
"points": [{"x": 0.97, "y": 1.01, "identifier": 1}]}
],
"expectedGestures": ["tap", "doubletap"]
},
{
"events": [
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 1, "y": 1, "identifier": 1}]}
],
"expectedGestures": ["tap", "doubletap", "tripletap"]
},
{
"events": [
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1}],
"removeDwellThreshold": true},
{"type": "pointerup", "points": [{"x": 1, "y": 1, "identifier": 1}]}
],
"expectedGestures": ["tap", "doubletap", "doubletaphold",
"doubletapholdend"]
},
{
"events": [
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1}],
"removeDwellThreshold": true},
{"type": "pointerup", "points": [{"x": 1, "y": 1, "identifier": 1}]}
],
"expectedGestures": ["tap", "taphold", "tapholdend"]
},
{
"events": [
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointermove", "points": [{"x": 1.5, "y": 1, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 1.5, "y": 1, "identifier": 1}]}
],
"expectedGestures": "swiperight"
},
{
"events": [
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointermove", "points": [{"x": 1.15, "y": 1, "identifier": 1}]},
{"type": "pointermove", "points": [{"x": 1.3, "y": 1, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 1.3, "y": 1, "identifier": 1}]}
],
"expectedGestures": "swiperight"
},
{
"events": [
{"type": "pointerdown", "points": [{"x": 1.5, "y": 1, "identifier": 1}]},
{"type": "pointermove", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 1, "y": 1, "identifier": 1}]}
],
"expectedGestures": "swipeleft"
},
{
"events": [
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointermove", "points": [{"x": 1, "y": 1.5, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 1, "y": 1.5, "identifier": 1}]}
],
"expectedGestures": "swipedown"
},
{
"events": [
{"type": "pointerdown", "points": [{"x": 1, "y": 1.5, "identifier": 1}]},
{"type": "pointermove", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 1, "y": 1, "identifier": 1}]}
],
"expectedGestures": "swipeup"
},
{
"events": [
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointermove",
"points": [{"x": 1.5, "y": 1.1, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 1.5, "y": 1.1, "identifier": 1}]}
],
"expectedGestures": "swiperight"
},
{
"events": [
{"type": "pointerdown",
"points": [{"x": 1.5, "y": 1.1, "identifier": 1}]},
{"type": "pointermove", "points": [{"x": 1, "y": 0.95, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 1, "y": 0.95, "identifier": 1}]}
],
"expectedGestures": "swipeleft"
},
{
"events": [
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointermove",
"points": [{"x": 0.9, "y": 1.5, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 0.9, "y": 1.5, "identifier": 1}]}
],
"expectedGestures": "swipedown"
},
{
"events": [
{"type": "pointerdown",
"points": [{"x": 1.1, "y": 1.5, "identifier": 1}]},
{"type": "pointermove", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 1, "y": 1, "identifier": 1}]}
],
"expectedGestures": "swipeup"
},
{
"events": [
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1},
{"x": 1, "y": 1.5, "identifier": 2}]},
{"type": "pointermove", "points": [{"x": 1.5, "y": 1, "identifier": 1},
{"x": 1.5, "y": 1.5, "identifier": 2}]},
{"type": "pointerup", "points": [{"x": 1.5, "y": 1, "identifier": 1},
{"x": 1.5, "y": 1.5, "identifier": 2}]}
],
"expectedGestures": "swiperight"
},
{
"events": [
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1},
{"x": 1, "y": 1.5, "identifier": 2}]},
{"type": "pointermove", "points": [{"x": 1.5, "y": 1, "identifier": 1},
{"x": 1.5, "y": 1.5, "identifier": 2}]},
{"type": "pointerup", "points": [{"x": 1.5, "y": 1, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 1.5, "y": 1.5, "identifier": 2}]}
],
"expectedGestures": "swiperight"
},
{
"events": [
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1},
{"x": 1, "y": 1.5, "identifier": 2},
{"x": 1, "y": 2, "identifier": 3}]},
{"type": "pointermove", "points": [{"x": 1.5, "y": 1, "identifier": 1},
{"x": 1.5, "y": 1.5, "identifier": 2},
{"x": 1.5, "y": 2, "identifier": 3}]},
{"type": "pointerup", "points": [{"x": 1.5, "y": 1, "identifier": 1},
{"x": 1.5, "y": 1.5, "identifier": 2},
{"x": 1.5, "y": 2, "identifier": 3}]}
],
"expectedGestures": "swiperight"
},
{
"events": [
{"type": "pointerdown",
"points": [{"x": 1.6, "y": 1.5, "identifier": 1}],
"removeDwellThreshold": true},
{"type": "pointermove", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 1, "y": 1, "identifier": 1}]}
],
"expectedGestures": ["dwell", "explore", "exploreend"]
},
{
"events": [
{"type": "pointerdown",
"points": [{"x": 1.6, "y": 1.5, "identifier": 1}],
"removeDwellThreshold": true},
{"type": "pointermove", "points": [{"x": 1, "y": 1, "identifier": 1}]},
{"type": "pointermove", "points": [{"x": 2, "y": 2, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 2, "y": 2, "identifier": 1}]}
],
"expectedGestures": ["dwell", "explore", "explore", "exploreend"]
},
{
"events": [
{"type": "pointerdown",
"points": [{"x": 1.6, "y": 1.5, "identifier": 1}]},
{"type": "pointermove", "points": [{"x": 1, "y": 1, "identifier": 1}],
"removeSwipeMaxDuration": true},
{"type": "pointerup", "points": [{"x": 1, "y": 1, "identifier": 1}]}
],
"expectedGestures": ["explore", "exploreend"]
},
{
"events": [
{"type": "pointerdown", "points": [{"x": 1, "y": 1.5, "identifier": 1}]},
{"type": "pointermove", "points": [{"x": 1, "y": 1, "identifier": 1}],
"removeSwipeMaxDuration": true},
{"type": "pointermove", "points": [{"x": 1.5, "y": 1, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 1.5, "y": 1, "identifier": 1}]}
],
"expectedGestures": ["explore", "explore", "exploreend"]
},
{
"events": [
{"type": "pointerdown", "points": [{"x": 1, "y": 1, "identifier": 1}],
"removeDwellThreshold": true},
{"type": "pointermove",
"points": [{"x": 1.5, "y": 1.5, "identifier": 1}]},
{"type": "pointermove",
"points": [{"x": 1.55, "y": 1.5, "identifier": 1}]},
{"type": "pointermove",
"points": [{"x": 1.6, "y": 1.5, "identifier": 1}]},
{"type": "pointermove",
"points": [{"x": 1.65, "y": 1.5, "identifier": 1}]},
{"type": "pointermove",
"points": [{"x": 1.7, "y": 1.5, "identifier": 1}]},
{"type": "pointermove",
"points": [{"x": 1.75, "y": 1.5, "identifier": 1}]},
{"type": "pointerup", "points": [{"x": 1.75, "y": 1.5, "identifier": 1}]}
],
"expectedGestures": ["dwell", "explore", "explore", "exploreend"]
}
]