>># 
>># Copyright 1990, 1991 by the Massachusetts Institute of Technology and
>># UniSoft Group Limited.
>># 
>># Permission to use, copy, modify, distribute, and sell this software and
>># its documentation for any purpose is hereby granted without fee,
>># provided that the above copyright notice appear in all copies and that
>># both that copyright notice and this permission notice appear in
>># supporting documentation, and that the names of MIT and UniSoft not be
>># used in advertising or publicity pertaining to distribution of the
>># software without specific, written prior permission.  MIT and UniSoft
>># make no representations about the suitability of this software for any
>># purpose.  It is provided "as is" without express or implied warranty.
>># 
>># $XConsortium: mtnntfy.m,v 1.16 92/06/11 17:23:25 rws Exp $
>># 
>>#
>>TITLE MotionNotify CH08
>>ASSERTION A MotionNotify-1
When the pointer is moved and the pointer motion begins and
ends in the same window, then a MotionNotify event is
generated.
>>STRATEGY
Create client2.
Create window.
Move pointer to inside of window.
Set PointerMotionMask event mask bits on window.
Set PointerMotionMask event mask bits on window with client2.
Synthesize expected event.
Call XWarpPointer to move the pointer with motion beginning and
ending in window.
Verify that a MotionNotify event was received.
Verify event members.
Verify that only one MotionNotify event was received.
Verify that no other events were received.
Verify that a MotionNotify event was received by client2.
Verify event members for client2.
Verify that only one MotionNotify event was received.
Verify that no other events were received.
Call XWarpPointer to move the pointer multiple times with
motion beginning and ending in window.
Verify that multiple MotionNotify events were received.
Verify that no other events were received.
>>ASSERTION - MotionNotify-2
When a MotionNotify event is generated, then all clients
having set PointerMotionMask event mask bits on the event
window are delivered a MotionNotify event.
>>ASSERTION B MotionNotify-3
When a MotionNotify event is generated while pointer button
1 was pressed, then all clients having set Button1MotionMask
event mask bits on the event window are delivered a
MotionNotify event.
>>STRATEGY
If extended testing is required:
  Verify that at least one button is supported.
  Create a second client.
  Create a third client.
  Create a window.
  Select Button1MotionMask as the event mask for all clients.
  Simulate a Motion event with Button1 depressed on the window.
  Verify a MotionNotify event was generated for the first client.
  Verify that event member fields were correctly set.
  Verify a MotionNotify event was generated for the second client.
  Verify that event member fields were correctly set.
  Verify a MotionNotify event was generated for the third client.
  Verify that event member fields were correctly set.
>>ASSERTION D MotionNotify-4
When a MotionNotify event is generated while pointer button
2 was pressed, then all clients having set Button2MotionMask
event mask bits on the event window are delivered a
MotionNotify event.
>>STRATEGY
If extended testing is required:
  Verify that the server supports at least 2 buttons.
  Create a second client.
  Create a third client.
  Create a window.
  Select Button2MotionMask as the event mask for all clients.
  Simulate a Motion event with Button2 depressed on the window.
  Verify a MotionNotify event was generated for the first client.
  Verify that event member fields were correctly set.
  Verify a MotionNotify event was generated for the second client.
  Verify that event member fields were correctly set.
  Verify a MotionNotify event was generated for the third client.
  Verify that event member fields were correctly set.
>>ASSERTION D MotionNotify-5
When a MotionNotify event is generated while pointer button
3 was pressed, then all clients having set Button3MotionMask
event mask bits on the event window are delivered a
MotionNotify event.
>>STRATEGY
If extended testing is required:
  Verify that the server supports at least 3 buttons.
  Create a second client.
  Create a third client.
  Create a window.
  Select Button3MotionMask as the event mask for all clients.
  Simulate a Motion event with Button3 depressed on the window.
  Verify a MotionNotify event was generated for the first client.
  Verify that event member fields were correctly set.
  Verify a MotionNotify event was generated for the second client.
  Verify that event member fields were correctly set.
  Verify a MotionNotify event was generated for the third client.
  Verify that event member fields were correctly set.
>>ASSERTION D MotionNotify-6
When a MotionNotify event is generated while pointer button
4 was pressed, then all clients having set Button4MotionMask
event mask bits on the event window are delivered a
MotionNotify event.
>>STRATEGY
If extended testing is required:
  Verify that the server supports at least 4 buttons.
  Create a second client.
  Create a third client.
  Create a window.
  Select Button4MotionMask as the event mask for all clients.
  Simulate a Motion event with Button4 depressed on the window.
  Verify a MotionNotify event was generated for the first client.
  Verify that event member fields were correctly set.
  Verify a MotionNotify event was generated for the second client.
  Verify that event member fields were correctly set.
  Verify a MotionNotify event was generated for the third client.
  Verify that event member fields were correctly set.
