Commit 8138ac9a authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/tests: Some cleanup for SysLink tests.

parent 084e772d
......@@ -180,39 +180,44 @@ static HWND create_syslink(DWORD style, HWND parent)
return hWndSysLink;
}
static void test_create_syslink(void)
{
HWND hWndSysLink;
LONG oldstyle;
/* Create an invisible SysLink control */
flush_sequences(sequences, NUM_MSG_SEQUENCE);
hWndSysLink = create_syslink(WS_CHILD | WS_TABSTOP, hWndParent);
ok(hWndSysLink != NULL, "Expected non NULL value (le %u)\n", GetLastError());
flush_events();
ok_sequence(sequences, SYSLINK_SEQ_INDEX, empty_wnd_seq, "create SysLink", FALSE);
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_create_syslink_wnd_seq, "create SysLink (parent)", TRUE);
/* Make the SysLink control visible */
flush_sequences(sequences, NUM_MSG_SEQUENCE);
oldstyle = GetWindowLongA(hWndSysLink, GWL_STYLE);
SetWindowLongA(hWndSysLink, GWL_STYLE, oldstyle | WS_VISIBLE);
RedrawWindow(hWndSysLink, NULL, NULL, RDW_INVALIDATE);
flush_events();
ok_sequence(sequences, SYSLINK_SEQ_INDEX, visible_syslink_wnd_seq, "visible SysLink", TRUE);
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_visible_syslink_wnd_seq, "visible SysLink (parent)", TRUE);
DestroyWindow(hWndSysLink);
}
START_TEST(syslink)
{
ULONG_PTR ctx_cookie;
HANDLE hCtx;
HMODULE hComctl32;
BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*);
INITCOMMONCONTROLSEX iccex;
BOOL rc;
HWND hWndSysLink;
LONG oldstyle;
POINT orig_pos;
HANDLE hCtx;
if (!load_v6_module(&ctx_cookie, &hCtx))
return;
/* LoadLibrary is needed. This file has no reference to functions in comctl32 */
hComctl32 = LoadLibraryA("comctl32.dll");
pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx");
if (!pInitCommonControlsEx)
{
win_skip("InitCommonControlsEx() is missing. Skipping the tests\n");
return;
}
iccex.dwSize = sizeof(iccex);
iccex.dwICC = ICC_LINK_CLASS;
rc = pInitCommonControlsEx(&iccex);
ok(rc, "InitCommonControlsEx failed (le %u)\n", GetLastError());
if (!rc)
{
skip("Could not register ICC_LINK_CLASS\n");
return;
}
ok(hComctl32 != NULL, "Failed to load comctl32.dll.\n");
/* Move the cursor off the parent window */
GetCursorPos(&orig_pos);
......@@ -223,36 +228,10 @@ START_TEST(syslink)
/* Create parent window */
hWndParent = create_parent_window();
ok(hWndParent != NULL, "Failed to create parent Window!\n");
if (!hWndParent)
{
skip("Parent window not present\n");
return;
}
flush_events();
/* Create an invisible SysLink control */
flush_sequences(sequences, NUM_MSG_SEQUENCE);
hWndSysLink = create_syslink(WS_CHILD | WS_TABSTOP, hWndParent);
ok(hWndSysLink != NULL, "Expected non NULL value (le %u)\n", GetLastError());
if (!hWndSysLink)
{
skip("SysLink control not present?\n");
return;
}
flush_events();
ok_sequence(sequences, SYSLINK_SEQ_INDEX, empty_wnd_seq, "create SysLink", FALSE);
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_create_syslink_wnd_seq, "create SysLink (parent)", TRUE);
/* Make the SysLink control visible */
flush_sequences(sequences, NUM_MSG_SEQUENCE);
oldstyle = GetWindowLongA(hWndSysLink, GWL_STYLE);
SetWindowLongA(hWndSysLink, GWL_STYLE, oldstyle | WS_VISIBLE);
RedrawWindow(hWndSysLink, NULL, NULL, RDW_INVALIDATE);
flush_events();
ok_sequence(sequences, SYSLINK_SEQ_INDEX, visible_syslink_wnd_seq, "visible SysLink", TRUE);
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_visible_syslink_wnd_seq, "visible SysLink (parent)", TRUE);
test_create_syslink();
DestroyWindow(hWndSysLink);
DestroyWindow(hWndParent);
unload_v6_module(ctx_cookie, hCtx);
SetCursorPos(orig_pos.x, orig_pos.y);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment