PointerEvents/TestAssertions

From W3C Wiki
Jump to: navigation, search

Test Assertions for Pointer Events

This page documents the test assertions for the Pointer Events specification [1].

Test Assertions for PointerEvent Interface

Assertion Test Status
1.1 For any PointerEvent object, each of the attributes must exist. ArtB created tests (may want to use idlharness.js instead)
1.2 For any PointerEvent object, each of the attributes must be of the specified data type. ArtB created tests (may want to use idlharness.js instead)
1.3 If a pointer event is initiated by a mouse device, then pointerType must be "mouse". Microsoft created tests
1.4 If a pointer event is initiated by a pen input device, then pointerType must be "pen". Microsoft created tests
1.5 If a pointer event is initiated by a touch input device, then pointerType must be "touch". Microsoft created tests
1.6 The value of pressure must be between 0 and 1 (inclusive). Scott González created tests
1.7 If pointerType is "mouse" and buttons is 0, then pressure must be 0. Scott González created tests
1.8 If pointerType is "mouse" and buttons > 0, then pressure must be 0.5. Scott González created tests
1.9 If pointerType is "mouse", tiltX must be 0. Scott González created tests
1.10 If pointerType is "mouse", tiltY must be 0. Scott González created tests
1.11 If pointerType is "mouse", then pointerId must be 1. Scott González created tests
1.12 If pointerType is not "mouse", then pointerId must not be 1. Scott González created tests
1.13 If pointerType is "mouse", then isPrimary must be true. Scott González created tests

Test Assertions for pointerdown events

Assertion Test Status
2.1 If the input device is a mouse and the device transitions from no buttons depressed to at least one button depressed, the pointerdown event must be dispatched. Scott González created tests
2.2 If the input device is touch and the device makes physical contact with the digitizer, the pointerdown event must be dispatched. Scott González created tests
2.3 If the input device is pen and the device makes physical contact with the digitizer, the pointerdown event must be dispatched. Scott González created tests
2.4 For input devices that do not support hover, a pointerover event must precede the pointerdown event. Furthermore, the pointerType and isPrimary attributes of the pointerover event must be the same as the respective attributes of the corresponding pointerdown event. Scott González created tests
2.x If pointerType is "touch" and no other active pointers representing touch input exists, then isPrimary must be true.
2.x If pointerType is "touch" and some other active pointers representing touch input exist, then isPrimary must be false.
2.x If pointerType is "pen" and no other active pointers representing pen input exists, then isPrimary must be true.
2.x If pointerType is "pen" and some other active pointers representing pen input exist, then isPrimary must be false.

Test Assertions for pointerup events

Assertion Test Status
3.1 The pointerType attribute of a pointerup event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute. Shruti Malugu created tests

Microsoft created tests

3.2 The isPrimary attribute of a pointerup event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute. Shruti Malugu created tests

Microsoft created tests

3.3 If the input device is a mouse and the device transitions from at least one button depressed to no buttons depressed, the pointerup event must be dispatched . Shruti Malugu created tests

Microsoft created tests

3.4 If the input device is touch and physical contact is removed from the digitizer, the pointerup event must be dispatched. Shruti Malugu created tests

Microsoft created tests

3.5 If the input device is pen and the pen is removed from physical contact with the digitizer, the pointerup event must be dispatched. Shruti Malugu created tests

Microsoft created tests

3.6 For input devices that do not support hover, a pointerout event must follow the pointerup event. Furthermore, the pointerType and isPrimary attributes of the pointerout must be the same as the respective attributes of the corresponding pointerup event. Shruti Malugu created tests
3.7 If the setPointerCapture method has been invoked on the pointer specified by pointerId, and the releasePointerCapture method has not been invoked, a lostpointercapture event must be dispatched to the element on which the setPointerCapture method was invoked. Furthermore, subsequent events for the specified pointer must follow normal hit testing mechanisms for determining the event target.

Test Assertions for pointercancel events

Assertion Test Status
4.1 The pointerType attribute of a pointercancel event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute. Satyajit Malugu created tests

Microsoft created tests

4.2 The isPrimary attribute of a pointercancel event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute. Satyajit Malugu created tests

Microsoft created tests

4.3 The pointercancel event must be followed by a pointerout event. Furthermore, the pointerType and isPrimary attributes of the pointerout must be the same as the respective attributes of the corresponding pointercancel event. Satyajit Malugu created tests
4.4 If the setPointerCapture method has been invoked on the pointer specified by pointerId, and the releasePointerCapture method has not been invoked, a lostpointercapture event must be dispatched to the element on which the setPointerCapture method was invoked. Furthermore, subsequent events for the specified pointer must follow normal hit testing mechanisms for determining the event target.

Test Assertions for pointermove events

Assertion Test Status
5.1 The pointerType attribute of a pointermove event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
5.2 The isPrimary attribute of a pointermove event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute. Microsoft created tests
5.3 When a pointer changes coordinates, the pointermove event must be dispatched.
5.4 When a pointer changes button state, the pointermove event must be dispatched.
5.5 When a pointer changes pressure, the pointermove event must be dispatched.
5.6 When a pointer changes tilt (tiltX, tiltY), the pointermove event must be dispatched.
5.7 When a pointer changes contact geometry (width, height), the pointermove event must be dispatched.
5.8 If pointerType is "mouse" and no mouse button is depressed, then the button attribute of the pointermove event must be -1 and the buttons attribute must be 0.

Test Assertions for pointerover events

Assertion Test Status
6.1 When a pointing device is moved into the hit test boundaries of an element, the pointerover event must be dispatched. Microsoft created tests

