Difference between revisions of "PointerEvents/TestAssertions"

From W3C Wiki
Jump to: navigation, search
(Test Assertions for Pointer Events)
(Test Assertions for Pointer Events)
Line 74: Line 74:
 
|-
 
|-
 
| 3.x
 
| 3.x
| The pointerType attribute of a pointerup event must has the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
+
| 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.
 
|-
 
|-
 
| 3.x
 
| 3.x
| The isPrimary attribute of a pointerup event must has the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
+
| 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.
 
|-
 
|-
 
|}
 
|}
Line 87: Line 87:
 
|-
 
|-
 
| 4.x
 
| 4.x
| The pointerType attribute of a pointercancel event must has the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
+
| 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.
 
|-
 
|-
 
| 4.x
 
| 4.x
| The isPrimary attribute of a pointercancel event must has the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
+
| 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.
 
|-
 
|-
 
|}
 
|}
Line 100: Line 100:
 
|-
 
|-
 
| 5.x
 
| 5.x
| If pointerType is "mouse" and no mouse button is pressed, then button must be -1 and buttons must be 0.
+
| 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.x
 
| 5.x
| The pointerType attribute of a pointermove event must has the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
+
| 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.
 
|-
 
|-
 
| 5.x
 
| 5.x
| The isPrimary attribute of a pointermove event must has the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
+
| If pointerType is "mouse" and no mouse button is pressed, then button must be -1 and buttons must be 0.
 
|-
 
|-
 
|}
 
|}
Line 116: Line 116:
 
|-
 
|-
 
| 6.x
 
| 6.x
| The pointerType attribute of a pointerover event must has the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
+
| The pointerType attribute of a pointerover event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
 
|-
 
|-
 
| 6.x
 
| 6.x
| The isPrimary attribute of a pointerover event must has the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
+
| The isPrimary attribute of a pointerover event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
 
|-
 
|-
 
|}
 
|}
Line 129: Line 129:
 
|-
 
|-
 
| 7.x
 
| 7.x
| The pointerType attribute of a pointerout event must has the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
+
| The pointerType attribute of a pointerout event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
 
|-
 
|-
 
| 7.x
 
| 7.x
| The isPrimary attribute of a pointerout event must has the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
+
| The isPrimary attribute of a pointerout event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
 
|-
 
|-
 
|}
 
|}
Line 142: Line 142:
 
|-
 
|-
 
| 8.x
 
| 8.x
| The pointerType attribute of a pointerenter event must has the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
+
| The pointerType attribute of a pointerenter event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
 
|-
 
|-
 
| 8.x
 
| 8.x
| The isPrimary attribute of a pointerenter event must has the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
+
| The isPrimary attribute of a pointerenter event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
 
|-
 
|-
 
|}
 
|}
Line 155: Line 155:
 
|-
 
|-
 
| 9.x
 
| 9.x
| The pointerType attribute of a pointerleave event must has the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
+
| The pointerType attribute of a pointerleave event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
 
|-
 
|-
 
| 9.x
 
| 9.x
| The isPrimary attribute of a pointerleave event must has the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
+
| The isPrimary attribute of a pointerleave event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
 
|-
 
|-
 
|}
 
|}

Revision as of 19:58, 25 March 2013

Test Assertions for Pointer Events

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

Test Assertions for PointerEvent Interface

Assertion
1.1 For any PointerEvent object, each of the attributes must exist.
1.2 For any PointerEvent object, each of the attributes must be of the specified data type.
1.3 If a pointer event is initiated by a mouse device, then pointerType must be "mouse".
1.4 If a pointer event is initiated by a pen input device, then pointerType must be "pen".
1.5 If a pointer event is initiated by a touch input device, then pointerType must be "touch".
1.6 The value of pressure must be between 0 and 1 (inclusive).
1.7 If pointerType is "mouse" and buttons is 0, then pressure must be 0.
1.8 If pointerType is "mouse" and buttons > 0, then pressure must be 0.5.
1.9 If pointerType is "mouse", tiltX must be 0.
1.10 If pointerType is "mouse", tiltY must be 0.
1.11 If pointerType is "mouse", then pointerId must be 1.
1.12 If pointerType is not "mouse", then pointerId must not be 1.
1.13 If pointerType is "mouse", then isPrimary must be true.

Test Assertions for pointerdown events

Assertion
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
3.x 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.
3.x 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.

Test Assertions for pointercancel events

Assertion
4.x 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.
4.x 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.

Test Assertions for pointermove events

Assertion
5.x 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.x 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.
5.x If pointerType is "mouse" and no mouse button is pressed, then button must be -1 and buttons must be 0.

Test Assertions for pointerover events

Assertion
6.x The pointerType attribute of a pointerover event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
6.x The isPrimary attribute of a pointerover event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.

Test Assertions for pointerout events

Assertion
7.x The pointerType attribute of a pointerout event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
7.x The isPrimary attribute of a pointerout event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.

Test Assertions for pointerenter events

Assertion
8.x The pointerType attribute of a pointerenter event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
8.x The isPrimary attribute of a pointerenter event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.

Test Assertions for pointerleave events

Assertion
9.x The pointerType attribute of a pointerleave event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
9.x The isPrimary attribute of a pointerleave event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.

Test Assertions for gotpointercapture events

Assertion
10.x

Test Assertions for lostpointercapture events

Assertion
11.x