From 1456122d0ec239b1e34bc409c560f0da4ce39f2a Mon Sep 17 00:00:00 2001 From: Sinitsin Ivan Date: Wed, 9 Jul 2008 17:16:38 +0400 Subject: [PATCH] add test for HTMLDocument_(Get|Put)Title --- dlls/mshtml/tests/htmldoc.c | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c index 4de5286..1eecb59 100644 --- a/dlls/mshtml/tests/htmldoc.c +++ b/dlls/mshtml/tests/htmldoc.c @@ -3664,6 +3664,32 @@ static void test_external(IUnknown *unk, BOOL initialized) IHTMLWindow2_Release(htmlwin); } +static void test_Title(IUnknown *unk) +{ + IHTMLDocument2 *htmldoc; + BSTR ptitle, gtitle; + const WCHAR title[] = { + 'H','T','M','L',' ','T','i','t','l','e',0}; + HRESULT hres; + + hres = IUnknown_QueryInterface(unk, &IID_IHTMLDocument2, (void**)&htmldoc); + ok(hres == S_OK, "QueryInterface(IID_IHTMLWindow2) failed: %08x\n", hres); + + ptitle = SysAllocString(title); + + hres = IHTMLDocument2_put_title(htmldoc, ptitle); + ok(hres == S_OK, "put_Title failed: %08x\n", hres); + + hres = IHTMLDocument2_get_title(htmldoc, >itle); + ok(hres == S_OK, "get_Title failed: %08x\n", hres); + + ok(!lstrcmpiW(ptitle, gtitle), "title not equal \n"); + + SysFreeString(ptitle); + SysFreeString(gtitle); + IHTMLDocument2_Release(htmldoc); +} + static void test_StreamLoad(IUnknown *unk) { IPersistStreamInit *init; @@ -3785,6 +3811,7 @@ static void test_HTMLDocument(BOOL do_load) test_OnAmbientPropertyChange(unk); test_Window(unk, TRUE); test_external(unk, TRUE); + if (do_load) test_Title(unk); test_UIDeactivate(); test_OleCommandTarget(unk); -- 1.5.4.5.GIT