Author: gadamopoulos
Date: Thu Oct 6 14:19:04 2011
New Revision: 54025
URL:
http://svn.reactos.org/svn/reactos?rev=54025&view=rev
Log:
[user32_apitest]
- Add a couple of tests for the messages sent when changing the z-oder of windows with
DeferWindowPos (this test ignores owners z-order)
Modified:
trunk/rostests/apitests/user32/DeferWindowPos.c
Modified: trunk/rostests/apitests/user32/DeferWindowPos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/DeferWind…
==============================================================================
--- trunk/rostests/apitests/user32/DeferWindowPos.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/user32/DeferWindowPos.c [iso-8859-1] Thu Oct 6 14:19:04 2011
@@ -278,6 +278,19 @@
{2,WM_MOVE},
{0,0}};
+
+MSG_ENTRY ZOrder1_chain[]={
+ {1,WM_WINDOWPOSCHANGING, SENT, 0,
SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOMOVE|SWP_NOSIZE},
+ {1,WM_WINDOWPOSCHANGED, SENT, 0,
SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOMOVE|SWP_NOSIZE |
SWP_NOCLIENTMOVE|SWP_NOCLIENTSIZE},
+ {0,0}};
+
+MSG_ENTRY ZOrder1and2_chain[]={
+ {1,WM_WINDOWPOSCHANGING, SENT, 0,
SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOMOVE|SWP_NOSIZE},
+ {2,WM_WINDOWPOSCHANGING, SENT, 0,
SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOMOVE|SWP_NOSIZE},
+ {1,WM_WINDOWPOSCHANGED, SENT, 0,
SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOMOVE|SWP_NOSIZE |
SWP_NOCLIENTMOVE|SWP_NOCLIENTSIZE},
+ {2,WM_WINDOWPOSCHANGED, SENT, 0,
SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOMOVE|SWP_NOSIZE |
SWP_NOCLIENTMOVE|SWP_NOCLIENTSIZE},
+ {0,0}};
+
static void Test_DWP_SimpleMsg(HWND hWnd1, HWND hWnd2)
{
HDWP hdwp;
@@ -291,8 +304,6 @@
/* move hWnd1 */
hdwp = BeginDeferWindowPos(1);
ok(hdwp != NULL, "BeginDeferWindowPos failed\n");
- FlushMessages();
- COMPARE_CACHE(empty_chain);
hdwp = DeferWindowPos(hdwp, hWnd1, HWND_TOP, 20, 30, 100, 100,
SWP_NOACTIVATE|SWP_NOOWNERZORDER);
ok(hdwp != NULL, "DeferWindowPos failed\n");
FlushMessages();
@@ -305,8 +316,6 @@
/* resize hWnd1 */
hdwp = BeginDeferWindowPos(1);
ok(hdwp != NULL, "BeginDeferWindowPos failed\n");
- FlushMessages();
- COMPARE_CACHE(empty_chain);
hdwp = DeferWindowPos(hdwp, hWnd1, HWND_TOP, 20, 30, 110, 110,
SWP_NOACTIVATE|SWP_NOOWNERZORDER);
ok(hdwp != NULL, "DeferWindowPos failed\n");
FlushMessages();
@@ -315,17 +324,12 @@
ok(ret != 0, "EndDeferWindowPos failed\n");
FlushMessages();
COMPARE_CACHE(resize1_chain);
-
/* move both windows */
hdwp = BeginDeferWindowPos(1);
ok(hdwp != NULL, "BeginDeferWindowPos failed\n");
- FlushMessages();
- COMPARE_CACHE(empty_chain);
hdwp = DeferWindowPos(hdwp, hWnd1, HWND_TOP, 30, 40, 110, 110,
SWP_NOACTIVATE|SWP_NOOWNERZORDER);
ok(hdwp != NULL, "DeferWindowPos failed\n");
- FlushMessages();
- COMPARE_CACHE(empty_chain);
hdwp = DeferWindowPos(hdwp, hWnd2, HWND_TOP, 30, 40, 100, 100,
SWP_NOACTIVATE|SWP_NOOWNERZORDER);
ok(hdwp != NULL, "DeferWindowPos failed\n");
FlushMessages();
@@ -334,6 +338,33 @@
ok(ret != 0, "EndDeferWindowPos failed\n");
FlushMessages();
COMPARE_CACHE(move1_2_chain);
+
+ /* change the z-order of the first window */
+ hdwp = BeginDeferWindowPos(1);
+ ok(hdwp != NULL, "BeginDeferWindowPos failed\n");
+ hdwp = DeferWindowPos(hdwp, hWnd1, HWND_BOTTOM, 0, 0, 0, 0,
SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOMOVE|SWP_NOSIZE);
+ ok(hdwp != NULL, "DeferWindowPos failed\n");
+ FlushMessages();
+ COMPARE_CACHE(empty_chain);
+ ret = EndDeferWindowPos(hdwp);
+ ok(ret != 0, "EndDeferWindowPos failed\n");
+ FlushMessages();
+ COMPARE_CACHE(ZOrder1_chain);
+
+ /* change the z-order of both windows */
+ hdwp = BeginDeferWindowPos(2);
+ ok(hdwp != NULL, "BeginDeferWindowPos failed\n");
+ hdwp = DeferWindowPos(hdwp, hWnd1, HWND_TOP, 0, 0, 0, 0,
SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOMOVE|SWP_NOSIZE);
+ ok(hdwp != NULL, "DeferWindowPos failed\n");
+ hdwp = DeferWindowPos(hdwp, hWnd2, HWND_BOTTOM, 0, 0, 0, 0,
SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOMOVE|SWP_NOSIZE);
+ ok(hdwp != NULL, "DeferWindowPos failed\n");
+ FlushMessages();
+ COMPARE_CACHE(empty_chain);
+ ret = EndDeferWindowPos(hdwp);
+ ok(ret != 0, "EndDeferWindowPos failed\n");
+ FlushMessages();
+ COMPARE_CACHE(ZOrder1and2_chain);
+
}
#define OwnerZOrderAParams SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOSIZE