-- v2: shell32/tests: Increase sleep time for autocomplete tests if necessary. shell32/tests: Workaround moving cursor to (0,0) coordinates.
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54090 Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/shell32/tests/autocomplete.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/shell32/tests/autocomplete.c b/dlls/shell32/tests/autocomplete.c index d0df5b225c1..061735ebde4 100644 --- a/dlls/shell32/tests/autocomplete.c +++ b/dlls/shell32/tests/autocomplete.c @@ -828,10 +828,13 @@ START_TEST(autocomplete) ok(hMainWnd != NULL, "Failed to create parent window. Tests aborted.\n"); if (!hMainWnd) return;
- /* Move the cursor away from the dropdown listbox */ + /* Move the cursor away from the dropdown listbox... + * SetCursorPos(0, 0) does not seem to work, and setting it across multiple displays + * is bugged (on Windows), but setting it twice seems to work-around that problem */ GetWindowRect(hMainWnd, &win_rect); GetCursorPos(&orig_pos); - SetCursorPos(win_rect.left, win_rect.top); + SetCursorPos(win_rect.left ? win_rect.left : 1, win_rect.top ? win_rect.top : 1); + SetCursorPos(win_rect.left ? win_rect.left : 1, win_rect.top ? win_rect.top : 1);
test_invalid_init(); ac = test_init(); @@ -850,6 +853,7 @@ START_TEST(autocomplete) IAutoComplete_Release(ac);
cleanup: + SetCursorPos(orig_pos.x, orig_pos.y); SetCursorPos(orig_pos.x, orig_pos.y); DestroyWindow(hEdit); DestroyWindow(hMainWnd);
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53202 Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/shell32/tests/autocomplete.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/shell32/tests/autocomplete.c b/dlls/shell32/tests/autocomplete.c index 061735ebde4..dacb25ec063 100644 --- a/dlls/shell32/tests/autocomplete.c +++ b/dlls/shell32/tests/autocomplete.c @@ -438,10 +438,11 @@ static HRESULT string_enumerator_create(void **ppv, WCHAR **suggestions, int cou return S_OK; }
+static DWORD dispatch_messages_sleep = 33; static void dispatch_messages(void) { MSG msg; - Sleep(33); + Sleep(dispatch_messages_sleep); while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); @@ -730,6 +731,12 @@ static void test_custom_source(void) SendMessageW(hwnd_edit, WM_CHAR, 'u', 1); dispatch_messages(); SendMessageW(hwnd_edit, WM_GETTEXT, ARRAY_SIZE(buffer), (LPARAM)buffer); + if(!lstrcmpW(buffer, L"au")) { + /* increase sleep time to avoid rare failures on Windows */ + dispatch_messages_sleep += 200; + dispatch_messages(); + SendMessageW(hwnd_edit, WM_GETTEXT, ARRAY_SIZE(buffer), (LPARAM)buffer); + } ok(lstrcmpW(str_beta, buffer) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str_beta), wine_dbgstr_w(buffer)); ok(obj->num_resets == 1, "Expected 1 reset, got %u\n", obj->num_resets); SendMessageW(hwnd_edit, EM_SETSEL, 0, -1);
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=128200
Your paranoid android.
=== w1064v1809 (32 bit report) ===
shell32: autocomplete.c:637: Test failed: Expected L"www.ac", got L"www.a" autocomplete.c:638: Test failed: AutoComplete DropDown not visible autocomplete.c:638: Test failed: AutoComplete DropDown not visible autocomplete.c:638: Test failed: Expected L"https://www.ac", got (null) autocomplete.c:638: Test failed: AutoComplete DropDown not visible autocomplete.c:638: Test failed: Expected L"http://www.add", got (null) autocomplete.c:638: Test failed: AutoComplete DropDown not visible autocomplete.c:638: Test failed: Expected L"www.ax", got (null) autocomplete.c:638: Test failed: AutoComplete DropDown not visible
=== w10pro64_en_AE_u8 (64 bit report) ===
shell32: autocomplete.c:667: Test failed: Expected L"http://a0", got L"http://a" autocomplete.c:668: Test failed: AutoComplete DropDown not visible autocomplete.c:668: Test failed: AutoComplete DropDown not visible autocomplete.c:668: Test failed: Expected L"http://a0", got (null) autocomplete.c:668: Test failed: AutoComplete DropDown not visible autocomplete.c:668: Test failed: Expected L"http://abc.aa.com", got (null) autocomplete.c:668: Test failed: AutoComplete DropDown not visible
=== w10pro64_zh_CN (64 bit report) ===
shell32: autocomplete.c:614: Test failed: Expected L"a0", got L"a" autocomplete.c:615: Test failed: AutoComplete DropDown not visible autocomplete.c:615: Test failed: AutoComplete DropDown not visible autocomplete.c:615: Test failed: Expected L"http://a0", got (null) autocomplete.c:615: Test failed: AutoComplete DropDown not visible autocomplete.c:615: Test failed: Expected L"aa", got (null) autocomplete.c:615: Test failed: AutoComplete DropDown not visible autocomplete.c:615: Test failed: Expected L"ab", got (null) autocomplete.c:615: Test failed: AutoComplete DropDown not visible autocomplete.c:615: Test failed: Expected L"http://abc.aa.com", got (null) autocomplete.c:615: Test failed: AutoComplete DropDown not visible autocomplete.c:615: Test failed: Expected L"https://www.ac", got (null) autocomplete.c:615: Test failed: AutoComplete DropDown not visible autocomplete.c:615: Test failed: Expected L"http://www.add", got (null) autocomplete.c:615: Test failed: AutoComplete DropDown not visible autocomplete.c:615: Test failed: Expected L"www.ax", got (null) autocomplete.c:615: Test failed: AutoComplete DropDown not visible autocomplete.c:623: Test failed: AutoComplete DropDown not visible autocomplete.c:623: Test failed: AutoComplete DropDown not visible autocomplete.c:623: Test failed: Expected L"ab", got (null) autocomplete.c:623: Test failed: AutoComplete DropDown not visible autocomplete.c:623: Test failed: Expected L"http://abc.aa.com", got (null) autocomplete.c:623: Test failed: AutoComplete DropDown not visible autocomplete.c:630: Test failed: Expected L"abc.aa.com", got L"abc" autocomplete.c:637: Test failed: Expected L"www.ac", got L"www.a" autocomplete.c:638: Test failed: AutoComplete DropDown not visible autocomplete.c:638: Test failed: AutoComplete DropDown not visible autocomplete.c:638: Test failed: Expected L"https://www.ac", got (null) autocomplete.c:638: Test failed: AutoComplete DropDown not visible autocomplete.c:638: Test failed: Expected L"http://www.add", got (null) autocomplete.c:638: Test failed: AutoComplete DropDown not visible autocomplete.c:638: Test failed: Expected L"www.ax", got (null) autocomplete.c:638: Test failed: AutoComplete DropDown not visible autocomplete.c:644: Test failed: Expected L"www.www.?", got L"www.w" autocomplete.c:650: Test failed: Expected L"hfoo", got L"h" autocomplete.c:651: Test failed: AutoComplete DropDown not visible autocomplete.c:651: Test failed: AutoComplete DropDown not visible autocomplete.c:651: Test failed: Expected L"hfoo", got (null) autocomplete.c:651: Test failed: AutoComplete DropDown not visible autocomplete.c:651: Test failed: Expected L"https://hta", got (null) autocomplete.c:651: Test failed: AutoComplete DropDown not visible autocomplete.c:654: Test failed: Expected L"hta", got L"ht" autocomplete.c:655: Test failed: AutoComplete DropDown not visible autocomplete.c:655: Test failed: AutoComplete DropDown not visible autocomplete.c:655: Test failed: Expected L"https://hta", got (null) autocomplete.c:655: Test failed: AutoComplete DropDown not visible autocomplete.c:667: Test failed: Expected L"http://a0", got L"http://a" autocomplete.c:668: Test failed: AutoComplete DropDown not visible autocomplete.c:668: Test failed: AutoComplete DropDown not visible autocomplete.c:668: Test failed: Expected L"http://a0", got (null) autocomplete.c:668: Test failed: AutoComplete DropDown not visible autocomplete.c:668: Test failed: Expected L"http://abc.aa.com", got (null) autocomplete.c:668: Test failed: AutoComplete DropDown not visible autocomplete.c:675: Test failed: AutoComplete DropDown not visible autocomplete.c:675: Test failed: AutoComplete DropDown not visible autocomplete.c:675: Test failed: Expected L"http://a0", got (null) autocomplete.c:675: Test failed: AutoComplete DropDown not visible autocomplete.c:675: Test failed: Expected L"http://abc.aa.com", got (null) autocomplete.c:675: Test failed: AutoComplete DropDown not visible autocomplete.c:681: Test failed: AutoComplete DropDown not visible autocomplete.c:681: Test failed: AutoComplete DropDown not visible autocomplete.c:681: Test failed: Expected L"file://aa", got (null) autocomplete.c:681: Test failed: AutoComplete DropDown not visible autocomplete.c:681: Test failed: Expected L"ftp://abc", got (null) autocomplete.c:681: Test failed: AutoComplete DropDown not visible autocomplete.c:681: Test failed: Expected L"ftp://www.aa", got (null) autocomplete.c:681: Test failed: AutoComplete DropDown not visible autocomplete.c:685: Test failed: AutoComplete DropDown not visible autocomplete.c:685: Test failed: AutoComplete DropDown not visible autocomplete.c:685: Test failed: Expected L"file://aa", got (null) autocomplete.c:685: Test failed: AutoComplete DropDown not visible
Evidently, this wasn't totally fixed. Apparently, setting the cursor twice on multi-monitor setups is necessary, see: https://stackoverflow.com/questions/65519784/why-does-setcursorpos-reset-the...
The other issue is that sometimes rarely on Windows, it seems it doesn't autocomplete, but we use a sleep to check for it (it's not possible to check reliably, unfortunately). So as a workaround, I've increased the sleep but only if it fails the first time.
Hopefully these new commits Are a lot more robust. They don't fix all the rare failures, though.
On Fri Jan 6 18:10:51 2023 +0000, **** wrote:
Marvin replied on the mailing list:
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=128200 Your paranoid android. === w1064v1809 (32 bit report) === shell32: autocomplete.c:637: Test failed: Expected L"www.ac", got L"www.a" autocomplete.c:638: Test failed: AutoComplete DropDown not visible autocomplete.c:638: Test failed: AutoComplete DropDown not visible autocomplete.c:638: Test failed: Expected L"https://www.ac", got (null) autocomplete.c:638: Test failed: AutoComplete DropDown not visible autocomplete.c:638: Test failed: Expected L"http://www.add", got (null) autocomplete.c:638: Test failed: AutoComplete DropDown not visible autocomplete.c:638: Test failed: Expected L"www.ax", got (null) autocomplete.c:638: Test failed: AutoComplete DropDown not visible === w10pro64_en_AE_u8 (64 bit report) === shell32: autocomplete.c:667: Test failed: Expected L"http://a0", got L"http://a" autocomplete.c:668: Test failed: AutoComplete DropDown not visible autocomplete.c:668: Test failed: AutoComplete DropDown not visible autocomplete.c:668: Test failed: Expected L"http://a0", got (null) autocomplete.c:668: Test failed: AutoComplete DropDown not visible autocomplete.c:668: Test failed: Expected L"http://abc.aa.com", got (null) autocomplete.c:668: Test failed: AutoComplete DropDown not visible === w10pro64_zh_CN (64 bit report) === shell32: autocomplete.c:614: Test failed: Expected L"a0", got L"a" autocomplete.c:615: Test failed: AutoComplete DropDown not visible autocomplete.c:615: Test failed: AutoComplete DropDown not visible autocomplete.c:615: Test failed: Expected L"http://a0", got (null) autocomplete.c:615: Test failed: AutoComplete DropDown not visible autocomplete.c:615: Test failed: Expected L"aa", got (null) autocomplete.c:615: Test failed: AutoComplete DropDown not visible autocomplete.c:615: Test failed: Expected L"ab", got (null) autocomplete.c:615: Test failed: AutoComplete DropDown not visible autocomplete.c:615: Test failed: Expected L"http://abc.aa.com", got (null) autocomplete.c:615: Test failed: AutoComplete DropDown not visible autocomplete.c:615: Test failed: Expected L"https://www.ac", got (null) autocomplete.c:615: Test failed: AutoComplete DropDown not visible autocomplete.c:615: Test failed: Expected L"http://www.add", got (null) autocomplete.c:615: Test failed: AutoComplete DropDown not visible autocomplete.c:615: Test failed: Expected L"www.ax", got (null) autocomplete.c:615: Test failed: AutoComplete DropDown not visible autocomplete.c:623: Test failed: AutoComplete DropDown not visible autocomplete.c:623: Test failed: AutoComplete DropDown not visible autocomplete.c:623: Test failed: Expected L"ab", got (null) autocomplete.c:623: Test failed: AutoComplete DropDown not visible autocomplete.c:623: Test failed: Expected L"http://abc.aa.com", got (null) autocomplete.c:623: Test failed: AutoComplete DropDown not visible autocomplete.c:630: Test failed: Expected L"abc.aa.com", got L"abc" autocomplete.c:637: Test failed: Expected L"www.ac", got L"www.a" autocomplete.c:638: Test failed: AutoComplete DropDown not visible autocomplete.c:638: Test failed: AutoComplete DropDown not visible autocomplete.c:638: Test failed: Expected L"https://www.ac", got (null) autocomplete.c:638: Test failed: AutoComplete DropDown not visible autocomplete.c:638: Test failed: Expected L"http://www.add", got (null) autocomplete.c:638: Test failed: AutoComplete DropDown not visible autocomplete.c:638: Test failed: Expected L"www.ax", got (null) autocomplete.c:638: Test failed: AutoComplete DropDown not visible autocomplete.c:644: Test failed: Expected L"www.www.?", got L"www.w" autocomplete.c:650: Test failed: Expected L"hfoo", got L"h" autocomplete.c:651: Test failed: AutoComplete DropDown not visible autocomplete.c:651: Test failed: AutoComplete DropDown not visible autocomplete.c:651: Test failed: Expected L"hfoo", got (null) autocomplete.c:651: Test failed: AutoComplete DropDown not visible autocomplete.c:651: Test failed: Expected L"https://hta", got (null) autocomplete.c:651: Test failed: AutoComplete DropDown not visible autocomplete.c:654: Test failed: Expected L"hta", got L"ht" autocomplete.c:655: Test failed: AutoComplete DropDown not visible autocomplete.c:655: Test failed: AutoComplete DropDown not visible autocomplete.c:655: Test failed: Expected L"https://hta", got (null) autocomplete.c:655: Test failed: AutoComplete DropDown not visible autocomplete.c:667: Test failed: Expected L"http://a0", got L"http://a" autocomplete.c:668: Test failed: AutoComplete DropDown not visible autocomplete.c:668: Test failed: AutoComplete DropDown not visible autocomplete.c:668: Test failed: Expected L"http://a0", got (null) autocomplete.c:668: Test failed: AutoComplete DropDown not visible autocomplete.c:668: Test failed: Expected L"http://abc.aa.com", got (null) autocomplete.c:668: Test failed: AutoComplete DropDown not visible autocomplete.c:675: Test failed: AutoComplete DropDown not visible autocomplete.c:675: Test failed: AutoComplete DropDown not visible autocomplete.c:675: Test failed: Expected L"http://a0", got (null) autocomplete.c:675: Test failed: AutoComplete DropDown not visible autocomplete.c:675: Test failed: Expected L"http://abc.aa.com", got (null) autocomplete.c:675: Test failed: AutoComplete DropDown not visible autocomplete.c:681: Test failed: AutoComplete DropDown not visible autocomplete.c:681: Test failed: AutoComplete DropDown not visible autocomplete.c:681: Test failed: Expected L"file://aa", got (null) autocomplete.c:681: Test failed: AutoComplete DropDown not visible autocomplete.c:681: Test failed: Expected L"ftp://abc", got (null) autocomplete.c:681: Test failed: AutoComplete DropDown not visible autocomplete.c:681: Test failed: Expected L"ftp://www.aa", got (null) autocomplete.c:681: Test failed: AutoComplete DropDown not visible autocomplete.c:685: Test failed: AutoComplete DropDown not visible autocomplete.c:685: Test failed: AutoComplete DropDown not visible autocomplete.c:685: Test failed: Expected L"file://aa", got (null) autocomplete.c:685: Test failed: AutoComplete DropDown not visible
Of course, there are still rare failures. These failures don't seem specifically triggered by these changes, since they just make it more robust (setting cursor twice / avoiding 0,0 and increasing sleep time if necessary).
It's a step forward at least; the failures with multiple displays and the ones where it didn't autocomplete (bug 53202) seem gone.