Commit ca9e3586 authored by Angelo Haller's avatar Angelo Haller Committed by Alexandre Julliard

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: 's avatarAngelo Haller <angelo@szanni.org> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 2d784484
......@@ -3530,6 +3530,56 @@ static void test_ownerdata(void)
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 CHAR testA[] = "test";
......@@ -6878,6 +6928,7 @@ START_TEST(listview)
test_subitem_rect();
test_sorting();
test_ownerdata();
test_ownerdata_multiselect();
test_norecompute();
test_nosortheader();
test_setredraw();
......@@ -6937,6 +6988,7 @@ START_TEST(listview)
test_columns();
test_sorting();
test_ownerdata();
test_ownerdata_multiselect();
test_norecompute();
test_nosortheader();
test_indentation();
......
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