Author: jimtabor Date: Sun Oct 20 05:36:36 2013 New Revision: 60720
URL: http://svn.reactos.org/svn/reactos?rev=60720&view=rev Log: - Fix ATI test and go.
Modified: trunk/rostests/apitests/user32/AttachThreadInput.c
Modified: trunk/rostests/apitests/user32/AttachThreadInput.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/AttachThre... ============================================================================== --- trunk/rostests/apitests/user32/AttachThreadInput.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/AttachThreadInput.c [iso-8859-1] Sun Oct 20 05:36:36 2013 @@ -357,6 +357,7 @@ { BOOL ret;
+ trace("Thread hWnd0 0x%p hWnd1 0x%p\n",data[0].hWnd, data[1].hWnd); /* Window 1 is in the foreground */ SetForegroundWindow(data[1].hWnd); SetActiveWindow(data[0].hWnd); @@ -552,13 +553,33 @@
BOOL ret;
+ //trace("Thread hWnd0 0x%p hWnd1 0x%p\n",data[0].hWnd, data[1].hWnd); + /* First try sending input without attaching. It will go to the foreground */ { SetForegroundWindow(data[1].hWnd); SetActiveWindow(data[0].hWnd); - - ok(GetForegroundWindow() == data[1].hWnd, "wrong foreground\n"); - ok(GetActiveWindow() == data[0].hWnd, "wrong active\n"); + + ok(GetForegroundWindow() == data[1].hWnd, "wrong foreground got 0x%p\n",GetForegroundWindow()); + ok(GetActiveWindow() == data[0].hWnd, "wrong active got 0x%p\n",GetActiveWindow()); + + FlushMessages(); + EMPTY_CACHE_(&data[0].cache); + EMPTY_CACHE_(&data[1].cache); + + keybd_event(VK_SHIFT, 0,0,0); + keybd_event(VK_SHIFT, 0,KEYEVENTF_KEYUP,0); + Sleep(100); + FlushMessages(); + + COMPARE_CACHE_(&data[0].cache, empty_chain); + COMPARE_CACHE_(&data[1].cache, Thread1_chain); + } + + /* Next attach and send input. It will go to the same thread as before */ + { // from to + ret = AttachThreadInput( data[1].tid, data[0].tid , TRUE); + ok(ret==1, "expected AttachThreadInput to succeed\n");
FlushMessages(); EMPTY_CACHE_(&data[0].cache); @@ -572,10 +593,34 @@ COMPARE_CACHE_(&data[0].cache, empty_chain); COMPARE_CACHE_(&data[1].cache, Thread1_chain); } - - /* Next attach and send input. It will go to the same thread as before */ - { - ret = AttachThreadInput( data[1].tid, data[0].tid , TRUE); + + /* Now set foreground and active again. Input will go to thread 0 */ + { + SetForegroundWindow(data[1].hWnd); + SetActiveWindow(data[0].hWnd); + FlushMessages(); + + ok(GetForegroundWindow() == data[0].hWnd, "wrong foreground got 0x%p\n",GetForegroundWindow()); + ok(GetActiveWindow() == data[0].hWnd, "wrong active got 0x%p\n",GetActiveWindow()); + + EMPTY_CACHE_(&data[0].cache); + EMPTY_CACHE_(&data[1].cache); + + keybd_event(VK_SHIFT, 0,0,0); + keybd_event(VK_SHIFT, 0,KEYEVENTF_KEYUP,0); + Sleep(100); + FlushMessages(); + + COMPARE_CACHE_(&data[0].cache, Thread0_chain); + COMPARE_CACHE_(&data[1].cache, empty_chain); + + ret = AttachThreadInput( data[1].tid, data[0].tid , FALSE); + ok(ret==1, "expected AttachThreadInput to succeed\n"); + } + + /* Attach in the opposite order and send input */ + { + ret = AttachThreadInput( data[0].tid, data[1].tid , TRUE); ok(ret==1, "expected AttachThreadInput to succeed\n");
FlushMessages(); @@ -587,16 +632,19 @@ Sleep(100); FlushMessages();
- COMPARE_CACHE_(&data[0].cache, empty_chain); - COMPARE_CACHE_(&data[1].cache, Thread1_chain); - } - - /* Now set foregroung and active again. Input will go to thread 0 */ + COMPARE_CACHE_(&data[0].cache, Thread0_chain); + COMPARE_CACHE_(&data[1].cache, empty_chain); + } + + /* Now set foreground and active again. Input will go to thread 0 */ { SetForegroundWindow(data[1].hWnd); SetActiveWindow(data[0].hWnd); - FlushMessages(); + + ok(GetForegroundWindow() == data[0].hWnd, "wrong foreground got 0x%p\n",GetForegroundWindow()); + ok(GetActiveWindow() == data[0].hWnd, "wrong active got 0x%p\n",GetActiveWindow()); + EMPTY_CACHE_(&data[0].cache); EMPTY_CACHE_(&data[1].cache);
@@ -608,45 +656,6 @@ COMPARE_CACHE_(&data[0].cache, Thread0_chain); COMPARE_CACHE_(&data[1].cache, empty_chain);
- ret = AttachThreadInput( data[1].tid, data[0].tid , FALSE); - ok(ret==1, "expected AttachThreadInput to succeed\n"); - } - - /* Attach in the opposite order and send input */ - { - ret = AttachThreadInput( data[0].tid, data[1].tid , TRUE); - ok(ret==1, "expected AttachThreadInput to succeed\n"); - - FlushMessages(); - EMPTY_CACHE_(&data[0].cache); - EMPTY_CACHE_(&data[1].cache); - - keybd_event(VK_SHIFT, 0,0,0); - keybd_event(VK_SHIFT, 0,KEYEVENTF_KEYUP,0); - Sleep(100); - FlushMessages(); - - COMPARE_CACHE_(&data[0].cache, Thread0_chain); - COMPARE_CACHE_(&data[1].cache, empty_chain); - } - - /* Now set foregroung and active again. Input will go to thread 0 */ - { - SetForegroundWindow(data[1].hWnd); - SetActiveWindow(data[0].hWnd); - - FlushMessages(); - EMPTY_CACHE_(&data[0].cache); - EMPTY_CACHE_(&data[1].cache); - - keybd_event(VK_SHIFT, 0,0,0); - keybd_event(VK_SHIFT, 0,KEYEVENTF_KEYUP,0); - Sleep(100); - FlushMessages(); - - COMPARE_CACHE_(&data[0].cache, Thread0_chain); - COMPARE_CACHE_(&data[1].cache, empty_chain); - ret = AttachThreadInput( data[0].tid, data[1].tid , FALSE); ok(ret==1, "expected AttachThreadInput to succeed\n"); } @@ -657,9 +666,8 @@ if(!InitThreads()) return;
- win_skip("skip Test_SimpleParameters that crash ros\n"); - //Test_SimpleParameters(); - //cleanup_attachments(); + Test_SimpleParameters(); + cleanup_attachments(); Test_Focus(); cleanup_attachments(); Test_UnaffectedMessages();