Module: wine Branch: master Commit: 20163e034a45eaf1327fc7f0f2e0f2a5d6ca0926 URL: http://source.winehq.org/git/wine.git/?a=commit;h=20163e034a45eaf1327fc7f0f2...
Author: Jacek Caban jacek@codeweavers.com Date: Fri Feb 22 11:33:49 2008 +0100
shdocvw: Added get_LocationURL implementation.
---
dlls/shdocvw/tests/webbrowser.c | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/dlls/shdocvw/tests/webbrowser.c b/dlls/shdocvw/tests/webbrowser.c index 80c09f2..2dedbf3 100644 --- a/dlls/shdocvw/tests/webbrowser.c +++ b/dlls/shdocvw/tests/webbrowser.c @@ -105,6 +105,7 @@ DEFINE_EXPECT(QueryStatus_SETPROGRESSTEXT);
static const WCHAR wszItem[] = {'i','t','e','m',0}; static const WCHAR about_blankW[] = {'a','b','o','u','t',':','b','l','a','n','k',0}; +static const WCHAR emptyW[] = {0};
static VARIANT_BOOL exvb; static IWebBrowser2 *wb; @@ -132,6 +133,26 @@ static const char *debugstr_guid(REFIID riid) return buf; }
+#define test_LocationURL(a,b) _test_LocationURL(__LINE__,a,b) +static void _test_LocationURL(unsigned line, IUnknown *unk, LPCWSTR exurl) +{ + IWebBrowser2 *wb; + BSTR url = (void*)0xdeadbeef; + HRESULT hres; + + hres = IUnknown_QueryInterface(unk, &IID_IWebBrowser2, (void**)&wb); + ok(hres == S_OK, "Could not get IWebBrowser2 interface: %08x\n", hres); + if(FAILED(hres)) + return; + + hres = IWebBrowser2_get_LocationURL(wb, &url); + ok_(__FILE__,line) (hres == (*exurl ? S_OK : S_FALSE), "get_LocationURL failed: %08x\n", hres); + ok_(__FILE__,line) (!lstrcmpW(url, exurl), "unexpected URL: %s\n", debugstr_w(url)); + + SysFreeString(url); + IWebBrowser2_Release(wb); +} + static HRESULT QueryInterface(REFIID,void**);
static HRESULT WINAPI OleCommandTarget_QueryInterface(IOleCommandTarget *iface, @@ -1845,6 +1866,8 @@ static void test_Navigate2(IUnknown *unk) if(FAILED(hres)) return;
+ test_LocationURL(unk, emptyW); + V_VT(&url) = VT_BSTR; V_BSTR(&url) = SysAllocString(about_blankW);
@@ -1943,6 +1966,7 @@ static void test_WebBrowser(void)
test_QueryInterface(unk); test_ClassInfo(unk); + test_LocationURL(unk, emptyW); test_ConnectionPoint(unk, TRUE); test_ClientSite(unk, &ClientSite); test_Extent(unk);