From: Angelo Haller angelo@szanni.org
Add a new test sequence for ownerdata listviews that logs solely item change notifications for single and multiple items changing. Use it in the ownerdata multiselect tests.
Signed-off-by: Angelo Haller angelo@szanni.org --- dlls/comctl32/tests/listview.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 124f463908e..6ac7f53137d 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -37,6 +37,7 @@ enum seq_index { PARENT_SEQ_INDEX, PARENT_FULL_SEQ_INDEX, PARENT_CD_SEQ_INDEX, + PARENT_ODSTATECHANGED_SEQ_INDEX, LISTVIEW_SEQ_INDEX, EDITBOX_SEQ_INDEX, COMBINED_SEQ_INDEX, @@ -254,6 +255,14 @@ static const struct message ownerdata_deselect_all_parent_seq[] = { { 0 } };
+static const struct message ownerdata_multiselect_odstatechanged_seq[] = { + { WM_NOTIFY, sent|id, 0, 0, LVN_ITEMCHANGED }, + { WM_NOTIFY, sent|id, 0, 0, LVN_ODSTATECHANGED }, + { WM_NOTIFY, sent|id, 0, 0, LVN_ITEMCHANGED }, + { WM_NOTIFY, sent|id, 0, 0, LVN_ITEMCHANGED }, + { 0 } +}; + static const struct message change_all_parent_seq[] = { { WM_NOTIFY, sent|id, 0, 0, LVN_ITEMCHANGING }, { WM_NOTIFY, sent|id, 0, 0, LVN_ITEMCHANGED }, @@ -523,6 +532,10 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP add_message(sequences, PARENT_SEQ_INDEX, &msg); add_message(sequences, COMBINED_SEQ_INDEX, &msg); } + /* log change messages for single and multiple items changing in ownerdata listviews */ + if (message == WM_NOTIFY && (msg.id == LVN_ITEMCHANGED || msg.id == LVN_ODSTATECHANGED)) + add_message(sequences, PARENT_ODSTATECHANGED_SEQ_INDEX, &msg); + add_message(sequences, PARENT_FULL_SEQ_INDEX, &msg);
switch (message) @@ -3556,8 +3569,15 @@ static void test_ownerdata_multiselect(void)
hold_key(VK_SHIFT);
+ flush_sequences(sequences, NUM_MSG_SEQUENCES); + res = SendMessageA(hwnd, WM_KEYDOWN, VK_DOWN, 0); expect(0, res); + + ok_sequence(sequences, PARENT_ODSTATECHANGED_SEQ_INDEX, + ownerdata_multiselect_odstatechanged_seq, + "ownerdata select multiple notification", TRUE); + res = SendMessageA(hwnd, WM_KEYUP, VK_DOWN, 0); expect(0, res);
@@ -3566,8 +3586,15 @@ static void test_ownerdata_multiselect(void)
hold_key(VK_CONTROL);
+ flush_sequences(sequences, NUM_MSG_SEQUENCES); + res = SendMessageA(hwnd, WM_KEYDOWN, VK_DOWN, 0); expect(0, res); + + ok_sequence(sequences, PARENT_ODSTATECHANGED_SEQ_INDEX, + ownerdata_multiselect_odstatechanged_seq, + "ownerdata select multiple notification", TRUE); + res = SendMessageA(hwnd, WM_KEYUP, VK_DOWN, 0); expect(0, res);