Test Assertions for pointerout events

Assertion Test Status
7.1 When a pointing device is moved out of the hit test boundaries of an element, the pointerout event must be dispatched. PR-2

Microsoft created tests

7.2 When a pen stylus leaves the hover range detectable by the digitizer, the pointerout event must be dispatched.
7.3 Pointer Events interface supported.
7.4 When a mouse passes through dispatches one event.
7.5 When touch, a device that does not support hover, after firing the pointerup event the pointerout event must be dispatched. PR-2
7.6 After firing the pointercancel event the pointerout event must be dispatched. PR-2
7.7 When a pen stylus leaves the hover range detectable by the digitizer the pointerout event must be dispatched.

Test Assertions for pointerenter events

Assertion Test Status
8.1 When a pointing device is moved into the hit test boundaries of an element or one of its descendants, the pointerover event must be dispatched. Microsoft created tests
8.1.1 When a pointing device that does not support hover is moved into the hit test boundaries of an element or one of its descendants as a result of a pointerdown event, the pointerenter event must be dispatched. Microsoft created tests
8.2 The pointerenter event must not bubble up to parent elements. Microsoft created tests

Test Assertions for pointerleave events

Assertion Test Status
9.1 When a pointing device is moved off of the hit test boundaries of an element and all of its descendants, the pointerleave event must be dispatched.
9.1.1 When a pointing device that supports hover leaves the range of the digitizer while over an element, the pointerleave event must be dispatched. Microsoft created tests
9.1.2 When a pointing device that does not support hover (such as a finger) leaves the hit test boundaries as a result of a pointerup event, the pointerleave event must be dispatched. Microsoft created tests
9.1.3 When a pointing device that has continuous position (such as a mouse) leaves the hit test boundaries of an element, the pointerleave event must be dispatched. Microsoft created tests
9.2 The pointerleave event must not be dispatched when the pointer enters a child element without leaving the hit test boundaries of the parent. (as distinct from pointerout)
9.3 The pointerleave event must not bubble up to parent elements. Microsoft created tests

Test Assertions for gotpointercapture events

Assertion Test Status
10.1 After pointer capture is set for a pointer, and prior to dispatching the first event for the pointer, the gotpointercapture event must be dispatched to the element that is receiving the pointer capture. Microsoft created tests

Test Assertions for lostpointercapture events

Assertion Test Status
11.1 After pointer capture is released for a pointer, and prior to any subsequent events for the pointer, the lostpointercapture event must be dispatched to the element from which pointer capture was removed.

Test Assertions for PointerEvent constructor

Assertion Test Status
12.1 A PointerEvent created with a PointerEvent constructor must have all its attributes set to the corresponding values provided to the constructor. For attributes where values are not provided to the constructor, the corresponding default values must be used.

Test Assertions for setPointerCapture

Assertion Test Status
13.1 When the setPointerCapture method is invoked, if the provided pointerId value does not match any of the active pointers, a DOMException with the name InvalidPointerId must be thrown. Microsoft created tests
13.2 When the setPointerCapture method is invoked, if the specified pointer is not in active button state, then the method must have no effect on subsequent pointer events.
13.3 After invoking the setPointerCapture method on an element, subsequent pointer events for the specified pointer must be targeted at that element. Additionally, the relatedTarget property of all such pointer events must be set to null.

Test Assertions for releasePointerCapture

Assertion Test Status
14.1 After invoking the releasePointerCapture method on an element, subsequent events for the specified pointer must follow normal hit testing mechanisms for determining the event target. Microsoft created tests
14.2 Upon invocation of the releasePointerCapture method, if the provided pointerId value does not match any of the active pointers, a DOMException with the name InvalidPointerId must be thrown. Microsoft created tests

Test Assertions for touch-action CSS property

Assertion Test Status
15.1 With `touch-action: auto` on a swiped or click/dragged element, EITHER`pointerdown+(optional pointermove)+pointerup` OR `pointerdown+pointercancel` must be dispatched. dmethvin has written tests, Microsoft created tests
15.2 With `touch-action: none` on a swiped or click/dragged element, `pointerdown+(optional pointermove)+pointerup` must be dispatched. dmethvin has written tests, Microsoft created tests
15.3 With `touch-action: pan-x` on a swiped or click/dragged element, only panning on the x-axis should be possible. Microsoft created tests
15.4 With `touch-action: pan-y` on a swiped or click/dragged element, only panning in the y-axis should be possible. Microsoft created tests
15.5 T-A Processing Model: when a user touches an element, the effect of that touch is determined by the value of the touch-action property and the default touch behaviors on the element and its ancestors. Scrollable-Parent, Child: `auto`, Grand-Child: `none` Microsoft has created tests
15.6 T-A Processing Model: when a user touches an element, the effect of that touch is determined by the value of the touch-action property and the default touch behaviors on the element and its ancestors. Scrollable-Parent, Child: `pan-x`, Grand-Child: `pan-y` Microsoft has created tests
15.7 T-A Processing Model: to determine the effect of a touch, find the nearest ancestor (starting from the element itself) that has a default touch behavior. Parent: `none`, Scrollable-Child Microsoft has created tests
15.8 T-A Processing Model: when a user touches an element, the effect of that touch is determined by the value of the touch-action property and the default touch behaviors on the element and its ancestors. Scrollable-Parent: `none` Child: `auto` Microsoft has created tests
15.9 T-A Processing Model: when a user touches an element, the effect of that touch is determined by the value of the touch-action property and the default touch behaviors on the element and its ancestors. Scrollable-Parent, Child: `none` Microsoft has created tests