>>ASSERTION D MotionNotify-7
When a MotionNotify event is generated while pointer button
5 was pressed, then all clients having set Button5MotionMask
event mask bits on the event window are delivered a
MotionNotify event.
>>STRATEGY
If extended testing is required:
  Verify that the server supports 5 buttons.
  Create a second client.
  Create a third client.
  Create a window.
  Select Button5MotionMask as the event mask for all clients.
  Simulate a Motion event with Button5 depressed on the window.
  Verify a MotionNotify event was generated for the first client.
  Verify that event member fields were correctly set.
  Verify a MotionNotify event was generated for the second client.
  Verify that event member fields were correctly set.
  Verify a MotionNotify event was generated for the third client.
  Verify that event member fields were correctly set.
>>ASSERTION B MotionNotify-8
When a MotionNotify event is generated while at least one
pointer button was pressed, then all clients having set
ButtonMotionMask event mask bits on the event window are
delivered a MotionNotify event.
>>STRATEGY
If extended testing is required:
  Verify that at least one button is supported.
  Create a second client.
  Create a third client.
  Create a window.
  Select ButtonMotionMask as the event mask for all clients.
  Simulate a Motion event with Button1 depressed on the window.
  Verify a MotionNotify event was generated for the first client.
  Verify that event member fields were correctly set.
  Verify a MotionNotify event was generated for the second client.
  Verify that event member fields were correctly set.
  Verify a MotionNotify event was generated for the third client.
  Verify that event member fields were correctly set.
>>ASSERTION B MotionNotify-9
When a MotionNotify event is generated and a client has
selected one or more of Button1MotionMask,
Button2MotionMask, Button3MotionMask, Button4MotionMask,
Button5MotionMask, ButtonMotionMask, or PointerMotionMask
event mask bits on the event window, then only one
MotionNotify event is delivered to that client.
>>STRATEGY
If extended testing is required:
  Verify that at least one button is supported.
  Create a window.
  Select all the motion masks on the window.
  Simulate a Motion event with Button1 depressed on the window.
  Check that only one of the possible events was generated.
  Simulate a Motion event with all buttons pressed.
  Check that only one of the possible events was generated.
>>ASSERTION B MotionNotify-10
When a MotionNotify event is generated, then clients not
having set Button1MotionMask, Button2MotionMask,
Button3MotionMask, Button4MotionMask, Button5MotionMask,
ButtonMotionMask, or PointerMotionMask event mask bits on
the event window, are not delivered a MotionNotify event.
>>STRATEGY
If extended testing is required:
  Verify that at least one button is supported.
  Create a second client.
  Create a window.
  Select for something on the second client.
  For each supported type of motion event :
    Select the mask as the event mask for the first client.
    Simulate the motion event.
    Verify that the first client received the appropriate event.
    Verify that the second client did not receive that event.
