>># 
>># 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: mprsd.m,v 1.8 92/06/11 16:08:08 rws Exp $
>># 
>>#      SCCS:  @(#)  EWin.mc Rel 1.4	    (7/19/91)
>>#
>>TITLE XMapRaised CH03
>>ASSERTION A XMapRaised-1
A call to XMapRaised maps the specified window and raises
it to the top of the stacking order.
>>STRATEGY
Create windows, one of which is unmapped in the middle of the stacking order.
Map window.
Verify map state is IsViewable.
Verify that window shows on screen.
Verify that window is at top of stacking order.
>>ASSERTION - XMapRaised-2
When a call to XMapRaised is made on a window that has no
unmapped ancestors, then the window becomes viewable.
>>ASSERTION A XMapRaised-3
When a call to XMapRaised is made on a window that has an
unmapped ancestor, then the window does not become viewable.
>>STRATEGY
Create windows with an unmapped ancestor.
Map one of these window that has an unmapped ancestor.
Verify map state is IsUnviewable.
Verify that nothing new becomes visible.
>>ASSERTION A XMapRaised-4
When a call to XMapRaised is made on a window that is the
only unmapped ancestor of an inferior window that has
previously been mapped, then that inferior window becomes
viewable.
>>STRATEGY
Create stack of windows with mapped windows as inferiors of an unmapped window.
Check that map-state of inferiors is IsUnviewable.
Map the ancestor window.
Verify that map-state of inferiors is IsViewable.
Verify that windows become visible on the screen.
>>ASSERTION A XMapRaised-5
When the override-redirect attribute of the window is False
and some other client has selected SubstructureRedirectMask
on the parent window, then a MapRequest event is generated,
and the call to XMapRaised does not map the window.
>>STRATEGY
Create base window.
Create unmapped window on base window.
Set override-redirect attribute to False.
Create second client.
Select SubstructureRedirect for second client on base window.
Map window.
Verify that the MapRequest event is generated on second client.
Verify that map-state is still IsUnmapped.
>>ASSERTION A XMapRaised-6
When the override-redirect attribute of the window is False
and some other client has selected SubstructureRedirectMask
on the parent window, then a ConfigureRequest event is
generated, and the call to XMapRaised does not restack the
window.
>>STRATEGY
Create base window.
Create unmapped window on base window.
Set override-redirect attribute to False.
Create sibling to test window so that stacking order test is meaningful.
Create second client.
Select SubstructureRedirect for second client on base window.
Map window.
Verify that a ConfigureRequest event is generated on second client.
Verify that stacking order is unchanged.
>>ASSERTION A XMapRaised-7
When the override-redirect attribute of the window is True,
then the window is mapped and a MapNotify event is
generated.
>>STRATEGY
Create base window.
Create unmapped window on base window.
Set override-redirect attribute to True.
Select StructureNotify events on window.
Create second client.
Select SubstructureRedirect and SubstructureNotify for second client on base window.
Map window.
Verify that a MapNotify event is generated on parent.
Verify that a MapNotify event is generated on window.
Verify that a ConfigureNotify event is generated on parent.
Verify that a ConfigureNotify event is generated on window.
Verify that the map_state of the window is IsViewable.
>>ASSERTION A XMapRaised-8
When no other client has selected SubstructureRedirectMask
on the parent window, then on a call to XMapRaised the
window is mapped and a MapNotify event is generated.
>>STRATEGY
Create base window.
Create unmapped window on base window.
Set override-redirect attribute to False.
Select StructureNotify events on window.
Create second client.
Select SubstructureNotify for second client on base window.
Map window.
Verify that a MapNotify event is generated on parent.
Verify that a MapNotify event is generated on window.
Verify that a ConfigureNotify event is generated on parent.
Verify that a ConfigureNotify event is generated on window.
Verify that the map_state of the window is IsViewable.
Verify that window is at top of stacking order.
>>ASSERTION A XMapRaised-9
When the window or one of its inferiors becomes viewable
after a call to XMapRaised and no earlier contents for it
are remembered, then the window is tiled with its
background.
>>STRATEGY
Create window.
Set background to tile.
Map window.
Verify that window is tiled.
Re-run with an inferior window.
>>ASSERTION A XMapRaised-10
When the background of the window is undefined then the
existing screen contents from the parent or an inferior of
the parent are not altered, and zero or more Expose events
are generated.
>>STRATEGY
Create window as parent.
Draw pattern on parent.
Create inferior window and draw pattern on that too.
Create unmapped inferior that overlaps other inferior.
Set background pixmap to None to undefine background.
Map window.
Verify that screen contents have not been altered.

Unmap window.
Select for expose events.
Call setforexpose() to draw into window (only effective if backing store in use)
Call XMapRaised to map window.
Verify that window was restored from backing store or received expose
events to cover the window with exposecheck().
>>ASSERTION B XMapRaised-11
When the background of the window is undefined then the
existing screen contents not from the parent or an inferior
of the parent are undefined, and zero or more Expose events
are generated.
>>STRATEGY
Report UNTESTED
>>ASSERTION D XMapRaised-12
If backing store is supported: When backing store has been
maintained while a particular window was unmapped, then no
Expose events are generated for that window.
>>STRATEGY
If backing store is supported
  Create window.
  Set backing store hint to Always.
  Write into window.
  Unmap window.
  Enable Expose events.
  Map window.
  If window contents are unaltered.
	Backing store was maintained.
	Verify that no Expose events were received.
  else
	Backing store was not maintained.
	Test result is UNTESTED.
else
  Test result is UNSUPPORTED.
>>ASSERTION D XMapRaised-13
When the server elects to now maintain backing store for a
window, then an Expose event for the whole window is
generated.
>>STRATEGY
If backing store is supported.
  Create small window.
  Ask for backing store when mapped.
  Create (and map) windows that would obscure the test window.
  Enable Expose events.
  Map window.
  If no Expose
	Untested - maybe got backing store always.
  Verify Expose event is for whole window.
else
  Untested.
>>ASSERTION A XMapRaised-14
When the server elects to not maintain backing store for a
window, then Expose events are generated only for visible
regions.
>>STRATEGY
Create small window.
Create child covering this window for use as the test window.
Ask for no backing store.
Create (and map) window that would obscure the test window.
Map window.
If Expose event is for whole window.
  Untested - maybe got backing store.
else
  Verify that only visible regions got Expose events.
>>ASSERTION A XMapRaised-15
When a window argument does not name a valid Window, then a
BadWindow error occurs.
>>STRATEGY
Create a bad window by creating and destroying a window.
Call test function using bad window as the window argument.
Verify that a BadWindow error occurs.
