>># 
>># 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: mpsbws.m,v 1.10 92/06/11 16:08:33 rws Exp $
>># 
>>#      SCCS:  @(#)  EWin.mc Rel 1.4	    (7/19/91)
>>#
>>TITLE XMapSubwindows CH03
>>ASSERTION A XMapSubwindows-1
A call to XMapSubwindows maps all subwindows of the
specified window in top to bottom stacking order.
>>STRATEGY
Create unmapped subwindows of a window.
Map subwindows.
Verify map state of each subwindow is IsViewable.
Verify that windows show on screen.
>>ASSERTION - XMapSubwindows-2
When a call to XMapSubwindows is made on a window that is
mapped and has no unmapped ancestors, then the subwindows
become viewable.
>>ASSERTION A XMapSubwindows-3
When a call to XMapSubwindows is made on a window that is
unmapped or has an unmapped ancester, then the subwindows do
not become viewable.
>>STRATEGY
Create stack of unmapped windows.
Call XMapSubwindows on one of these window that has an unmapped ancestor.
Verify map state of each subwindow is IsUnviewable.
Verify that nothing becomes visible.
>>ASSERTION A XMapSubwindows-4
When all the subwindows are already mapped, then a call to
XMapSubwindows has no effect.
>>STRATEGY
Create subwindows.
Map subwindow.
Enable events.
Attempt to map subwindows again.
Verify that no difference occurred on screen.
Verify that map-state is still IsViewable.
Verify that no events are generated.
>>ASSERTION A XMapSubwindows-5
When the override_redirect attribute of a subwindow is
False and some other client has selected
SubstructureRedirectMask on its parent window, then a
MapRequest event is generated, and the call to
XMapSubwindows does not map the subwindow.
>>STRATEGY
Create base window.
Create unmapped subwindows on base window.
Set override-redirect attribute to False on each subwindow.
Create second client.
Select SubstructureRedirectMask for second client on base window.
Call XMapSubwindows on base window.
Verify that the MapRequest event is generated for each subwindow.
Verify that map-state is still IsUnmapped.
>>ASSERTION A XMapSubwindows-6
When the override-redirect attribute of a subwindow is True
and the subwindow is not already mapped, then the window is
mapped and a MapNotify event is generated.
>>STRATEGY
Create base window.
Create unmapped subwindows on base window.
Set override-redirect attribute to True on each subwindow.
Select StructureNotify events on each subwindow.
Create second client.
Select SubstructureRedirect and SubstructureNotify for second client on base window.
Call XMapSubwindows on base window.
Verify that a MapNotify event is generated on parent for each subwindow.
Verify that a MapNotify event is generated on each subwindow.
Verify that the map_state of each subwindow is IsViewable.
>>ASSERTION A XMapSubwindows-7
When no other client has selected SubstructureRedirectMask
on the parent window and the window is not already mapped,
then the window is mapped and a MapNotify event is
generated.
>>STRATEGY
Create base window.
Create unmapped subwindows on base window.
Set override-redirect attribute to False on each subwindow.
Select StructureNotify events on each subwindow.
Create second client.
Select SubstructureNotify for second client on base window.
Call XMapSubwindows on base window.
Verify that a MapNotify event is generated on parent for each subwindow.
Verify that a MapNotify event is generated on each subwindow.
Verify that the map_state of each subwindow is IsViewable.
>>ASSERTION A XMapSubwindows-8
When one of the subwindows becomes viewable after a call to
XMapSubwindows and no earlier contents for it are
remembered, then the subwindow is tiled with its background.
>>STRATEGY
Create subwindows.
Create tile.
Set background of each subwindow to tile.
Map subwindows.
Verify that subwindows are tiled.
Re-run with an inferior window.
>>ASSERTION A XMapSubwindows-9
When the background of the subwindow 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 subwindows that overlap inferior.
Set background pixmap to None on each subwindow.
Map subwindows.
Verify that screen contents have not been altered.

Unmap subwindows.
For each subwindow
	Select for expose events.
	Call setforexpose() to draw into window (for if backing store in use)
Call XMapSubwindows to map subwindows.
For each window
	Verify that window was restored from backing store or received expose
	events that cover the window with exposecheck().
>>ASSERTION B XMapSubwindows-10
When the background of the subwindow 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 XMapSubwindows-11
If backing store is supported: When backing store has been
maintained while a particular subwindow was unmapped, then
no Expose events are generated for that subwindow.
>>STRATEGY
If backing store is supported
  Create base window.
  Create child of this window to unmap.
  Set backing store hint of child to Always.
  Write into child window.
  Unmap child window.
  Enable Expose events.
  Map child window by calling XMapSubwindows on base window.
  If child 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 XMapSubwindows-12
If backing store is supported: When the server elects to
now maintain backing store for a subwindow, 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 XMapSubwindows-13
When the server elects to not maintain backing store for a
subwindow, then Expose events are generated only for visible
regions.
>>STRATEGY
Create small window.
Ask for no backing store.
Create (and map) windows 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 XMapSubwindows-14
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.
