>># 
>># 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: allwevnts.m,v 1.7 92/06/11 17:11:03 rws Exp $
>># 
>>#      SCCS:  @(#)  EVal.mc Rel 1.5	    (10/10/91)
>>#
>>TITLE XAllowEvents CH07
>>ASSERTION A XAllowEvents-1
When the specified time is earlier than the last-grab time
of the most recent active grab for the client or later than
the current X server time, then a call to XAllowEvents has
no effect.
>>STRATEGY
Grab and freeze pointer with a given time.
Call XAllowEvents with earlier time and AsyncPointer.
Verify that the pointer is still frozen.
Get current server time.
Call XAllowEvents with a later time.
Verify that the pointer is still frozen.
>>ASSERTION A XAllowEvents-2
When the event_mode argument is AsyncPointer and the
pointer is frozen by the client, then pointer event
processing is resumed.
>>STRATEGY
Freeze pointer.
Call XAllowEvents with event_mode AsyncPointer.
Verify that pointer is not frozen.
>>ASSERTION A XAllowEvents-3
When the event_mode argument is AsyncPointer and the
pointer is frozen twice by the client on behalf of two
separate grabs, then a call to XAllowEvents thaws for both
grabs.
>>STRATEGY
Freeze pointer with XGrabPointer.
Freeze pointer with XGrabKeyboard.
Call XAllowEvents with event_mode AsyncPointer.
Verify that pointer is not frozen.
>>ASSERTION A XAllowEvents-4
When the event_mode argument is AsyncPointer and the
pointer is not frozen by the client, then a call to
XAllowEvents has no effect.
>>STRATEGY
Call XAllowEvents with event_mode AsyncPointer.
Verify pointer is not frozen.
>>ASSERTION B XAllowEvents-5
When the event_mode argument is SyncPointer and the pointer
is frozen and actively grabbed by the client, then pointer
event processing is resumed normally until the next
ButtonPress or ButtonRelease event is reported to the
client, at which time the pointer again appears to freeze,
unless the reported event causes the pointer grab to be
released.
>>STRATEGY
Grab and freeze the pointer.
Call XAllowEvents with event_mode SyncPointer.
Verify that pointer is not frozen.
If test extension available:
  Press a button.
  Verify that the pointer is frozen.
>>ASSERTION A XAllowEvents-6
When the event_mode argument is SyncPointer and the pointer
is not frozen by the client or the pointer is not grabbed by
the client, then a call to XAllowEvents has no effect.
>>STRATEGY
Call XAllowEvents with event_mode SyncPointer.
Verify pointer is not frozen.
>>ASSERTION A XAllowEvents-7
When the event_mode argument is SyncPointer and the pointer
is frozen twice by the client on behalf of two separate
grabs, then a call to XAllowEvents thaws for both grabs.
>>STRATEGY
Freeze pointer with XGrabPointer.
Freeze pointer with XGrabKeyboard.
Call XAllowEvents with event_mode SyncPointer.
Verify that pointer is not frozen.
>>ASSERTION B XAllowEvents-8
When the event_mode argument is ReplayPointer and the
pointer is actively grabbed by the client and is frozen as
the result of an event having been sent to the client, then
the pointer grab is released and the event is completely
reprocessed as though any passive grabs at or above the grab
window of the grab just released were not present.
>>STRATEGY
Touch test for replay pointer.
If extensions are available:
  Create window.
  Create child of this window.
  Set passive grabs on both these windows.
  Warp pointer into child window.
  Press button to activate the grab.
  Check that parent window has the grab.
  Set event_mode to ReplayPointer.
  Call XAllowEvents.
  Verify that the child window now has the grab.
>>ASSERTION A XAllowEvents-9
When the event_mode argument is ReplayPointer and the
pointer is not frozen as a result of an event or the pointer
is not grabbed by the client, then a call to XAllowEvents
has no effect.
>>STRATEGY
Call XAllowEvents with event_mode ReplayPointer.
Verify pointer is not frozen.
>>ASSERTION B XAllowEvents-10
When the event_mode argument is ReplayPointer and the
pointer is frozen twice by the client on behalf of two
separate grabs, then a call to XAllowEvents thaws for both
grabs.
>>STRATEGY
If extensions are available:
  Freeze pointer with XGrabKeyboard.
  Set up passive grab.
  Freeze pointer by activating grab with a button press.
  Call XAllowEvents with event_mode of ReplayPointer.
  Verify that pointer was released.
>>ASSERTION B XAllowEvents-11
When the event_mode argument is AsyncKeyboard and the
keyboard is frozen by the client, then keyboard event
processing is resumed.
>>STRATEGY
If no extensions:
  Touch test for AsyncKeyboard.
