Author: cwittich
Date: Sun Mar 7 08:32:14 2010
New Revision: 45976
URL:
http://svn.reactos.org/svn/reactos?rev=45976&view=rev
Log:
[USER32_WINETEST]
sync user32_winetest to wine 1.1.40
Modified:
trunk/rostests/winetests/user32/dialog.c
trunk/rostests/winetests/user32/edit.c
trunk/rostests/winetests/user32/msg.c
trunk/rostests/winetests/user32/scroll.c
trunk/rostests/winetests/user32/win.c
Modified: trunk/rostests/winetests/user32/dialog.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/dialog.c…
==============================================================================
--- trunk/rostests/winetests/user32/dialog.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/dialog.c [iso-8859-1] Sun Mar 7 08:32:14 2010
@@ -852,8 +852,8 @@
ok ((g_hwndInitialFocusT1 == g_hwndButton2),
"Error in initial focus when WM_INITDIALOG returned TRUE: "
"Expected the second button (%p), got %s (%p).\n",
- g_hwndButton2, GetHwndString(g_hwndInitialFocusT2),
- g_hwndInitialFocusT2);
+ g_hwndButton2, GetHwndString(g_hwndInitialFocusT1),
+ g_hwndInitialFocusT1);
ok ((g_hwndInitialFocusT2 == g_hwndButton2),
"Error after first SetFocus() when WM_INITDIALOG returned TRUE: "
@@ -926,6 +926,21 @@
return FALSE;
}
+static INT_PTR CALLBACK TestInitDialogHandleProc (HWND hDlg, UINT uiMsg,
+ WPARAM wParam, LPARAM lParam)
+{
+ if (uiMsg == WM_INITDIALOG)
+ {
+ HWND expected = GetNextDlgTabItem(hDlg, NULL, FALSE);
+ ok(expected == (HWND)wParam,
+ "Expected wParam to be the handle to the first tabstop control (%p), got
%p\n",
+ expected, (HWND)wParam);
+
+ EndDialog(hDlg, LOWORD(SendMessage(hDlg, DM_GETDEFID, 0, 0)));
+ return TRUE;
+ }
+ return FALSE;
+}
static INT_PTR CALLBACK TestDefButtonDlgProc (HWND hDlg, UINT uiMsg,
WPARAM wParam, LPARAM lParam)
@@ -977,6 +992,9 @@
ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE ||
broken(GetLastError() == 0xdeadbeef),
"got %d, expected ERROR_INVALID_WINDOW_HANDLE\n", GetLastError());
+
+ ret = DialogBoxParamA(GetModuleHandle(NULL), "TEST_EMPTY_DIALOG", 0,
TestInitDialogHandleProc, 0);
+ ok(ret == IDOK, "Expected IDOK\n");
ret = DialogBoxParamA(GetModuleHandle(NULL), "TEST_EMPTY_DIALOG", 0,
TestDefButtonDlgProc, 0);
ok(ret == IDOK, "Expected IDOK\n");
@@ -1139,6 +1157,55 @@
DestroyWindow(hDlg);
}
+static INT_PTR CALLBACK timer_message_dlg_proc(HWND wnd, UINT msg, WPARAM wparam, LPARAM
lparam)
+{
+ static int count;
+ BOOL visible;
+
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ visible = GetWindowLong(wnd, GWL_STYLE) & WS_VISIBLE;
+ ok(!visible, "Dialog should not be visible.\n");
+ SetTimer(wnd, 1, 100, NULL);
+ Sleep(200);
+ return FALSE;
+
+ case WM_COMMAND:
+ if (LOWORD(wparam) != IDCANCEL) return FALSE;
+ EndDialog(wnd, LOWORD(wparam));
+ return TRUE;
+
+ case WM_TIMER:
+ if (wparam != 1) return FALSE;
+ visible = GetWindowLong(wnd, GWL_STYLE) & WS_VISIBLE;
+ if (!count++)
+ {
+ ok(!visible, "Dialog should not be visible.\n");
+ PostMessage(wnd, WM_USER, 0, 0);
+ }
+ else
+ {
+ ok(visible, "Dialog should be visible.\n");
+ PostMessage(wnd, WM_COMMAND, IDCANCEL, 0);
+ }
+ return TRUE;
+
+ case WM_USER:
+ visible = GetWindowLong(wnd, GWL_STYLE) & WS_VISIBLE;
+ ok(visible, "Dialog should be visible.\n");
+ return TRUE;
+
+ default:
+ return FALSE;
+ }
+}
+
+static void test_timer_message(void)
+{
+ DialogBoxA(g_hinst, "RADIO_TEST_DIALOG", NULL, timer_message_dlg_proc);
+}
+
START_TEST(dialog)
{
g_hinst = GetModuleHandleA (0);
@@ -1154,4 +1221,5 @@
test_DisabledDialogTest();
test_MessageBoxFontTest();
test_SaveRestoreFocus();
-}
+ test_timer_message();
+}
Modified: trunk/rostests/winetests/user32/edit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/edit.c?r…
==============================================================================
--- trunk/rostests/winetests/user32/edit.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/edit.c [iso-8859-1] Sun Mar 7 08:32:14 2010
@@ -1314,6 +1314,57 @@
ok( (r == 65535) || (r == 4294967295UL),
"got limit %u (expected 65535 or 4294967295)\n", r);
DestroyWindow(hwEdit);
+}
+
+/* Test EM_SCROLL */
+static void test_edit_control_scroll(void)
+{
+ static const char *single_line_str = "a";
+ static const char *multiline_str = "Test\r\nText";
+ HWND hwEdit;
+ LONG ret;
+
+ /* Check the return value when EM_SCROLL doesn't scroll
+ * anything. Should not return true unless any lines were actually
+ * scrolled. */
+ hwEdit = CreateWindow(
+ "EDIT",
+ single_line_str,
+ WS_VSCROLL | ES_MULTILINE,
+ 1, 1, 100, 100,
+ NULL, NULL, hinst, NULL);
+
+ assert(hwEdit);
+
+ ret = SendMessage(hwEdit, EM_SCROLL, SB_PAGEDOWN, 0);
+ ok(!ret, "Returned %x, expected 0.\n", ret);
+
+ ret = SendMessage(hwEdit, EM_SCROLL, SB_PAGEUP, 0);
+ ok(!ret, "Returned %x, expected 0.\n", ret);
+
+ ret = SendMessage(hwEdit, EM_SCROLL, SB_LINEUP, 0);
+ ok(!ret, "Returned %x, expected 0.\n", ret);
+
+ ret = SendMessage(hwEdit, EM_SCROLL, SB_LINEDOWN, 0);
+ ok(!ret, "Returned %x, expected 0.\n", ret);
+
+ DestroyWindow (hwEdit);
+
+ /* SB_PAGEDOWN while at the beginning of a buffer with few lines
+ should not cause EM_SCROLL to return a negative value of
+ scrolled lines that would put us "before" the beginning. */
+ hwEdit = CreateWindow(
+ "EDIT",
+ multiline_str,
+ WS_VSCROLL | ES_MULTILINE,
+ 0, 0, 100, 100,
+ NULL, NULL, hinst, NULL);
+ assert(hwEdit);
+
+ ret = SendMessage(hwEdit, EM_SCROLL, SB_PAGEDOWN, 0);
+ ok(!ret, "Returned %x, expected 0.\n", ret);
+
+ DestroyWindow (hwEdit);
}
static void test_margins(void)
@@ -2319,6 +2370,7 @@
test_edit_control_5();
test_edit_control_6();
test_edit_control_limittext();
+ test_edit_control_scroll();
test_margins();
test_margins_font_change();
test_text_position();
Modified: trunk/rostests/winetests/user32/msg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/msg.c?re…
==============================================================================
--- trunk/rostests/winetests/user32/msg.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/msg.c [iso-8859-1] Sun Mar 7 08:32:14 2010
@@ -12080,6 +12080,13 @@
{ 0, 0, FALSE },
{ 0, WAIT_TIMEOUT, FALSE },
{ 0, 0, FALSE },
+ { 0, 0, FALSE },
+/* 15 */ { 0, 0, FALSE },
+ { WAIT_TIMEOUT, 0, FALSE },
+ { WAIT_TIMEOUT, 0, FALSE },
+ { WAIT_TIMEOUT, 0, FALSE },
+ { WAIT_TIMEOUT, 0, FALSE },
+/* 20 */ { WAIT_TIMEOUT, 0, FALSE },
};
static DWORD CALLBACK do_wait_idle_child_thread( void *arg )
@@ -12205,6 +12212,41 @@
WaitForSingleObject( thread, 10000 );
CloseHandle( thread );
break;
+ case 14:
+ SetEvent( start_event );
+ Sleep( 200 );
+ PeekMessage( &msg, HWND_TOPMOST, 0, 0, PM_NOREMOVE );
+ break;
+ case 15:
+ SetEvent( start_event );
+ Sleep( 200 );
+ PeekMessage( &msg, HWND_BROADCAST, 0, 0, PM_NOREMOVE );
+ break;
+ case 16:
+ SetEvent( start_event );
+ Sleep( 200 );
+ PeekMessage( &msg, HWND_BOTTOM, 0, 0, PM_NOREMOVE );
+ break;
+ case 17:
+ SetEvent( start_event );
+ Sleep( 200 );
+ PeekMessage( &msg, (HWND)0xdeadbeef, 0, 0, PM_NOREMOVE );
+ break;
+ case 18:
+ SetEvent( start_event );
+ Sleep( 200 );
+ PeekMessage( &msg, HWND_NOTOPMOST, 0, 0, PM_NOREMOVE );
+ break;
+ case 19:
+ SetEvent( start_event );
+ Sleep( 200 );
+ PeekMessage( &msg, HWND_MESSAGE, 0, 0, PM_NOREMOVE );
+ break;
+ case 20:
+ SetEvent( start_event );
+ Sleep( 200 );
+ PeekMessage( &msg, GetDesktopWindow(), 0, 0, PM_NOREMOVE );
+ break;
}
WaitForSingleObject( end_event, 2000 );
CloseHandle( start_event );
Modified: trunk/rostests/winetests/user32/scroll.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/scroll.c…
==============================================================================
--- trunk/rostests/winetests/user32/scroll.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/scroll.c [iso-8859-1] Sun Mar 7 08:32:14 2010
@@ -411,8 +411,8 @@
WS_OVERLAPPEDWINDOW|WS_VSCROLL|WS_HSCROLL,
CW_USEDEFAULT, CW_USEDEFAULT, 100, 100, NULL, NULL, GetModuleHandleA(NULL), 0 );
- if ( !ok( hMainWnd != NULL, "Failed to create parent window. Tests
aborted.\n" ) )
- return;
+ ok(hMainWnd != NULL, "Failed to create parent window. Tests aborted.\n");
+ if (!hMainWnd) return;
assert( hScroll );
Modified: trunk/rostests/winetests/user32/win.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/win.c?re…
==============================================================================
--- trunk/rostests/winetests/user32/win.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/win.c [iso-8859-1] Sun Mar 7 08:32:14 2010
@@ -3424,6 +3424,14 @@
check_window_style(WS_CHILD, WS_EX_DLGMODALFRAME|WS_EX_STATICEDGE, WS_CHILD,
WS_EX_STATICEDGE|WS_EX_WINDOWEDGE|WS_EX_DLGMODALFRAME);
check_window_style(WS_CAPTION, WS_EX_STATICEDGE, WS_CLIPSIBLINGS|WS_CAPTION,
WS_EX_STATICEDGE|WS_EX_WINDOWEDGE);
check_window_style(0, WS_EX_APPWINDOW, WS_CLIPSIBLINGS|WS_CAPTION,
WS_EX_APPWINDOW|WS_EX_WINDOWEDGE);
+
+ if (pGetLayeredWindowAttributes)
+ {
+ check_window_style(0, WS_EX_LAYERED, WS_CLIPSIBLINGS|WS_CAPTION,
WS_EX_LAYERED|WS_EX_WINDOWEDGE);
+ check_window_style(0, WS_EX_LAYERED|WS_EX_TRANSPARENT,
WS_CLIPSIBLINGS|WS_CAPTION, WS_EX_LAYERED|WS_EX_TRANSPARENT|WS_EX_WINDOWEDGE);
+ check_window_style(0, WS_EX_LAYERED|WS_EX_TRANSPARENT|WS_EX_TOOLWINDOW,
WS_CLIPSIBLINGS|WS_CAPTION,
+
WS_EX_LAYERED|WS_EX_TRANSPARENT|WS_EX_TOOLWINDOW|WS_EX_WINDOWEDGE);
+ }
}
static void test_scrollwindow( HWND hwnd)