Nikolay Sivov : comctl32/listview: Basic LVN_(BEGIN|END)SCROLL tests.
Alexandre Julliard
julliard at winehq.org
Wed Jul 8 14:35:54 CDT 2009
Module: wine
Branch: master
Commit: 1b2a6a08aaaa77961336691d054b6a71a6066b18
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1b2a6a08aaaa77961336691d054b6a71a6066b18
Author: Nikolay Sivov <bunglehead at gmail.com>
Date: Wed Jul 8 00:03:33 2009 +0400
comctl32/listview: Basic LVN_(BEGIN|END)SCROLL tests.
---
dlls/comctl32/tests/listview.c | 55 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 55 insertions(+), 0 deletions(-)
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 6d3a2d2..b886d86 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -240,6 +240,12 @@ static const struct message editbox_create_pos[] = {
{ 0 }
};
+static const struct message scroll_parent_seq[] = {
+ { WM_NOTIFY, sent|id, 0, 0, LVN_BEGINSCROLL },
+ { WM_NOTIFY, sent|id, 0, 0, LVN_ENDSCROLL },
+ { 0 }
+};
+
struct subclass_info
{
WNDPROC oldproc;
@@ -290,6 +296,15 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP
case LVN_ENDLABELEDIT:
/* always accept new item text */
return TRUE;
+ case LVN_BEGINSCROLL:
+ case LVN_ENDSCROLL:
+ {
+ NMLVSCROLL *pScroll = (NMLVSCROLL*)lParam;
+
+ trace("LVN_%sSCROLL: (%d,%d)\n", pScroll->hdr.code == LVN_BEGINSCROLL ?
+ "BEGIN" : "END", pScroll->dx, pScroll->dy);
+ }
+ break;
}
break;
}
@@ -3778,6 +3793,45 @@ static void test_getcolumnwidth(void)
DestroyWindow(hwnd);
}
+static void test_scrollnotify(void)
+{
+ HWND hwnd;
+ DWORD ret;
+
+ hwnd = create_listview_control(0);
+
+ insert_column(hwnd, 0);
+ insert_column(hwnd, 1);
+ insert_item(hwnd, 0);
+
+ /* make it scrollable - resize */
+ ret = SendMessage(hwnd, LVM_SETCOLUMNWIDTH, 0, MAKELPARAM(100, 0));
+ expect(TRUE, ret);
+ ret = SendMessage(hwnd, LVM_SETCOLUMNWIDTH, 1, MAKELPARAM(100, 0));
+ expect(TRUE, ret);
+
+ /* try with dummy call */
+ flush_sequences(sequences, NUM_MSG_SEQUENCES);
+ ret = SendMessage(hwnd, LVM_SCROLL, 0, 0);
+ expect(TRUE, ret);
+ ok_sequence(sequences, PARENT_SEQ_INDEX, scroll_parent_seq,
+ "scroll notify 1", TRUE);
+
+ flush_sequences(sequences, NUM_MSG_SEQUENCES);
+ ret = SendMessage(hwnd, LVM_SCROLL, 1, 0);
+ expect(TRUE, ret);
+ ok_sequence(sequences, PARENT_SEQ_INDEX, scroll_parent_seq,
+ "scroll notify 2", TRUE);
+
+ flush_sequences(sequences, NUM_MSG_SEQUENCES);
+ ret = SendMessage(hwnd, LVM_SCROLL, 1, 1);
+ expect(TRUE, ret);
+ ok_sequence(sequences, PARENT_SEQ_INDEX, scroll_parent_seq,
+ "scroll notify 3", TRUE);
+
+ DestroyWindow(hwnd);
+}
+
START_TEST(listview)
{
HMODULE hComctl32;
@@ -3844,6 +3898,7 @@ START_TEST(listview)
test_get_set_view();
test_canceleditlabel();
test_mapidindex();
+ test_scrollnotify();
unload_v6_module(ctx_cookie);
More information about the wine-cvs
mailing list