mshtml: Added IHTMLScriptElement::get_text implementation.

This commit is contained in:
Jacek Caban 2012-11-13 13:35:49 +01:00 committed by Alexandre Julliard
parent e9e09b66a0
commit 95f3c6402a
2 changed files with 23 additions and 3 deletions

View File

@ -199,8 +199,14 @@ static HRESULT WINAPI HTMLScriptElement_put_text(IHTMLScriptElement *iface, BSTR
static HRESULT WINAPI HTMLScriptElement_get_text(IHTMLScriptElement *iface, BSTR *p)
{
HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
nsAString nsstr;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
nsAString_Init(&nsstr, NULL);
nsres = nsIDOMHTMLScriptElement_GetText(This->nsscript, &nsstr);
return return_nsstr(nsres, &nsstr, p);
}
static HRESULT WINAPI HTMLScriptElement_put_defer(IHTMLScriptElement *iface, VARIANT_BOOL v)

View File

@ -3559,6 +3559,19 @@ static void _test_link_type(unsigned line, IHTMLElement *elem, const char *v)
IHTMLLinkElement_Release(link);
}
#define test_script_text(a,b) _test_script_text(__LINE__,a,b)
static void _test_script_text(unsigned line, IHTMLScriptElement *script, const char *extext)
{
BSTR str;
HRESULT hres;
str = (void*)0xdeadbeef;
hres = IHTMLScriptElement_get_text(script, &str);
ok_(__FILE__,line)(hres == S_OK, "get_text failed: %08x\n", hres);
ok(!strcmp_wa(str, extext), "text = %s, expected \"%s\"\n", wine_dbgstr_w(str), extext);
SysFreeString(str);
}
#define link_put_type(a,b) _link_put_type(__LINE__,a,b)
static void _link_put_type(unsigned line, IHTMLElement *elem, const char *v)
{
@ -5822,9 +5835,10 @@ static void test_elems(IHTMLDocument2 *doc)
hres = IHTMLScriptElement_get_type(script, &type);
ok(hres == S_OK, "get_type failed: %08x\n", hres);
ok(!strcmp_wa(type, "text/javascript"), "Unexpected type %s\n", wine_dbgstr_w(type));
SysFreeString(type);
test_script_text(script, "<!--\nfunction Testing() {}\n// -->\n");
/* test defer */
hres = IHTMLScriptElement_put_defer(script, VARIANT_TRUE);
ok(hres == S_OK, "put_defer failed: %08x\n", hres);