>>ASSERTION B MotionNotify-11
When a MotionNotify event is delivered with is_hint set to
NotifyHint, then clients which have set
PointerMotionHintMask and one or more of Button1MotionMask,
Button2MotionMask, Button3MotionMask, Button4MotionMask,
Button5MotionMask, ButtonMotionMask, or PointerMotionMask
event mask bits on the event window may not be delivered
another MotionNotify event until either the key or button
state changes, the pointer leaves the event window or the
client calls XQueryPointer or XGetMotionEvents.
>>STRATEGY
Report UNTESTED
>>ASSERTION - MotionNotify-12
When a MotionNotify event is generated, then all clients
which have not set PointerMotionHintMask and have set one or
more of Button1MotionMask, Button2MotionMask,
Button3MotionMask, Button4MotionMask, Button5MotionMask,
ButtonMotionMask, or PointerMotionMask event mask bits on
the event window are delivered a MotionNotify event with
is_hint set to NotifyNormal.
>>ASSERTION A MotionNotify-13
When a MotionNotify event is generated, then all clients
which have set PointerMotionHintMask and one or more of
Button1MotionMask, Button2MotionMask, Button3MotionMask,
Button4MotionMask, Button5MotionMask, ButtonMotionMask,
or PointerMotionMaskeventmaskbitsontheeventwindoware
delivered a MotionNotify event with is_hint set to
NotifyHint or NotifyNormal.
>>STRATEGY
Create client2.
Create window.
Move pointer to inside of window.
Set PointerMotionMask and PointerMotionHintMask event mask bits on window.
Set PointerMotionMask and PointerMotionHintMask event mask bits on window
with client2.
Synthesize expected event.
Call XWarpPointer to move the pointer with motion beginning and
ending in window.
Verify that a MotionNotify event was received.
Verify event members.
Verify that only one MotionNotify event was received.
Verify that no other events were received.
Verify that a MotionNotify event was received by client2.
Verify event members for client2.
Verify that only one MotionNotify event was received.
Verify that no other events were received.
>>ASSERTION B MotionNotify-14
When a MotionNotify event is generated and no client has
selected Button1MotionMask, Button2MotionMask,
Button3MotionMask, Button4MotionMask, Button5MotionMask,
ButtonMotionMask, or PointerMotionMask event mask bits on
the source window, then the event propagates, with
propagation stopping at the root window of the screen or at
the first window with Button1MotionMask, Button2MotionMask,
Button3MotionMask, Button4MotionMask, Button5MotionMask,
ButtonMotionMask, or PointerMotionMask event mask bits in
its do-not-propagate mask, from the source window to the
first ancestor window for which some client has selected for
MotionNotify events.
>>STRATEGY
If extended is required:
  Verify that at least one button is supported.
  For each supported type of motion event :
    Create a window.
    Create a child of that window.
    Create a grandchild of the window.
    Select MotionNotify events on the root window of the screen.
    Simulate a MotionNotify event on the grandchild.
    Verify that a MotionNotify event was generated on the root.
    Select MotionNotify events on the grandparent window.
    Set the do_not_propagate mask on the child to MotionNotify events.
    Simulate a MotionNotify event on the grandchild.
    Verify no MotionNotify event was generated on the grandchild.
    Verify no MotionNotify event was generated on the child.
    Verify no MotionNotify event was generated on the parent.
    Select MotionNotify events on the child window.
    Set the do_not_propagate mask of the child to NoEventMask.
    Simulate a MotionNotify event on the grandchild.
    Verify that no MotionNotify event was generated on the grandchild.
    Verify that no MotionNotify event was generated on the parent.
    Verify that a MotionNotify event was generated on the child.
>>ASSERTION A MotionNotify-15
When a MotionNotify event is delivered and the source
window is an inferior of the event window and the source
window is a child of the event window, then subwindow is set
to the source window.
>>STRATEGY
Create window hierarchy.
Create the hierarchy.
Move pointer to inside of window.
Select no events on the sourcew.
Set PointerMotionMask event mask bits on the eventw.
Call XWarpPointer to move the pointer with motion beginning and
ending in window.
Verify that a MotionNotify event was received.
Verify that subwindow is set to the source window.
>>ASSERTION A MotionNotify-16
When a MotionNotify event is delivered and the source
window is an inferior of the event window and the source
window is not a child of the event window, then subwindow is
set to the child of the event window that is an ancestor of
the source window.
>>STRATEGY
Create window hierarchy.
Create the hierarchy.
Move pointer to inside of window.
Select no events on the sourcew.
Set PointerMotionMask event mask bits on the eventw.
Call XWarpPointer to move the pointer with motion beginning and
ending in window.
Verify that a MotionNotify event was received.
Verify that subwindow is set to the source window.
>>ASSERTION - MotionNotify-17
When a MotionNotify event is delivered and the source
window is not an inferior of the event window, then
subwindow is set to None.
>>ASSERTION D MotionNotify-18
If multiple screens are supported: When a MotionNotify
event is delivered and the event and root windows are not on
the same screen, then x and y are set to zero.
>>STRATEGY
If multiple screens are supported:
  If extended testing is required:
    Create a window on the default screen.
    Create a window on the alternate screen.
    Grab the pointer asynchronously  for the first window selecting PointerMotion and ButtonMotion events.
    Generate a PointerMotion event on the alternate window.
    Verify that a PointerMotion event was generated with respect to the grabbing window.
    Verify that the x and y event components were zero.
    Generate a ButtonMotion mask on the alternate window.
    Verify that a ButtonMotion event was generated with respect to the grabbing window. 
    Verify that the x and y event components were zero.
>>ASSERTION D MotionNotify-19
If multiple screens are supported: When a MotionNotify
event is delivered and the event and root windows are not on
the same screen, then same_screen is set to False.
>>STRATEGY
If multiple screens are supported:
  If extended testing is required:
    Create a window on the default screen.
    Create a window on the alternate screen.
    Grab the pointer asynchronously  for the first window selecting PointerMotion and ButtonMotion events.
    Generate a PointerMotion event on the alternate window.
    Verify that a PointerMotion event was generated with respect to the grabbing window.
    Verify that same_screen event component was False.
    Generate a ButtonMotion event on the alternate window.
    Verify that a ButtonMotion event was generated with respect to the grabbing window.
    Verify that same_screen event component was False.
