[PATCH v4 0/1] MR6075: Add chevron visibility test to check the case of restoring band width to ideal value
I prepared fix https://gitlab.winehq.org/wine/wine/-/commit/b45ad56, that I didn't provide test for, but now I find a way to check it. -- v4: comctl32/test: Add rebar chevron visibility test. https://gitlab.winehq.org/wine/wine/-/merge_requests/6075
From: Ilia Docin <ilya.docin(a)contentai.ru> --- dlls/comctl32/tests/rebar.c | 48 +++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/tests/rebar.c b/dlls/comctl32/tests/rebar.c index 7cafa4ba52b..4291a712044 100644 --- a/dlls/comctl32/tests/rebar.c +++ b/dlls/comctl32/tests/rebar.c @@ -121,6 +121,7 @@ static HWND build_toolbar(int nr, HWND hParent) } static int g_parent_measureitem; +static RECT g_chevron_rect; static LRESULT CALLBACK parent_wndproc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -129,8 +130,17 @@ static LRESULT CALLBACK parent_wndproc(HWND hWnd, UINT msg, WPARAM wParam, LPARA case WM_NOTIFY: { NMHDR *lpnm = (NMHDR *)lParam; - if (lpnm->code == RBN_HEIGHTCHANGE) - GetClientRect(lpnm->hwndFrom, &height_change_notify_rect); + switch (lpnm->code) + { + case RBN_HEIGHTCHANGE: + GetClientRect(lpnm->hwndFrom, &height_change_notify_rect); + break; + case RBN_CHEVRONPUSHED: + g_chevron_rect = ((NMREBARCHEVRON *)lParam)->rc; + break; + default: + break; + } } break; case WM_MEASUREITEM: @@ -1178,6 +1188,39 @@ static void init_functions(void) #undef X } +static void test_chevron(void) +{ + HWND hRebar; + REBARBANDINFOA rbi; + + hRebar = create_rebar_control(0); + rbi.cbSize = REBARBANDINFOA_V6_SIZE; + rbi.fMask = RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_IDEALSIZE | RBBIM_SIZE | RBBIM_STYLE; + rbi.cxIdeal = 128; + rbi.cx = rbi.cxIdeal - 1; + rbi.cxMinChild = 100; + rbi.cyMinChild = rbi.cxMinChild; + rbi.hwndChild = build_toolbar(1, hRebar); + rbi.fStyle = RBBS_USECHEVRON | RBBS_NOGRIPPER; + SendMessageA(hRebar, RB_INSERTBANDA, 0, (LPARAM)&rbi); + SendMessageA(hRebar, RB_INSERTBANDA, 1, (LPARAM)&rbi); + + SetRectEmpty(&g_chevron_rect); + SendMessageA(hRebar, RB_PUSHCHEVRON, 0, 0); + ok(!IsRectEmpty(&g_chevron_rect), "Unexpected empty chevron rect\n"); + + /* increase band width to make it more then ideal value to hide chevron */ + rbi.fMask = RBBIM_SIZE; + rbi.cx = rbi.cxIdeal << 1; + SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rbi); + + SetRectEmpty(&g_chevron_rect); + SendMessageA(hRebar, RB_PUSHCHEVRON, 0, 0); + ok(IsRectEmpty(&g_chevron_rect), "Unexpected non-empty chevron rect\n"); + + DestroyWindow(hRebar); +} + START_TEST(rebar) { MSG msg; @@ -1201,6 +1244,7 @@ START_TEST(rebar) test_layout(); test_resize(); test_style(); + test_chevron(); out: PostQuitMessage(0); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6075
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details: The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=147651 Your paranoid android. === w10pro64_en_AE_u8 (32 bit report) === comctl32: rebar.c:958: Test failed: expected 35 for 38 from line 999 rebar.c:958: Test failed: expected 40 for 43 from line 1005 rebar.c:958: Test failed: expected 40 for 43 from line 1024
On Thu Jul 18 06:30:26 2024 +0000, Zhiyi Zhang wrote:
Please change the patch commit subject to "comctl32/test: Add rebar chevron visibility test." Sorry for the late response. Changed.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/6075#note_78228
On Fri Aug 9 19:30:02 2024 +0000, Ilia Docin wrote:
changed this line in [version 3 of the diff](/wine/wine/-/merge_requests/6075/diffs?diff_id=125789&start_sha=835428512767fee3e6e7d7b15287625e2d939764#382007f113cc98a69ffe5bb3875a73e4727dad0c_139_139) Added.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/6075#note_78229
On Fri Aug 9 19:30:04 2024 +0000, Ilia Docin wrote:
changed this line in [version 3 of the diff](/wine/wine/-/merge_requests/6075/diffs?diff_id=125789&start_sha=835428512767fee3e6e7d7b15287625e2d939764#382007f113cc98a69ffe5bb3875a73e4727dad0c_1200_1200) Fixed.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/6075#note_78230
On Fri Aug 9 19:30:04 2024 +0000, Ilia Docin wrote:
changed this line in [version 3 of the diff](/wine/wine/-/merge_requests/6075/diffs?diff_id=125789&start_sha=835428512767fee3e6e7d7b15287625e2d939764#382007f113cc98a69ffe5bb3875a73e4727dad0c_1212_1212) Done.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/6075#note_78231
participants (3)
-
Ilia Docin -
Ilia Docin (@IDocin) -
Marvin