From: Andrey Turkin andrey.turkin@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=12457 Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- dlls/ieframe/tests/webbrowser.c | 15 +++++++++++++++ dlls/ieframe/webbrowser.c | 21 +++++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/dlls/ieframe/tests/webbrowser.c b/dlls/ieframe/tests/webbrowser.c index 9c2c393aaf..2408594ef7 100644 --- a/dlls/ieframe/tests/webbrowser.c +++ b/dlls/ieframe/tests/webbrowser.c @@ -256,6 +256,19 @@ static void _test_LocationURL(unsigned line, IWebBrowser2 *wb, const WCHAR *exur } }
+#define test_LocationName(a,b) _test_LocationName(__LINE__,a,b) +static void _test_LocationName(unsigned line, IWebBrowser2 *wb, const WCHAR *exname) +{ + BSTR name = (void*)0xdeadbeef; + HRESULT hres; + + hres = IWebBrowser2_get_LocationName(wb, &name); + ok_(__FILE__,line) (hres == (*exname ? S_OK : S_FALSE), "get_LocationName failed: %08x\n", hres); +todo_wine_if(!is_http && *exname) + ok_(__FILE__,line) (!lstrcmpW(name, exname), "expected %s, got %s\n", wine_dbgstr_w(exname), wine_dbgstr_w(name)); + SysFreeString(name); +} + #define test_ready_state(a,b) _test_ready_state(__LINE__,a,b) static void _test_ready_state(unsigned line, READYSTATE exstate, VARIANT_BOOL expect_busy) { @@ -2791,11 +2804,13 @@ static void test_ConnectionPoint(IWebBrowser2 *unk, BOOL init)
static void test_Navigate2(IWebBrowser2 *webbrowser, const WCHAR *nav_url) { + const WCHAR *title = L"WineHQ - Run Windows applications on Linux, BSD, Solaris and Mac OS X"; VARIANT url; BOOL is_file; HRESULT hres;
test_LocationURL(webbrowser, is_first_load ? L"" : current_url); + test_LocationName(webbrowser, is_first_load ? L"" : (is_http ? title : current_url)); test_ready_state(is_first_load ? READYSTATE_UNINITIALIZED : READYSTATE_COMPLETE, VARIANT_FALSE);
is_http = !memcmp(nav_url, "http:", 5); diff --git a/dlls/ieframe/webbrowser.c b/dlls/ieframe/webbrowser.c index 87b74b8e01..965cd5f0ee 100644 --- a/dlls/ieframe/webbrowser.c +++ b/dlls/ieframe/webbrowser.c @@ -539,8 +539,25 @@ static HRESULT WINAPI WebBrowser_put_Height(IWebBrowser2 *iface, LONG Height) static HRESULT WINAPI WebBrowser_get_LocationName(IWebBrowser2 *iface, BSTR *LocationName) { WebBrowser *This = impl_from_IWebBrowser2(iface); - FIXME("(%p)->(%p)\n", This, LocationName); - return E_NOTIMPL; + IHTMLDocument2 *doc; + HRESULT hres; + + TRACE("(%p)->(%p)\n", This, LocationName); + + if(This->doc_host.document && + SUCCEEDED(IUnknown_QueryInterface(This->doc_host.document, &IID_IHTMLDocument2, (void **)&doc))) { + hres = IHTMLDocument2_get_title(doc, LocationName); + IHTMLDocument2_Release(doc); + } else if(This->doc_host.url) { + *LocationName = SysAllocString(This->doc_host.url); + hres = S_OK; + } else { + static const WCHAR null_char = 0; + *LocationName = SysAllocString(&null_char); + hres = S_FALSE; + } + + return hres; }
static HRESULT WINAPI WebBrowser_get_LocationURL(IWebBrowser2 *iface, BSTR *LocationURL)
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=78609
Your paranoid android.
=== w8adm (32 bit report) ===
ieframe: webbrowser.c:1048: Test failed: unexpected dispIdMember 271 webbrowser.c:1676: Test failed: unexpected call TranslateUrl webbrowser.c:471: Test failed: unexpected nCmdID 14 webbrowser.c:1690: Test failed: unexpected call GetOverridesKeyPath webbrowser: Timeout
=== w1064v1507 (32 bit report) ===
ieframe: webbrowser.c:493: Test failed: unexpected nCmdID 183 webbrowser.c:1048: Test failed: unexpected dispIdMember 271 webbrowser.c:1676: Test failed: unexpected call TranslateUrl webbrowser.c:471: Test failed: unexpected nCmdID 14 webbrowser.c:1690: Test failed: unexpected call GetOverridesKeyPath webbrowser: Timeout
=== w10pro64 (32 bit report) ===
ieframe: webbrowser.c:2813: Test failed: expected L"WineHQ - Run Windows applications on Linux, BSD, Solaris and Mac OS X", got L"http://test.winehq.org/tests/winehq_snapshot/" webbrowser.c:2813: Test failed: expected L"WineHQ - Run Windows applications on Linux, BSD, Solaris and Mac OS X", got L"http://test.winehq.org/tests/winehq_snapshot/"
=== w10pro64_2scr (32 bit report) ===
ieframe: webbrowser.c:2813: Test failed: expected L"WineHQ - Run Windows applications on Linux, BSD, Solaris and Mac OS X", got L"http://test.winehq.org/tests/winehq_snapshot/" webbrowser.c:2813: Test failed: expected L"WineHQ - Run Windows applications on Linux, BSD, Solaris and Mac OS X", got L"http://test.winehq.org/tests/winehq_snapshot/"
=== w10pro64_ar (32 bit report) ===
ieframe: webbrowser.c:2813: Test failed: expected L"WineHQ - Run Windows applications on Linux, BSD, Solaris and Mac OS X", got L"http://test.winehq.org/tests/winehq_snapshot/" webbrowser.c:2813: Test failed: expected L"WineHQ - Run Windows applications on Linux, BSD, Solaris and Mac OS X", got L"http://test.winehq.org/tests/winehq_snapshot/"
=== w1064v1507 (64 bit report) ===
ieframe: webbrowser.c:493: Test failed: unexpected nCmdID 183 webbrowser.c:1048: Test failed: unexpected dispIdMember 271 webbrowser.c:1676: Test failed: unexpected call TranslateUrl webbrowser.c:471: Test failed: unexpected nCmdID 14 webbrowser.c:1690: Test failed: unexpected call GetOverridesKeyPath webbrowser: Timeout
=== w10pro64 (64 bit report) ===
ieframe: webbrowser.c:2813: Test failed: expected L"WineHQ - Run Windows applications on Linux, BSD, Solaris and Mac OS X", got L"http://test.winehq.org/tests/winehq_snapshot/" webbrowser.c:2813: Test failed: expected L"WineHQ - Run Windows applications on Linux, BSD, Solaris and Mac OS X", got L"http://test.winehq.org/tests/winehq_snapshot/"
=== w10pro64_2scr (64 bit report) ===
ieframe: webbrowser.c:2813: Test failed: expected L"WineHQ - Run Windows applications on Linux, BSD, Solaris and Mac OS X", got L"http://test.winehq.org/tests/winehq_snapshot/" webbrowser.c:2813: Test failed: expected L"WineHQ - Run Windows applications on Linux, BSD, Solaris and Mac OS X", got L"http://test.winehq.org/tests/winehq_snapshot/"
=== w10pro64_ar (64 bit report) ===
ieframe: webbrowser.c:2813: Test failed: expected L"WineHQ - Run Windows applications on Linux, BSD, Solaris and Mac OS X", got L"http://test.winehq.org/tests/winehq_snapshot/" webbrowser.c:2813: Test failed: expected L"WineHQ - Run Windows applications on Linux, BSD, Solaris and Mac OS X", got L"http://test.winehq.org/tests/winehq_snapshot/"