Commit 9cf9d201 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLWindow2::toString implementation.

parent f6b84641
......@@ -745,8 +745,16 @@ static HRESULT WINAPI HTMLWindow2_execScript(IHTMLWindow2 *iface, BSTR scode, BS
static HRESULT WINAPI HTMLWindow2_toString(IHTMLWindow2 *iface, BSTR *String)
{
HTMLWindow *This = HTMLWINDOW2_THIS(iface);
FIXME("(%p)->(%p)\n", This, String);
return E_NOTIMPL;
static const WCHAR objectW[] = {'[','o','b','j','e','c','t',']',0};
TRACE("(%p)->(%p)\n", This, String);
if(!String)
return E_INVALIDARG;
*String = SysAllocString(objectW);
return *String ? S_OK : E_OUTOFMEMORY;
}
static HRESULT WINAPI HTMLWindow2_scrollBy(IHTMLWindow2 *iface, LONG x, LONG y)
......
......@@ -3959,6 +3959,7 @@ static void test_window(IHTMLDocument2 *doc)
IHTMLWindow2 *window, *window2, *self;
IHTMLDocument2 *doc2 = NULL;
IDispatch *disp;
BSTR str;
HRESULT hres;
hres = IHTMLDocument2_get_parentWindow(doc, &window);
......@@ -3991,6 +3992,15 @@ static void test_window(IHTMLDocument2 *doc)
ok(disp == (void*)window, "disp != window\n");
IDispatch_Release(disp);
hres = IHTMLWindow2_toString(window, NULL);
ok(hres == E_INVALIDARG, "toString failed: %08x\n", hres);
str = NULL;
hres = IHTMLWindow2_toString(window, &str);
ok(hres == S_OK, "toString failed: %08x\n", hres);
ok(!strcmp_wa(str, "[object]"), "toString returned %s\n", wine_dbgstr_w(str));
SysFreeString(str);
IHTMLWindow2_Release(window);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment