From a959f7d74bb64fa45143bd7e44530bb797d2b134 Mon Sep 17 00:00:00 2001 From: Dylan Smith Date: Fri, 17 Oct 2008 21:29:42 -0400 Subject: [PATCH] richedit: Tests for notifications while redraw is disabled. There were some notifications that weren't sent in ME_UpdateRepaint while redraw was disabled, so this verifies that they are not sent with redraw disabled. --- dlls/riched20/tests/editor.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index 63fb4404562..308c69afe9d 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -5184,6 +5184,15 @@ static void test_eventMask(void) ok(queriedEventMask == (eventMask & ~ENM_CHANGE), "wrong event mask (0x%x) during WM_COMMAND\n", queriedEventMask); + /* check to see if EN_CHANGE is sent when redraw is turned off */ + SendMessage(eventMaskEditHwnd, WM_CLEAR, 0, 0); + SendMessage(eventMaskEditHwnd, WM_SETREDRAW, FALSE, 0); + queriedEventMask = 0; /* initialize to something other than we expect */ + SendMessage(eventMaskEditHwnd, EM_REPLACESEL, 0, (LPARAM) text); + todo_wine ok(queriedEventMask == (eventMask & ~ENM_CHANGE), + "wrong event mask (0x%x) during WM_COMMAND\n", queriedEventMask); + SendMessage(eventMaskEditHwnd, WM_SETREDRAW, TRUE, 0); + DestroyWindow(parent); } @@ -5260,6 +5269,14 @@ static void test_WM_NOTIFY(void) ok(received_WM_NOTIFY == 1, "Expected WM_NOTIFY was NOT sent!\n"); ok(modify_at_WM_NOTIFY == 0, "WM_NOTIFY callback saw text flagged as modified!\n"); + /* Test for WM_NOTIFY messages with redraw disabled. */ + SendMessage(hwndRichedit_WM_NOTIFY, EM_SETSEL, 0, 0); + SendMessage(hwndRichedit_WM_NOTIFY, WM_SETREDRAW, FALSE, 0); + received_WM_NOTIFY = 0; + SendMessage(hwndRichedit_WM_NOTIFY, EM_REPLACESEL, FALSE, (LPARAM)"inserted"); + ok(received_WM_NOTIFY == 1, "Expected WM_NOTIFY was NOT sent!\n"); + SendMessage(hwndRichedit_WM_NOTIFY, WM_SETREDRAW, TRUE, 0); + DestroyWindow(hwndRichedit_WM_NOTIFY); DestroyWindow(parent); }