windows.media.speech: Return IAsyncAction from session_PauseAsync.

Signed-off-by: Bernhard Kölbl <besentv@gmail.com>
This commit is contained in:
Bernhard Kölbl 2022-05-03 20:04:11 +02:00 committed by Alexandre Julliard
parent d21b872a80
commit 4e88f093b0
2 changed files with 16 additions and 2 deletions

View file

@ -283,10 +283,15 @@ static HRESULT WINAPI session_CancelAsync( ISpeechContinuousRecognitionSession *
return E_NOTIMPL;
}
static HRESULT session_pause_async( IInspectable *invoker )
{
return S_OK;
}
static HRESULT WINAPI session_PauseAsync( ISpeechContinuousRecognitionSession *iface, IAsyncAction **action )
{
FIXME("iface %p, action %p stub!\n", iface, action);
return E_NOTIMPL;
return async_action_create(NULL, session_pause_async, action);
}
static HRESULT WINAPI session_Resume( ISpeechContinuousRecognitionSession *iface )

View file

@ -1761,6 +1761,15 @@ static void test_Recognition(void)
* TODO: Use a loopback device together with prerecorded audio files to test the recognizer's functionality.
*/
hr = ISpeechContinuousRecognitionSession_PauseAsync(session, &action2);
ok(hr == S_OK, "ISpeechContinuousRecognitionSession_PauseAsync failed, hr %#lx.\n", hr);
await_async_void(action2, &action_handler);
check_async_info((IInspectable *)action2, 3, Completed, S_OK);
IAsyncAction_Release(action2);
hr = ISpeechContinuousRecognitionSession_Resume(session);
todo_wine ok(hr == S_OK, "ISpeechContinuousRecognitionSession_Resume failed, hr %#lx.\n", hr);
hr = ISpeechContinuousRecognitionSession_StopAsync(session, &action2);
ok(hr == S_OK, "ISpeechContinuousRecognitionSession_StopAsync failed, hr %#lx.\n", hr);
@ -1792,7 +1801,7 @@ static void test_Recognition(void)
hr = IAsyncInfo_Close(info); /* If IAsyncInfo_Close would wait for the handler to finish, the test would get stuck here. */
ok(hr == S_OK, "IAsyncInfo_Close failed, hr %#lx.\n", hr);
check_async_info((IInspectable *)action2, 3, AsyncStatus_Closed, S_OK);
check_async_info((IInspectable *)action2, 4, AsyncStatus_Closed, S_OK);
set = SetEvent(action_handler.event_block);
ok(set == TRUE, "Event 'event_block' wasn't set.\n");