Module: wine Branch: master Commit: b25d49c6c16bd20371a5ea77fda477051794d162 URL: http://source.winehq.org/git/wine.git/?a=commit;h=b25d49c6c16bd20371a5ea77fd...
Author: Jacek Caban jacek@codeweavers.com Date: Sun Jul 31 16:44:43 2011 +0200
mshtml: Added semi-stub implementation of IHTMLWindow2::status property.
---
dlls/mshtml/htmlwindow.c | 18 ++++++++++++++---- dlls/mshtml/tests/dom.c | 27 +++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index ba292ab..465db09 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -491,15 +491,25 @@ static HRESULT WINAPI HTMLWindow2_get_defaultStatus(IHTMLWindow2 *iface, BSTR *p static HRESULT WINAPI HTMLWindow2_put_status(IHTMLWindow2 *iface, BSTR v) { HTMLWindow *This = impl_from_IHTMLWindow2(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + + WARN("(%p)->(%s)\n", This, debugstr_w(v)); + + /* + * FIXME: Since IE7, setting status is blocked, but still possible in certain circumstances. + * Ignoring the call should be enough for us. + */ + return S_OK; }
static HRESULT WINAPI HTMLWindow2_get_status(IHTMLWindow2 *iface, BSTR *p) { HTMLWindow *This = impl_from_IHTMLWindow2(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + /* See put_status */ + *p = NULL; + return S_OK; }
static HRESULT WINAPI HTMLWindow2_setTimeout(IHTMLWindow2 *iface, BSTR expression, diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 00fdb14..adffac2 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -1058,6 +1058,31 @@ static void _set_window_name(unsigned line, IHTMLWindow2 *window, const char *na _test_window_name(line, window, name); }
+#define test_window_status(d) _test_window_status(__LINE__,d) +static void _test_window_status(unsigned line, IHTMLWindow2 *window) +{ + BSTR status; + HRESULT hres; + + status = (void*)0xdeadbeef; + hres = IHTMLWindow2_get_status(window, &status); + ok_(__FILE__,line)(hres == S_OK, "get_status failed: %08x\n", hres); + ok_(__FILE__,line)(!status, "status = %s\n", wine_dbgstr_w(status)); + SysFreeString(status); +} + +#define set_window_status(w,n) _set_window_status(__LINE__,w,n) +static void _set_window_status(unsigned line, IHTMLWindow2 *window, const char *status) +{ + BSTR str; + HRESULT hres; + + str = a2bstr(status); + hres = IHTMLWindow2_put_status(window, str); + SysFreeString(str); + ok_(__FILE__,line)(hres == S_OK, "put_status failed: %08x\n", hres); +} + #define test_window_length(w,l) _test_window_length(__LINE__,w,l) static void _test_window_length(unsigned line, IHTMLWindow2 *window, LONG exlen) { @@ -4146,6 +4171,8 @@ static void test_window(IHTMLDocument2 *doc) set_window_name(window, "test"); test_window_length(window, 0); test_screen(window); + test_window_status(window); + set_window_status(window, "Test!");
IHTMLWindow2_Release(window); }