else
  Grab and freeze Keyboard.
  Call XAllowEvents with event_mode AsyncKeyboard.
  Verify that the keyboard is released.
>>ASSERTION B XAllowEvents-12
When the event_mode argument is AsyncKeyboard and the
keyboard is frozen twice by the client on behalf of two
separate grabs, then a call to XAllowEvents thaws for both.
>>STRATEGY
If extensions available:
  Freeze keyboard with XGrabPointer.
  Freeze keyboard with XGrabKeyboard.
  Call XAllowEvents with AsyncKeyboard.
  Verify that keyboard is released.
>>ASSERTION B XAllowEvents-13
When the event_mode argument is AsyncKeyboard and the
keyboard is not frozen by the client, then a call to
XAllowEvents has no effect.
>>STRATEGY
If extensions available:
  Call XAllowEvents with AsyncKeyboard.
  Verify that keyboard is not frozen.
>>ASSERTION B XAllowEvents-14
When the event_mode argument is SyncKeyboard and the
keyboard is frozen and actively grabbed by the client, then
keyboard event processing is resumed normally until the next
KeyPress or KeyRelease event is reported to the client, at
which time the keyboard again appears to freeze unless the
reported event causes the keyboard grab to be released.
>>STRATEGY
If no extensions:
  Touch test for SyncKeyboard.
else
  Freeze keyboard.
  Call XAllowEvents with event_mode of SyncKeyboard.
  Verify that keyboard is not frozen.
  Press key.
  Verify that keyboard is frozen.
>>ASSERTION B XAllowEvents-15
When the event_mode argument is SyncKeyboard and the
keyboard is not frozen by the client or the keyboard is not
grabbed by the client, then a call to XAllowEvents has no
effect.
>>STRATEGY
If extensions available:
  Call XAllowEvents with event_mode of SyncKeyboard.
  Verify that keyboard is not frozen.
  Press key.
  Verify that keyboard is not frozen.
>>ASSERTION B XAllowEvents-16
When the event_mode argument is SyncKeyboard and the
keyboard is frozen twice by the client on behalf of two
separate grabs, then a call to XAllowEvents thaws for both
grabs.
>>STRATEGY
If extensions available:
  Freeze keyboard with XGrabPointer.
  Freeze keyboard with XGrabKeyboard.
  Call XAllowEvents with event_mode of SyncKeyboard.
  Verify that keyboard is not frozen.
>>ASSERTION B XAllowEvents-17
When the event_mode argument is ReplayKeyboard and the
keyboard is actively grabbed by the client and is frozen as
the result of an event having been sent to the client, then
the keyboard grab is released and the event is completely
reprocessed as though any passive grabs at or above the grab
window of the grab just released were not present.
>>STRATEGY
If no extensions:
  Touch test for ReplayKeyboard.
else
  Create window.
  Create child of that window.
  Enable key events on windows.
  Place passive grab with GrabModeSync on each window.
  Warp pointer to child window.
  Press key.
  Check that the parent window has the grab.

  Call XAllowEvents with ReplayKeyboard.
  Verify that child window has grab.
>>ASSERTION B XAllowEvents-18
When the event_mode argument is ReplayKeyboard and the
keyboard is not frozen as a result of an event or the
keyboard is not grabbed by the client, then a call to
XAllowEvents has no effect.
>>STRATEGY
If extensions available:
  Create window.
  Create child of that window.
  Place passive grab with GrabModeAsync on each window.
  Warp pointer to child window.
  Press key.
  Check that the parent window has the grab.

  Call XAllowEvents with ReplayKeyboard.
  Verify that no key event was received on the child.
>>ASSERTION B XAllowEvents-19
When the event_mode argument is ReplayKeyboard and the
keyboard is frozen twice by the client on behalf of two
separate grabs, then a call to XAllowEvents thaws for both
grabs.
>>STRATEGY
If extensions available:
  Freeze keyboard with XGrabButton.
  Freeze keyboard with XGrabKey.
  Call XAllowEvents with event_mode of ReplayKeyboard.
  Verify that keyboard is not frozen.
>>ASSERTION B XAllowEvents-20
When the event_mode argument is SyncBoth and both pointer
and keyboard are frozen by the client, then event processing
for both devices continues normally until the next
ButtonPress, ButtonRelease, KeyPress, or KeyRelease event
is reported to the client for a grabbed device at which time
both devices again appear to freeze, unless the reported
event causes the grab to be released.
>>STRATEGY
If no extensions:
  Touch test for SyncBoth.
