It's very unreliable; our window can receive messages not related to the ones we're trying to test.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/videorenderer.c | 38 ++++++++++++++++++++++--------- dlls/quartz/tests/vmr7.c | 38 ++++++++++++++++++++++--------- dlls/quartz/tests/vmr9.c | 38 ++++++++++++++++++++++--------- 3 files changed, 81 insertions(+), 33 deletions(-)
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index f4d9660316c..b6d91f86859 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -2109,28 +2109,40 @@ static void test_video_window_messages(IVideoWindow *window, HWND hwnd, HWND our
flush_events();
+ /* Demonstrate that messages should be sent, not posted, and that only some + * messages should be forwarded. A previous implementation unconditionally + * posted all messages. */ + hr = IVideoWindow_NotifyOwnerMessage(window, (OAHWND)our_hwnd, WM_SYSCOLORCHANGE, 0, 0); ok(hr == S_OK, "Got hr %#x.\n", hr);
- ret = GetQueueStatus(QS_SENDMESSAGE | QS_POSTMESSAGE); - ok(!ret, "Got unexpected status %#x.\n", ret); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) + { + ok(msg.message != WM_SYSCOLORCHANGE, "WM_SYSCOLORCHANGE should not be posted.\n"); + DispatchMessageA(&msg); + }
- hr = IVideoWindow_NotifyOwnerMessage(window, (OAHWND)our_hwnd, WM_SETCURSOR, - (WPARAM)hwnd, MAKELONG(HTCLIENT, WM_MOUSEMOVE)); + hr = IVideoWindow_NotifyOwnerMessage(window, (OAHWND)our_hwnd, WM_FONTCHANGE, 0, 0); ok(hr == S_OK, "Got hr %#x.\n", hr);
- ret = GetQueueStatus(QS_SENDMESSAGE | QS_POSTMESSAGE); - ok(!ret, "Got unexpected status %#x.\n", ret); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) + { + ok(msg.message != WM_FONTCHANGE, "WM_FONTCHANGE should not be posted.\n"); + DispatchMessageA(&msg); + }
params.window = window; params.hwnd = our_hwnd; params.message = WM_SYSCOLORCHANGE; thread = CreateThread(NULL, 0, notify_message_proc, ¶ms, 0, NULL); ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block.\n"); - ret = GetQueueStatus(QS_SENDMESSAGE | QS_POSTMESSAGE); - ok(ret == ((QS_SENDMESSAGE << 16) | QS_SENDMESSAGE), "Got unexpected status %#x.\n", ret);
- while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) + { + ok(msg.message != WM_SYSCOLORCHANGE, "WM_SYSCOLORCHANGE should not be posted.\n"); + DispatchMessageA(&msg); + } + ok(!WaitForSingleObject(thread, 1000), "Wait timed out.\n"); CloseHandle(thread);
@@ -2138,8 +2150,12 @@ static void test_video_window_messages(IVideoWindow *window, HWND hwnd, HWND our thread = CreateThread(NULL, 0, notify_message_proc, ¶ms, 0, NULL); ok(!WaitForSingleObject(thread, 1000), "Thread should not block.\n"); CloseHandle(thread); - ret = GetQueueStatus(QS_SENDMESSAGE | QS_POSTMESSAGE); - ok(!ret, "Got unexpected status %#x.\n", ret); + + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) + { + ok(msg.message != WM_FONTCHANGE, "WM_FONTCHANGE should not be posted.\n"); + DispatchMessageA(&msg); + }
hr = IVideoWindow_put_Owner(window, 0); ok(hr == S_OK, "Got hr %#x.\n", hr); diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index 212ce213e89..1394d81a2ce 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -2094,28 +2094,40 @@ static void test_video_window_messages(IVideoWindow *window, HWND hwnd, HWND our
flush_events();
+ /* Demonstrate that messages should be sent, not posted, and that only some + * messages should be forwarded. A previous implementation unconditionally + * posted all messages. */ + hr = IVideoWindow_NotifyOwnerMessage(window, (OAHWND)our_hwnd, WM_SYSCOLORCHANGE, 0, 0); ok(hr == S_OK, "Got hr %#x.\n", hr);
- ret = GetQueueStatus(QS_SENDMESSAGE | QS_POSTMESSAGE); - ok(!ret, "Got unexpected status %#x.\n", ret); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) + { + ok(msg.message != WM_SYSCOLORCHANGE, "WM_SYSCOLORCHANGE should not be posted.\n"); + DispatchMessageA(&msg); + }
- hr = IVideoWindow_NotifyOwnerMessage(window, (OAHWND)our_hwnd, WM_SETCURSOR, - (WPARAM)hwnd, MAKELONG(HTCLIENT, WM_MOUSEMOVE)); + hr = IVideoWindow_NotifyOwnerMessage(window, (OAHWND)our_hwnd, WM_FONTCHANGE, 0, 0); ok(hr == S_OK, "Got hr %#x.\n", hr);
- ret = GetQueueStatus(QS_SENDMESSAGE | QS_POSTMESSAGE); - ok(!ret, "Got unexpected status %#x.\n", ret); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) + { + ok(msg.message != WM_FONTCHANGE, "WM_FONTCHANGE should not be posted.\n"); + DispatchMessageA(&msg); + }
params.window = window; params.hwnd = our_hwnd; params.message = WM_SYSCOLORCHANGE; thread = CreateThread(NULL, 0, notify_message_proc, ¶ms, 0, NULL); ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block.\n"); - ret = MsgWaitForMultipleObjects(0, NULL, FALSE, 1000, QS_SENDMESSAGE); - ok(!ret, "Did not find a sent message.\n");
- while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) + { + ok(msg.message != WM_SYSCOLORCHANGE, "WM_SYSCOLORCHANGE should not be posted.\n"); + DispatchMessageA(&msg); + } + ok(!WaitForSingleObject(thread, 1000), "Wait timed out.\n"); CloseHandle(thread);
@@ -2123,8 +2135,12 @@ static void test_video_window_messages(IVideoWindow *window, HWND hwnd, HWND our thread = CreateThread(NULL, 0, notify_message_proc, ¶ms, 0, NULL); ok(!WaitForSingleObject(thread, 1000), "Thread should not block.\n"); CloseHandle(thread); - ret = GetQueueStatus(QS_SENDMESSAGE | QS_POSTMESSAGE); - ok(!ret, "Got unexpected status %#x.\n", ret); + + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) + { + ok(msg.message != WM_FONTCHANGE, "WM_FONTCHANGE should not be posted.\n"); + DispatchMessageA(&msg); + }
hr = IVideoWindow_put_Owner(window, 0); ok(hr == S_OK, "Got hr %#x.\n", hr); diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index 44b9a453305..f3365bd02d0 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -2333,28 +2333,40 @@ static void test_video_window_messages(IVideoWindow *window, HWND hwnd, HWND our
flush_events();
+ /* Demonstrate that messages should be sent, not posted, and that only some + * messages should be forwarded. A previous implementation unconditionally + * posted all messages. */ + hr = IVideoWindow_NotifyOwnerMessage(window, (OAHWND)our_hwnd, WM_SYSCOLORCHANGE, 0, 0); ok(hr == S_OK, "Got hr %#x.\n", hr);
- ret = GetQueueStatus(QS_SENDMESSAGE | QS_POSTMESSAGE); - ok(!ret, "Got unexpected status %#x.\n", ret); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) + { + ok(msg.message != WM_SYSCOLORCHANGE, "WM_SYSCOLORCHANGE should not be posted.\n"); + DispatchMessageA(&msg); + }
- hr = IVideoWindow_NotifyOwnerMessage(window, (OAHWND)our_hwnd, WM_SETCURSOR, - (WPARAM)hwnd, MAKELONG(HTCLIENT, WM_MOUSEMOVE)); + hr = IVideoWindow_NotifyOwnerMessage(window, (OAHWND)our_hwnd, WM_FONTCHANGE, 0, 0); ok(hr == S_OK, "Got hr %#x.\n", hr);
- ret = GetQueueStatus(QS_SENDMESSAGE | QS_POSTMESSAGE); - ok(!ret, "Got unexpected status %#x.\n", ret); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) + { + ok(msg.message != WM_FONTCHANGE, "WM_FONTCHANGE should not be posted.\n"); + DispatchMessageA(&msg); + }
params.window = window; params.hwnd = our_hwnd; params.message = WM_SYSCOLORCHANGE; thread = CreateThread(NULL, 0, notify_message_proc, ¶ms, 0, NULL); ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block.\n"); - ret = MsgWaitForMultipleObjects(0, NULL, FALSE, 1000, QS_SENDMESSAGE); - ok(!ret, "Did not find a sent message.\n");
- while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) + { + ok(msg.message != WM_SYSCOLORCHANGE, "WM_SYSCOLORCHANGE should not be posted.\n"); + DispatchMessageA(&msg); + } + ok(!WaitForSingleObject(thread, 1000), "Wait timed out.\n"); CloseHandle(thread);
@@ -2362,8 +2374,12 @@ static void test_video_window_messages(IVideoWindow *window, HWND hwnd, HWND our thread = CreateThread(NULL, 0, notify_message_proc, ¶ms, 0, NULL); ok(!WaitForSingleObject(thread, 1000), "Thread should not block.\n"); CloseHandle(thread); - ret = GetQueueStatus(QS_SENDMESSAGE | QS_POSTMESSAGE); - ok(!ret, "Got unexpected status %#x.\n", ret); + + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) + { + ok(msg.message != WM_FONTCHANGE, "WM_FONTCHANGE should not be posted.\n"); + DispatchMessageA(&msg); + }
hr = IVideoWindow_put_Owner(window, 0); ok(hr == S_OK, "Got hr %#x.\n", hr);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/videorenderer.c | 9 +++++++-- dlls/quartz/tests/vmr9.c | 6 +++++- 2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index b6d91f86859..b9c7a2eb5dc 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -971,7 +971,7 @@ static void test_flushing(IPin *pin, IMemInputPin *input, IMediaControl *control thread = send_frame(input); ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
- hr = IMediaControl_GetState(control, 0, &state); + hr = IMediaControl_GetState(control, 1000, &state); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IPin_BeginFlush(pin); @@ -1083,13 +1083,18 @@ static void test_sample_time(IBaseFilter *filter, IPin *pin, IMemInputPin *input hr = IPin_BeginFlush(pin); ok(hr == S_OK, "Got hr %#x.\n", hr); hr = join_thread(thread); - ok(hr == S_OK, "Got hr %#x.\n", hr); + /* If the frame makes it to Receive() in time to be rendered, we get S_OK. */ + ok(hr == S_OK || hr == S_FALSE, "Got hr %#x.\n", hr); hr = IPin_EndFlush(pin); ok(hr == S_OK, "Got hr %#x.\n", hr);
thread = send_frame_time(input, 1000000, 0xff); ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
+ /* wait for the sample to actually reach Receive() */ + hr = IMediaControl_GetState(control, 1000, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); ok(hr == S_OK, "Got hr %#x.\n", hr); hr = join_thread(thread); diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index f3365bd02d0..eb2c5bc47cc 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -1199,7 +1199,7 @@ static void test_flushing(IPin *pin, IMemInputPin *input, IMediaControl *control thread = send_frame(input); ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
- hr = IMediaControl_GetState(control, 0, &state); + hr = IMediaControl_GetState(control, 1000, &state); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IPin_BeginFlush(pin); @@ -1450,6 +1450,10 @@ static void test_sample_time(IPin *pin, IMemInputPin *input, IMediaControl *cont thread = send_frame_time(input, 1000000, 0x00ffff00); /* yellow */ ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
+ /* wait for the sample to actually reach Receive() */ + hr = IMediaControl_GetState(control, 1000, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); ok(hr == S_OK, "Got hr %#x.\n", hr); hr = join_thread(thread);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=90544
Your paranoid android.
=== w1064_tsign (32 bit report) ===
quartz: videorenderer.c:2152: Test failed: Wait timed out.
=== w10pro64_he (64 bit report) ===
quartz: videorenderer.c:1088: Test failed: Got hr 0x80004005. videorenderer.c:2152: Test failed: Wait timed out.
=== w10pro64_he (64 bit report) ===
quartz: vmr9.c:2375: Test failed: Wait timed out.
=== w10pro64_zh_CN (64 bit report) ===
quartz: vmr9.c:1461: Test failed: Got hr 0x80040227.
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=90543
Your paranoid android.
=== w1064_tsign (32 bit report) ===
quartz: videorenderer.c:1097: Test failed: Got hr 0x80004005.
=== w10pro64_ar (64 bit report) ===
quartz: videorenderer.c:1000: Test failed: Got hr 0x1.
=== w10pro64_ja (64 bit report) ===
quartz: videorenderer.c:976: Test failed: Got hr 0x40237. videorenderer.c:982: Test failed: Got hr 0x80004005. videorenderer.c:1087: Test failed: Got hr 0x80004005.
=== w10pro64_zh_CN (64 bit report) ===
quartz: videorenderer.c:2147: Test failed: Wait timed out.
=== w1064_tsign (32 bit report) ===
quartz: vmr9.c:2371: Test failed: Wait timed out.
=== w1064_tsign (64 bit report) ===
quartz: vmr9.c:2371: Test failed: Wait timed out.