Commit 037d315a authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/tests: Run some Progress control tests on version 6.

parent f6bf2690
......@@ -27,8 +27,9 @@
#include "wine/test.h"
#include "v6util.h"
static HWND hProgressParentWnd, hProgressWnd;
static HWND hProgressParentWnd;
static const char progressTestClass[] = "ProgressBarTestClass";
static BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*);
......@@ -119,16 +120,6 @@ static void init(void)
CW_USEDEFAULT, CW_USEDEFAULT, rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, GetModuleHandleA(NULL), 0);
ok(hProgressParentWnd != NULL, "failed to create parent wnd\n");
GetClientRect(hProgressParentWnd, &rect);
hProgressWnd = CreateWindowExA(0, PROGRESS_CLASSA, "", WS_CHILD | WS_VISIBLE,
0, 0, rect.right, rect.bottom, hProgressParentWnd, NULL, GetModuleHandleA(NULL), 0);
ok(hProgressWnd != NULL, "Failed to create progress bar.\n");
progress_wndproc = (WNDPROC)SetWindowLongPtrA(hProgressWnd, GWLP_WNDPROC, (LPARAM)progress_subclass_proc);
ShowWindow(hProgressParentWnd, SW_SHOWNORMAL);
ok(GetUpdateRect(hProgressParentWnd, NULL, FALSE), "GetUpdateRect: There should be a region that needs to be updated\n");
flush_events();
update_window(hProgressParentWnd);
}
static void cleanup(void)
......@@ -151,9 +142,21 @@ static void cleanup(void)
*/
static void test_redraw(void)
{
RECT client_rect;
RECT client_rect, rect;
HWND hProgressWnd;
LRESULT ret;
GetClientRect(hProgressParentWnd, &rect);
hProgressWnd = CreateWindowExA(0, PROGRESS_CLASSA, "", WS_CHILD | WS_VISIBLE,
0, 0, rect.right, rect.bottom, hProgressParentWnd, NULL, GetModuleHandleA(NULL), 0);
ok(hProgressWnd != NULL, "Failed to create progress bar.\n");
progress_wndproc = (WNDPROC)SetWindowLongPtrA(hProgressWnd, GWLP_WNDPROC, (LPARAM)progress_subclass_proc);
ShowWindow(hProgressParentWnd, SW_SHOWNORMAL);
ok(GetUpdateRect(hProgressParentWnd, NULL, FALSE), "GetUpdateRect: There should be a region that needs to be updated\n");
flush_events();
update_window(hProgressParentWnd);
SendMessageA(hProgressWnd, PBM_SETRANGE, 0, MAKELPARAM(0, 100));
SendMessageA(hProgressWnd, PBM_SETPOS, 10, 0);
SendMessageA(hProgressWnd, PBM_SETSTEP, 20, 0);
......@@ -207,6 +210,8 @@ static void test_redraw(void)
wine_dbgstr_rect(&last_paint_rect), wine_dbgstr_rect(&client_rect));
update_window(hProgressWnd);
ok(erased, "Progress bar should have erased the background\n");
DestroyWindow(hProgressWnd);
}
static void test_setcolors(void)
......@@ -299,6 +304,8 @@ static void init_functions(void)
START_TEST(progress)
{
INITCOMMONCONTROLSEX iccex;
ULONG_PTR ctx_cookie;
HANDLE hCtx;
init_functions();
......@@ -312,5 +319,13 @@ START_TEST(progress)
test_setcolors();
test_PBM_STEPIT();
if (!load_v6_module(&ctx_cookie, &hCtx))
return;
test_setcolors();
test_PBM_STEPIT();
unload_v6_module(ctx_cookie, hCtx);
cleanup();
}
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