else
  Create grabwindow.
  Select events on grab window.
  Freeze and grab pointer by calling XGrabPointer.
  Freeze and grab keyboard by calling XGrabKeyboard.
  Check that pointer is frozen.

  Call XAllowEvents with event_mode of SyncBoth.
  Verify that pointer has been released.

  Press button.
  Verify that pointer is frozen.
  Verify that keyboard is frozen.

  Call XAllowEvents with event_mode of SyncBoth.
  Check pointer released.
  Release button.
  Verify that pointer is frozen.
  Verify that keyboard is frozen.

  Call XAllowEvents with event_mode of SyncBoth.
  Check pointer released.
  Press key.
  Verify that pointer is frozen.
  Verify that keyboard is frozen.

  Call XAllowEvents with event_mode of SyncBoth.
  Check pointer released.
  Release key.
  Verify that pointer is frozen.
  Verify that keyboard is frozen.
>>ASSERTION B XAllowEvents-21
When the event_mode argument is SyncBoth and an event has
caused the grab on one device to be released and a
subsequent event is reported for the other device that does
not cause the grab to be released, then both devices are
again frozen.
>>STRATEGY
If extension available:
  Grab and freeze Keyboard with XGrabKeyboard.
  Set passive grab on button with pointer_mode GrabModeSync.
  Activate pointer grab.

  Call XAllowEvents with event_mode SyncBoth.
  Release button to release pointer grab.
  Check pointer not frozen.

  Press key.
  Verify that pointer and keyboard are frozen.
>>ASSERTION B XAllowEvents-22
When the event_mode argument is SyncBoth and the pointer or
keyboard is frozen twice by the client on behalf of two
separate grabs, then a call to XAllowEvents thaws for both
grabs.
>>STRATEGY
If extensions are available:
  Grab and freeze pointer.
  Grab keyboard and freeze pointer.

  Call XAllowEvents with event_mode of SyncBoth.
  Verify that pointer and keyboard are thawed.
>>ASSERTION B XAllowEvents-23
When the event_mode argument is SyncBoth and either the
keyboard or pointer is not frozen by the client or neither
are grabbed by the client, then a call to XAllowEvents has
no effect.
>>STRATEGY
If extensions available:
  Call XAllowEvents with SyncBoth.
  Press button.
  Verify that pointer and keyboard are not frozen.
>>ASSERTION B XAllowEvents-24
When the event_mode argument is AsyncBoth and the pointer
and the keyboard are frozen by the client, then event
processing for both devices is resumed normally.
>>STRATEGY
If no extensions:
  Touch test for AsyncBoth.
else
  Grab and freeze keyboard and pointer.
  Call XAllowEvents with AsyncBoth.
  Verify that pointer is released.
  Verify that keyboard is released.
>>ASSERTION B XAllowEvents-25
When the event_mode argument is AsyncBoth and either the
keyboard or the pointer is not frozen by the client, then a
call to XAllowEvents has no effect.
>>STRATEGY
If extensions available:
  Grab and freeze pointer.
  Call XAllowEvents with AsyncBoth.
  Verify that pointer is not released.
>>ASSERTION B XAllowEvents-26
When the event_mode argument is AsyncBoth and the pointer
or keyboard is frozen twice by the client on behalf of two
separate grabs, then a call to XAllowEvents thaws for both
grabs.
>>STRATEGY
If extensions available:
  Freeze pointer and keyboard by calling XGrabPointer.
  Freeze pointer and keyboard again by calling XGrabKeyboard.

  Call XAllowEvents with AsyncBoth.
  Verify that pointer and keyboard are not frozen.
>>ASSERTION B XAllowEvents-27
When the event_mode argument is AsyncPointer, SyncPointer,
or ReplayPointer, then a call to XAllowEvents has no effect
on the processing of keyboard events.
>>STRATEGY
If extensions are available:
  Grab and freeze the keyboard.
  For each event_mode AsyncPointer SyncPointer ReplayPointer
    Call XAllowEvents.
    Verify that keyboard is still frozen.
>>ASSERTION A XAllowEvents-28
When the event_mode argument is AsyncKeyboard,
SyncKeyboard, or ReplayKeyboard, then a call to
XAllowEvents has no effect on the processing of pointer
events.
>>STRATEGY
Grab and freeze pointer.
For each event_mode AsyncKeyboard SyncKeyboard ReplayKeyboard
  Call XAllowEvents.
  Verify that pointer is still frozen.
>>ASSERTION A XAllowEvents-29
When the value of event_mode is other than AsyncPointer,
SyncPointer, AsyncKeyboard, SyncKeyboard, ReplayPointer,
ReplayKeyboard, AsyncBoth or SyncBoth, then a BadValue
error occurs.
>>STRATEGY
Obtain a sequence of values which are not in the list specified by VALUE_LIST.
For each value:
  Call test function with this value in the VALUE_ARG argument.
  Verify that a BadValue error occurs.
