Signed-off-by: Jactry Zeng jzeng@codeweavers.com --- dlls/riched20/tests/txtsrv.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/dlls/riched20/tests/txtsrv.c b/dlls/riched20/tests/txtsrv.c index 1f789da8a37..741e3d0baf2 100644 --- a/dlls/riched20/tests/txtsrv.c +++ b/dlls/riched20/tests/txtsrv.c @@ -1169,6 +1169,11 @@ static void test_notifications( void ) HRESULT hr; RECT client = { 0, 0, 100, 100 }; ITextHostTestImpl *host_impl; + const WCHAR *expected_string; + IOleClientSite *clientsite; + IRichEditOle *reole; + WCHAR buffer[1024]; + REOBJECT reobject;
init_texthost( &txtserv, &host ); host_impl = impl_from_ITextHost( host ); @@ -1212,6 +1217,23 @@ static void test_notifications( void ) ok( hr == S_OK, "got %08x\n", hr ); ok( en_update_sent == 1, "got %d\n", en_update_sent );
+ expected_string = L"abc defg"; + hr = ITextServices_TxSetText( txtserv, L"abcdefg" ); + ok( hr == S_OK, "Got hr: %#x.\n", hr ); + hr = ITextServices_QueryInterface( txtserv, &IID_IRichEditOle, (void **)&reole ); + ok( hr == S_OK, "Got hr: %#x.\n", hr ); + hr = IRichEditOle_GetClientSite( reole, &clientsite ); + ok( hr == S_OK, "Got hr: %#x.\n", hr ); + fill_reobject_struct( &reobject, 3, NULL, NULL, clientsite, 10, 10, DVASPECT_CONTENT, 0, 1 ); + hr = IRichEditOle_InsertObject( reole, &reobject ); + ok( hr == S_OK, "Got hr: %#x.\n", hr ); + hr = ITextServices_TxSendMessage( txtserv, WM_GETTEXT, sizeof(buffer), (LPARAM)buffer, &res ); + ok( hr == S_OK, "Got hr %#x.\n", hr ); + ok( lstrlenW( buffer ) == lstrlenW( expected_string ), "Got wrong length: %d.\n", lstrlenW( buffer ) ); + todo_wine ok( !lstrcmpW( buffer, expected_string ), "Got wrong content: %s.\n", debugstr_w( buffer ) ); + IOleClientSite_Release( clientsite ); + IRichEditOle_Release( reole ); + DestroyWindow( host_impl->window ); ITextServices_Release( txtserv ); ITextHost_Release( host );