comctl32/tests: Add multi select tests for ownerdata listviews.
Add tests for selecting multiple items in ownerdata listviews by using SHIFT/CTRL and arrow keys. Signed-off-by: Angelo Haller <angelo@szanni.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
2d78448464
commit
ca9e3586de
|
@ -3530,6 +3530,56 @@ static void test_ownerdata(void)
|
||||||
DestroyWindow(hwnd);
|
DestroyWindow(hwnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_ownerdata_multiselect(void)
|
||||||
|
{
|
||||||
|
HWND hwnd;
|
||||||
|
DWORD res;
|
||||||
|
LVITEMA item;
|
||||||
|
|
||||||
|
hwnd = create_listview_control(LVS_OWNERDATA | LVS_REPORT);
|
||||||
|
ok(hwnd != NULL, "failed to create a listview window\n");
|
||||||
|
res = SendMessageA(hwnd, LVM_SETITEMCOUNT, 20, 0);
|
||||||
|
expect(1, res);
|
||||||
|
res = SendMessageA(hwnd, LVM_GETSELECTEDCOUNT, 0, 0);
|
||||||
|
expect(0, res);
|
||||||
|
|
||||||
|
memset(&item, 0, sizeof(item));
|
||||||
|
item.state = LVIS_SELECTED | LVIS_FOCUSED;
|
||||||
|
item.stateMask = LVIS_SELECTED | LVIS_FOCUSED;
|
||||||
|
res = SendMessageA(hwnd, LVM_SETITEMSTATE, 0, (LPARAM)&item);
|
||||||
|
expect(TRUE, res);
|
||||||
|
res = SendMessageA(hwnd, LVM_GETSELECTEDCOUNT, 0, 0);
|
||||||
|
expect(1, res);
|
||||||
|
|
||||||
|
res = SendMessageA(hwnd, LVM_SETSELECTIONMARK, 0, 0);
|
||||||
|
expect(0, res);
|
||||||
|
|
||||||
|
hold_key(VK_SHIFT);
|
||||||
|
|
||||||
|
res = SendMessageA(hwnd, WM_KEYDOWN, VK_DOWN, 0);
|
||||||
|
expect(0, res);
|
||||||
|
res = SendMessageA(hwnd, WM_KEYUP, VK_DOWN, 0);
|
||||||
|
expect(0, res);
|
||||||
|
|
||||||
|
res = SendMessageA(hwnd, LVM_GETSELECTEDCOUNT, 0, 0);
|
||||||
|
expect(2, res);
|
||||||
|
|
||||||
|
hold_key(VK_CONTROL);
|
||||||
|
|
||||||
|
res = SendMessageA(hwnd, WM_KEYDOWN, VK_DOWN, 0);
|
||||||
|
expect(0, res);
|
||||||
|
res = SendMessageA(hwnd, WM_KEYUP, VK_DOWN, 0);
|
||||||
|
expect(0, res);
|
||||||
|
|
||||||
|
release_key(VK_CONTROL);
|
||||||
|
release_key(VK_SHIFT);
|
||||||
|
|
||||||
|
res = SendMessageA(hwnd, LVM_GETSELECTEDCOUNT, 0, 0);
|
||||||
|
expect(3, res);
|
||||||
|
|
||||||
|
DestroyWindow(hwnd);
|
||||||
|
}
|
||||||
|
|
||||||
static void test_norecompute(void)
|
static void test_norecompute(void)
|
||||||
{
|
{
|
||||||
static CHAR testA[] = "test";
|
static CHAR testA[] = "test";
|
||||||
|
@ -6878,6 +6928,7 @@ START_TEST(listview)
|
||||||
test_subitem_rect();
|
test_subitem_rect();
|
||||||
test_sorting();
|
test_sorting();
|
||||||
test_ownerdata();
|
test_ownerdata();
|
||||||
|
test_ownerdata_multiselect();
|
||||||
test_norecompute();
|
test_norecompute();
|
||||||
test_nosortheader();
|
test_nosortheader();
|
||||||
test_setredraw();
|
test_setredraw();
|
||||||
|
@ -6937,6 +6988,7 @@ START_TEST(listview)
|
||||||
test_columns();
|
test_columns();
|
||||||
test_sorting();
|
test_sorting();
|
||||||
test_ownerdata();
|
test_ownerdata();
|
||||||
|
test_ownerdata_multiselect();
|
||||||
test_norecompute();
|
test_norecompute();
|
||||||
test_nosortheader();
|
test_nosortheader();
|
||||||
test_indentation();
|
test_indentation();
|
||||||
|
|
Loading…
Reference in New Issue