mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 21:45:41 +00:00
[MSHTML_WINETEST]
sync mshtml_winetest to wine 1.1.40 svn path=/trunk/; revision=45919
This commit is contained in:
parent
d25edac691
commit
bd5eff9b85
5 changed files with 742 additions and 351 deletions
|
@ -99,7 +99,8 @@ typedef enum {
|
|||
ET_TR,
|
||||
ET_TD,
|
||||
ET_IFRAME,
|
||||
ET_FORM
|
||||
ET_FORM,
|
||||
ET_FRAME
|
||||
} elem_type_t;
|
||||
|
||||
static const IID * const none_iids[] = {
|
||||
|
@ -310,6 +311,19 @@ static const IID * const td_iids[] = {
|
|||
NULL
|
||||
};
|
||||
|
||||
static const IID * const frame_iids[] = {
|
||||
&IID_IHTMLDOMNode,
|
||||
&IID_IHTMLDOMNode2,
|
||||
&IID_IHTMLElement,
|
||||
&IID_IHTMLElement2,
|
||||
&IID_IHTMLElement3,
|
||||
&IID_IHTMLFrameBase,
|
||||
&IID_IHTMLFrameBase2,
|
||||
&IID_IDispatchEx,
|
||||
&IID_IConnectionPointContainer,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const IID * const iframe_iids[] = {
|
||||
&IID_IHTMLDOMNode,
|
||||
&IID_IHTMLDOMNode2,
|
||||
|
@ -318,6 +332,7 @@ static const IID * const iframe_iids[] = {
|
|||
&IID_IHTMLElement3,
|
||||
&IID_IHTMLFrameBase,
|
||||
&IID_IHTMLFrameBase2,
|
||||
&IID_IHTMLIFrameElement,
|
||||
&IID_IDispatchEx,
|
||||
&IID_IConnectionPointContainer,
|
||||
NULL
|
||||
|
@ -389,7 +404,7 @@ static const elem_type_info_t elem_type_infos[] = {
|
|||
{"A", anchor_iids, &DIID_DispHTMLAnchorElement},
|
||||
{"INPUT", input_iids, &DIID_DispHTMLInputElement},
|
||||
{"SELECT", select_iids, &DIID_DispHTMLSelectElement},
|
||||
{"TEXTAREA", textarea_iids, NULL},
|
||||
{"TEXTAREA", textarea_iids, &DIID_DispHTMLTextAreaElement},
|
||||
{"OPTION", option_iids, &DIID_DispHTMLOptionElement},
|
||||
{"STYLE", elem_iids, NULL},
|
||||
{"BLOCKQUOTE",elem_iids, NULL},
|
||||
|
@ -397,7 +412,7 @@ static const elem_type_info_t elem_type_infos[] = {
|
|||
{"BR", elem_iids, NULL},
|
||||
{"TABLE", table_iids, &DIID_DispHTMLTable},
|
||||
{"TBODY", elem_iids, NULL},
|
||||
{"SCRIPT", script_iids, NULL},
|
||||
{"SCRIPT", script_iids, &DIID_DispHTMLScriptElement},
|
||||
{"TEST", elem_iids, &DIID_DispHTMLUnknownElement},
|
||||
{"TEST", generic_iids, &DIID_DispHTMLGenericElement},
|
||||
{"!", comment_iids, &DIID_DispHTMLCommentElement},
|
||||
|
@ -405,7 +420,8 @@ static const elem_type_info_t elem_type_infos[] = {
|
|||
{"TR", tr_iids, &DIID_DispHTMLTableRow},
|
||||
{"TD", td_iids, NULL},
|
||||
{"IFRAME", iframe_iids, &DIID_DispHTMLIFrame},
|
||||
{"FORM", form_iids, &DIID_DispHTMLFormElement}
|
||||
{"FORM", form_iids, &DIID_DispHTMLFormElement},
|
||||
{"FRAME", frame_iids, &DIID_DispHTMLFrameElement}
|
||||
};
|
||||
|
||||
static const char *dbgstr_guid(REFIID riid)
|
||||
|
@ -668,6 +684,17 @@ static IHTMLDOMTextNode *_get_text_iface(unsigned line, IUnknown *unk)
|
|||
return text;
|
||||
}
|
||||
|
||||
#define get_comment_iface(u) _get_comment_iface(__LINE__,u)
|
||||
static IHTMLCommentElement *_get_comment_iface(unsigned line, IUnknown *unk)
|
||||
{
|
||||
IHTMLCommentElement *comment;
|
||||
HRESULT hres;
|
||||
|
||||
hres = IUnknown_QueryInterface(unk, &IID_IHTMLCommentElement, (void**)&comment);
|
||||
ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLCommentElement: %08x\n", hres);
|
||||
return comment;
|
||||
}
|
||||
|
||||
#define test_node_name(u,n) _test_node_name(__LINE__,u,n)
|
||||
static void _test_node_name(unsigned line, IUnknown *unk, const char *exname)
|
||||
{
|
||||
|
@ -1086,6 +1113,22 @@ static void _test_option_put_value(unsigned line, IHTMLOptionElement *option, co
|
|||
_test_option_value(line, option, value);
|
||||
}
|
||||
|
||||
#define test_comment_text(c,t) _test_comment_text(__LINE__,c,t)
|
||||
static void _test_comment_text(unsigned line, IUnknown *unk, const char *extext)
|
||||
{
|
||||
IHTMLCommentElement *comment = _get_comment_iface(__LINE__,unk);
|
||||
BSTR text;
|
||||
HRESULT hres;
|
||||
|
||||
text = a2bstr(extext);
|
||||
hres = IHTMLCommentElement_get_text(comment, &text);
|
||||
ok_(__FILE__,line)(hres == S_OK, "get_text failed: %08x\n", hres);
|
||||
ok_(__FILE__,line)(!strcmp_wa(text, extext), "text = \"%s\", expected \"%s\"\n", wine_dbgstr_w(text), extext);
|
||||
|
||||
IHTMLCommentElement_Release(comment);
|
||||
SysFreeString(text);
|
||||
}
|
||||
|
||||
#define create_option_elem(d,t,v) _create_option_elem(__LINE__,d,t,v)
|
||||
static IHTMLOptionElement *_create_option_elem(unsigned line, IHTMLDocument2 *doc,
|
||||
const char *txt, const char *val)
|
||||
|
@ -1129,8 +1172,8 @@ static void _test_img_width(unsigned line, IHTMLImgElement *img, const long exp)
|
|||
HRESULT hres;
|
||||
|
||||
hres = IHTMLImgElement_get_width(img, &found);
|
||||
todo_wine ok_(__FILE__,line) (hres == S_OK, "get_width failed: %08x\n", hres);
|
||||
todo_wine ok_(__FILE__,line) (found == exp, "width=%d\n", found);
|
||||
ok_(__FILE__,line) (hres == S_OK, "get_width failed: %08x\n", hres);
|
||||
ok_(__FILE__,line) (found == exp, "width=%d\n", found);
|
||||
}
|
||||
|
||||
#define test_img_put_width(o,w) _test_img_put_width(__LINE__,o,w)
|
||||
|
@ -1139,7 +1182,7 @@ static void _test_img_put_width(unsigned line, IHTMLImgElement *img, const long
|
|||
HRESULT hres;
|
||||
|
||||
hres = IHTMLImgElement_put_width(img, width);
|
||||
todo_wine ok(hres == S_OK, "put_width failed: %08x\n", hres);
|
||||
ok(hres == S_OK, "put_width failed: %08x\n", hres);
|
||||
|
||||
_test_img_width(line, img, width);
|
||||
}
|
||||
|
@ -1151,8 +1194,8 @@ static void _test_img_height(unsigned line, IHTMLImgElement *img, const long exp
|
|||
HRESULT hres;
|
||||
|
||||
hres = IHTMLImgElement_get_height(img, &found);
|
||||
todo_wine ok_(__FILE__,line) (hres == S_OK, "get_height failed: %08x\n", hres);
|
||||
todo_wine ok_(__FILE__,line) (found == exp, "height=%d\n", found);
|
||||
ok_(__FILE__,line) (hres == S_OK, "get_height failed: %08x\n", hres);
|
||||
ok_(__FILE__,line) (found == exp, "height=%d\n", found);
|
||||
}
|
||||
|
||||
#define test_img_put_height(o,w) _test_img_put_height(__LINE__,o,w)
|
||||
|
@ -1161,7 +1204,7 @@ static void _test_img_put_height(unsigned line, IHTMLImgElement *img, const long
|
|||
HRESULT hres;
|
||||
|
||||
hres = IHTMLImgElement_put_height(img, height);
|
||||
todo_wine ok(hres == S_OK, "put_height failed: %08x\n", hres);
|
||||
ok(hres == S_OK, "put_height failed: %08x\n", hres);
|
||||
|
||||
_test_img_height(line, img, height);
|
||||
}
|
||||
|
@ -1638,6 +1681,21 @@ static void _test_elem_set_outerhtml(unsigned line, IUnknown *unk, const char *o
|
|||
SysFreeString(html);
|
||||
}
|
||||
|
||||
#define test_elem_outerhtml(e,t) _test_elem_outerhtml(__LINE__,e,t)
|
||||
static void _test_elem_outerhtml(unsigned line, IUnknown *unk, const char *outer_html)
|
||||
{
|
||||
IHTMLElement *elem = _get_elem_iface(line, unk);
|
||||
BSTR html;
|
||||
HRESULT hres;
|
||||
|
||||
hres = IHTMLElement_get_outerHTML(elem, &html);
|
||||
ok_(__FILE__,line)(hres == S_OK, "get_outerHTML failed: %08x\n", hres);
|
||||
ok_(__FILE__,line)(!strcmp_wa(html, outer_html), "outerHTML = '%s', expected '%s'\n", wine_dbgstr_w(html), outer_html);
|
||||
|
||||
IHTMLElement_Release(elem);
|
||||
SysFreeString(html);
|
||||
}
|
||||
|
||||
#define get_first_child(n) _get_first_child(__LINE__,n)
|
||||
static IHTMLDOMNode *_get_first_child(unsigned line, IUnknown *unk)
|
||||
{
|
||||
|
@ -3853,6 +3911,18 @@ static void test_default_style(IHTMLStyle *style)
|
|||
ok(!strcmp_wa(V_BSTR(&v), "auto"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v)));
|
||||
VariantClear(&v);
|
||||
|
||||
V_VT(&v) = VT_I4;
|
||||
V_I4(&v) = 100;
|
||||
hres = IHTMLStyle_put_width(style, v);
|
||||
ok(hres == S_OK, "put_width failed: %08x\n", hres);
|
||||
|
||||
V_VT(&v) = VT_EMPTY;
|
||||
hres = IHTMLStyle_get_width(style, &v);
|
||||
ok(hres == S_OK, "get_width failed: %08x\n", hres);
|
||||
ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
|
||||
ok(!strcmp_wa(V_BSTR(&v), "100px"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v)));
|
||||
VariantClear(&v);
|
||||
|
||||
/* margin tests */
|
||||
str = (void*)0xdeadbeef;
|
||||
hres = IHTMLStyle_get_margin(style, &str);
|
||||
|
@ -4418,8 +4488,8 @@ static void test_default_style(IHTMLStyle *style)
|
|||
*/
|
||||
V_BSTR(&v) = NULL;
|
||||
hres = IHTMLStyle_get_borderRightColor(style, &v);
|
||||
todo_wine ok(hres == S_OK, "get_borderRightColor failed: %08x\n", hres);
|
||||
todo_wine ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
|
||||
ok(hres == S_OK, "get_borderRightColor failed: %08x\n", hres);
|
||||
ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
|
||||
VariantClear(&v);
|
||||
|
||||
V_BSTR(&v) = NULL;
|
||||
|
@ -4452,8 +4522,8 @@ static void test_default_style(IHTMLStyle *style)
|
|||
*/
|
||||
V_BSTR(&v) = NULL;
|
||||
hres = IHTMLStyle_get_borderTopColor(style, &v);
|
||||
todo_wine ok(hres == S_OK, "get_borderTopColor failed: %08x\n", hres);
|
||||
todo_wine ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
|
||||
ok(hres == S_OK, "get_borderTopColor failed: %08x\n", hres);
|
||||
ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
|
||||
VariantClear(&v);
|
||||
|
||||
V_BSTR(&v) = NULL;
|
||||
|
@ -4486,8 +4556,8 @@ static void test_default_style(IHTMLStyle *style)
|
|||
*/
|
||||
V_BSTR(&v) = NULL;
|
||||
hres = IHTMLStyle_get_borderBottomColor(style, &v);
|
||||
todo_wine ok(hres == S_OK, "get_borderBottomColor failed: %08x\n", hres);
|
||||
todo_wine ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
|
||||
ok(hres == S_OK, "get_borderBottomColor failed: %08x\n", hres);
|
||||
ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
|
||||
VariantClear(&v);
|
||||
|
||||
V_BSTR(&v) = NULL;
|
||||
|
@ -4520,8 +4590,8 @@ static void test_default_style(IHTMLStyle *style)
|
|||
*/
|
||||
V_BSTR(&v) = NULL;
|
||||
hres = IHTMLStyle_get_borderLeftColor(style, &v);
|
||||
todo_wine ok(hres == S_OK, "get_borderLeftColor failed: %08x\n", hres);
|
||||
todo_wine ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
|
||||
ok(hres == S_OK, "get_borderLeftColor failed: %08x\n", hres);
|
||||
ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
|
||||
VariantClear(&v);
|
||||
|
||||
V_BSTR(&v) = NULL;
|
||||
|
@ -5142,10 +5212,12 @@ static void doc_write(IHTMLDocument2 *doc, BOOL ln, const char *text)
|
|||
SafeArrayDestroy(sa);
|
||||
}
|
||||
|
||||
static void test_frame_doc(IUnknown *frame_elem)
|
||||
static void test_frame_doc(IUnknown *frame_elem, BOOL iframe)
|
||||
{
|
||||
IHTMLDocument2 *window_doc, *elem_doc;
|
||||
IHTMLFrameElement3 *frame_elem3;
|
||||
IHTMLWindow2 *content_window;
|
||||
HRESULT hres;
|
||||
|
||||
content_window = get_frame_content_window(frame_elem);
|
||||
window_doc = get_window_doc(content_window);
|
||||
|
@ -5154,6 +5226,23 @@ static void test_frame_doc(IUnknown *frame_elem)
|
|||
elem_doc = get_elem_doc(frame_elem);
|
||||
ok(iface_cmp((IUnknown*)window_doc, (IUnknown*)elem_doc), "content_doc != elem_doc\n");
|
||||
|
||||
if(!iframe) {
|
||||
hres = IUnknown_QueryInterface(frame_elem, &IID_IHTMLFrameElement3, (void**)&frame_elem3);
|
||||
if(SUCCEEDED(hres)) {
|
||||
IDispatch *disp = NULL;
|
||||
|
||||
hres = IHTMLFrameElement3_get_contentDocument(frame_elem3, &disp);
|
||||
ok(hres == S_OK, "get_contentDocument failed: %08x\n", hres);
|
||||
ok(disp != NULL, "contentDocument == NULL\n");
|
||||
ok(iface_cmp((IUnknown*)disp, (IUnknown*)window_doc), "contentDocument != contentWindow.document\n");
|
||||
|
||||
IDispatch_Release(disp);
|
||||
IHTMLFrameElement3_Release(frame_elem3);
|
||||
}else {
|
||||
win_skip("IHTMLFrameElement3 not supported\n");
|
||||
}
|
||||
}
|
||||
|
||||
IHTMLDocument2_Release(elem_doc);
|
||||
IHTMLDocument2_Release(window_doc);
|
||||
}
|
||||
|
@ -5176,7 +5265,7 @@ static void test_iframe_elem(IHTMLElement *elem)
|
|||
ET_BR
|
||||
};
|
||||
|
||||
test_frame_doc((IUnknown*)elem);
|
||||
test_frame_doc((IUnknown*)elem, TRUE);
|
||||
|
||||
content_window = get_frame_content_window((IUnknown*)elem);
|
||||
test_window_length(content_window, 0);
|
||||
|
@ -5503,9 +5592,18 @@ static void test_elems(IHTMLDocument2 *doc)
|
|||
{
|
||||
VARIANT_BOOL vb;
|
||||
|
||||
hres = IHTMLScriptElement_put_type (script, NULL);
|
||||
ok(hres == S_OK, "put_type failed: %08x\n", hres);
|
||||
hres = IHTMLScriptElement_get_type(script, &type);
|
||||
ok(hres == S_OK, "get_type failed: %08x\n", hres);
|
||||
ok(type == NULL, "Unexpected type %s\n", wine_dbgstr_w(type));
|
||||
|
||||
hres = IHTMLScriptElement_put_type (script, a2bstr ("text/javascript"));
|
||||
ok(hres == S_OK, "put_type failed: %08x\n", hres);
|
||||
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 defer */
|
||||
|
@ -5861,6 +5959,11 @@ static void test_create_elems(IHTMLDocument2 *doc)
|
|||
ok(type == 8, "type=%d, expected 8\n", type);
|
||||
|
||||
test_node_get_value_str((IUnknown*)comment, "testing");
|
||||
test_elem_title((IUnknown*)comment, NULL);
|
||||
test_elem_set_title((IUnknown*)comment, "comment title");
|
||||
test_elem_title((IUnknown*)comment, "comment title");
|
||||
test_comment_text((IUnknown*)comment, "<!--testing-->");
|
||||
test_elem_outerhtml((IUnknown*)comment, "<!--testing-->");
|
||||
|
||||
IHTMLDOMNode_Release(comment);
|
||||
}
|
||||
|
@ -5871,6 +5974,22 @@ static void test_create_elems(IHTMLDocument2 *doc)
|
|||
IHTMLElement_Release(body);
|
||||
}
|
||||
|
||||
static void test_null_write(IHTMLDocument2 *doc)
|
||||
{
|
||||
HRESULT hres;
|
||||
|
||||
doc_write(doc, FALSE, NULL);
|
||||
doc_write(doc, TRUE, NULL);
|
||||
|
||||
hres = IHTMLDocument2_write(doc, NULL);
|
||||
ok(hres == S_OK,
|
||||
"Expected IHTMLDocument2::write to return S_OK, got 0x%08x\n", hres);
|
||||
|
||||
hres = IHTMLDocument2_writeln(doc, NULL);
|
||||
ok(hres == S_OK,
|
||||
"Expected IHTMLDocument2::writeln to return S_OK, got 0x%08x\n", hres);
|
||||
}
|
||||
|
||||
static void test_exec(IUnknown *unk, const GUID *grpid, DWORD cmdid, VARIANT *in, VARIANT *out)
|
||||
{
|
||||
IOleCommandTarget *cmdtrg;
|
||||
|
@ -5964,7 +6083,8 @@ static void test_frame(IDispatch *disp, const char *exp_id)
|
|||
if(FAILED(hres))
|
||||
return;
|
||||
|
||||
test_frame_doc((IUnknown*)frame_elem);
|
||||
test_elem_type((IUnknown*)frame_elem, ET_FRAME);
|
||||
test_frame_doc((IUnknown*)frame_elem, FALSE);
|
||||
test_elem_id((IUnknown*)frame_elem, exp_id);
|
||||
IHTMLElement_Release(frame_elem);
|
||||
|
||||
|
@ -6344,6 +6464,7 @@ START_TEST(dom)
|
|||
run_domtest(elem_test2_str, test_elems2);
|
||||
run_domtest(doc_blank, test_create_elems);
|
||||
run_domtest(doc_blank, test_defaults);
|
||||
run_domtest(doc_blank, test_null_write);
|
||||
run_domtest(indent_test_str, test_indent);
|
||||
run_domtest(cond_comment_str, test_cond_comment);
|
||||
run_domtest(frameset_str, test_frameset);
|
||||
|
|
|
@ -63,6 +63,7 @@ DEFINE_EXPECT(div_onclick);
|
|||
DEFINE_EXPECT(div_onclick_attached);
|
||||
DEFINE_EXPECT(timeout);
|
||||
DEFINE_EXPECT(doccp_onclick);
|
||||
DEFINE_EXPECT(div_onclick_disp);
|
||||
DEFINE_EXPECT(iframe_onreadystatechange_loading);
|
||||
DEFINE_EXPECT(iframe_onreadystatechange_interactive);
|
||||
DEFINE_EXPECT(iframe_onreadystatechange_complete);
|
||||
|
@ -674,6 +675,20 @@ static void _elem_attach_event(unsigned line, IUnknown *unk, const char *namea,
|
|||
ok_(__FILE__,line)(res == VARIANT_TRUE, "attachEvent returned %x\n", res);
|
||||
}
|
||||
|
||||
#define elem_detach_event(a,b,c) _elem_detach_event(__LINE__,a,b,c)
|
||||
static void _elem_detach_event(unsigned line, IUnknown *unk, const char *namea, IDispatch *disp)
|
||||
{
|
||||
IHTMLElement2 *elem = _get_elem2_iface(line, unk);
|
||||
BSTR name;
|
||||
HRESULT hres;
|
||||
|
||||
name = a2bstr(namea);
|
||||
hres = IHTMLElement2_detachEvent(elem, name, disp);
|
||||
IHTMLElement2_Release(elem);
|
||||
SysFreeString(name);
|
||||
ok_(__FILE__,line)(hres == S_OK, "detachEvent failed: %08x\n", hres);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
*ppv = NULL;
|
||||
|
@ -690,6 +705,23 @@ static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid,
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI Dispatch_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
*ppv = NULL;
|
||||
|
||||
if(IsEqualGUID(riid, &IID_IUnknown)
|
||||
|| IsEqualGUID(riid, &IID_IDispatch)) {
|
||||
*ppv = iface;
|
||||
}else if(IsEqualGUID(riid, &IID_IDispatchEx)) {
|
||||
return E_NOINTERFACE;
|
||||
}else {
|
||||
ok(0, "unexpected riid %s\n", debugstr_guid(riid));
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static ULONG WINAPI DispatchEx_AddRef(IDispatchEx *iface)
|
||||
{
|
||||
return 2;
|
||||
|
@ -1015,6 +1047,32 @@ static IDispatchExVtbl timeoutFuncVtbl = {
|
|||
|
||||
static IDispatchEx timeoutFunc = { &timeoutFuncVtbl };
|
||||
|
||||
static HRESULT WINAPI div_onclick_disp_Invoke(IDispatchEx *iface, DISPID id,
|
||||
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
|
||||
VARIANT *pvarRes, EXCEPINFO *pei, UINT *puArgErr)
|
||||
{
|
||||
CHECK_EXPECT(div_onclick_disp);
|
||||
|
||||
test_attached_event_args(id, wFlags, pdp, pvarRes, pei);
|
||||
|
||||
ok(IsEqualGUID(&IID_NULL, riid), "riid = %s\n", debugstr_guid(riid));
|
||||
ok(!puArgErr, "puArgErr = %p\n", puArgErr);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static IDispatchExVtbl div_onclick_dispVtbl = {
|
||||
Dispatch_QueryInterface,
|
||||
DispatchEx_AddRef,
|
||||
DispatchEx_Release,
|
||||
DispatchEx_GetTypeInfoCount,
|
||||
DispatchEx_GetTypeInfo,
|
||||
DispatchEx_GetIDsOfNames,
|
||||
div_onclick_disp_Invoke,
|
||||
};
|
||||
|
||||
static IDispatchEx div_onclick_disp = { &div_onclick_dispVtbl };
|
||||
|
||||
static void pump_msgs(BOOL *b)
|
||||
{
|
||||
MSG msg;
|
||||
|
@ -1163,8 +1221,10 @@ static void test_onclick(IHTMLDocument2 *doc)
|
|||
CHECK_CALLED(document_onclick);
|
||||
|
||||
cp_cookie = register_cp((IUnknown*)doc, &DIID_HTMLDocumentEvents, (IUnknown*)&doccp_obj);
|
||||
elem_attach_event((IUnknown*)div, "onclick", (IDispatch*)&div_onclick_disp);
|
||||
|
||||
SET_EXPECT(div_onclick);
|
||||
SET_EXPECT(div_onclick_disp);
|
||||
SET_EXPECT(div_onclick_attached);
|
||||
SET_EXPECT(body_onclick);
|
||||
SET_EXPECT(document_onclick);
|
||||
|
@ -1174,6 +1234,7 @@ static void test_onclick(IHTMLDocument2 *doc)
|
|||
ok(hres == S_OK, "click failed: %08x\n", hres);
|
||||
|
||||
CHECK_CALLED(div_onclick);
|
||||
CHECK_CALLED(div_onclick_disp);
|
||||
CHECK_CALLED(div_onclick_attached);
|
||||
CHECK_CALLED(body_onclick);
|
||||
CHECK_CALLED(document_onclick);
|
||||
|
@ -1181,6 +1242,29 @@ static void test_onclick(IHTMLDocument2 *doc)
|
|||
|
||||
unregister_cp((IUnknown*)doc, &DIID_HTMLDocumentEvents, cp_cookie);
|
||||
|
||||
V_VT(&v) = VT_NULL;
|
||||
hres = IHTMLElement_put_onclick(div, v);
|
||||
ok(hres == S_OK, "put_onclick failed: %08x\n", hres);
|
||||
|
||||
hres = IHTMLElement_get_onclick(div, &v);
|
||||
ok(hres == S_OK, "get_onclick failed: %08x\n", hres);
|
||||
ok(V_VT(&v) == VT_NULL, "get_onclick returned vt %d\n", V_VT(&v));
|
||||
|
||||
elem_detach_event((IUnknown*)div, "onclick", (IDispatch*)&div_onclick_disp);
|
||||
elem_detach_event((IUnknown*)div, "onclick", (IDispatch*)&div_onclick_disp);
|
||||
elem_detach_event((IUnknown*)div, "test", (IDispatch*)&div_onclick_disp);
|
||||
|
||||
SET_EXPECT(div_onclick_attached);
|
||||
SET_EXPECT(body_onclick);
|
||||
SET_EXPECT(document_onclick);
|
||||
|
||||
hres = IHTMLElement_click(div);
|
||||
ok(hres == S_OK, "click failed: %08x\n", hres);
|
||||
|
||||
CHECK_CALLED(div_onclick_attached);
|
||||
CHECK_CALLED(body_onclick);
|
||||
CHECK_CALLED(document_onclick);
|
||||
|
||||
IHTMLElement_Release(div);
|
||||
IHTMLElement_Release(body);
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -22,10 +22,11 @@
|
|||
#include <wine/test.h>
|
||||
|
||||
#include "mshtml.h"
|
||||
#include "wininet.h"
|
||||
|
||||
struct location_test {
|
||||
const char *name;
|
||||
const WCHAR *url;
|
||||
const char *url;
|
||||
|
||||
const char *href;
|
||||
const char *protocol;
|
||||
|
@ -37,75 +38,68 @@ struct location_test {
|
|||
const char *hash;
|
||||
};
|
||||
|
||||
static const WCHAR http_url[] = {'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q','.','o','r','g','?','s','e','a','r','c','h','#','h','a','s','h',0};
|
||||
static const struct location_test http_test = {
|
||||
"HTTP",
|
||||
http_url,
|
||||
"http://www.winehq.org/?search#hash",
|
||||
"http:",
|
||||
"www.winehq.org:80",
|
||||
"www.winehq.org",
|
||||
"80",
|
||||
"",
|
||||
"?search",
|
||||
"#hash"
|
||||
};
|
||||
|
||||
static const WCHAR http_file_url[] = {'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q','.','o','r','g','/','f','i','l','e','?','s','e','a','r','c','h','#','h','a','s','h',0};
|
||||
static const struct location_test http_file_test = {
|
||||
"HTTP with file",
|
||||
http_file_url,
|
||||
"http://www.winehq.org/file?search#hash",
|
||||
"http:",
|
||||
"www.winehq.org:80",
|
||||
"www.winehq.org",
|
||||
"80",
|
||||
"file",
|
||||
"?search",
|
||||
"#hash"
|
||||
};
|
||||
|
||||
static const WCHAR ftp_url[] = {'f','t','p',':','/','/','f','t','p','.','w','i','n','e','h','q','.','o','r','g','/',0};
|
||||
static const struct location_test ftp_test = {
|
||||
"FTP",
|
||||
ftp_url,
|
||||
"ftp://ftp.winehq.org/",
|
||||
"ftp:",
|
||||
"ftp.winehq.org:21",
|
||||
"ftp.winehq.org",
|
||||
"21",
|
||||
"",
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const WCHAR ftp_file_url[] = {'f','t','p',':','/','/','f','t','p','.','w','i','n','e','h','q','.','o','r','g','/','f','i','l','e',0};
|
||||
static const struct location_test ftp_file_test = {
|
||||
"FTP with file",
|
||||
ftp_file_url,
|
||||
"ftp://ftp.winehq.org/file",
|
||||
"ftp:",
|
||||
"ftp.winehq.org:21",
|
||||
"ftp.winehq.org",
|
||||
"21",
|
||||
"file",
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const WCHAR file_url[] = {'f','i','l','e',':','/','/','C',':','\\','w','i','n','d','o','w','s','\\','w','i','n','.','i','n','i',0};
|
||||
static const struct location_test file_test = {
|
||||
"FILE",
|
||||
file_url,
|
||||
"file:///C:/windows/win.ini",
|
||||
"file:",
|
||||
NULL,
|
||||
NULL,
|
||||
"",
|
||||
"C:\\windows\\win.ini",
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
static const struct location_test location_tests[] = {
|
||||
{
|
||||
"HTTP",
|
||||
"http://www.winehq.org?search#hash",
|
||||
"http://www.winehq.org/?search#hash",
|
||||
"http:",
|
||||
"www.winehq.org:80",
|
||||
"www.winehq.org",
|
||||
"80",
|
||||
"",
|
||||
"?search",
|
||||
"#hash"
|
||||
},
|
||||
{
|
||||
"HTTP with file",
|
||||
"http://www.winehq.org/file?search#hash",
|
||||
"http://www.winehq.org/file?search#hash",
|
||||
"http:",
|
||||
"www.winehq.org:80",
|
||||
"www.winehq.org",
|
||||
"80",
|
||||
"file",
|
||||
"?search",
|
||||
"#hash"
|
||||
},
|
||||
{
|
||||
"FTP",
|
||||
"ftp://ftp.winehq.org/",
|
||||
"ftp://ftp.winehq.org/",
|
||||
"ftp:",
|
||||
"ftp.winehq.org:21",
|
||||
"ftp.winehq.org",
|
||||
"21",
|
||||
"",
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
{
|
||||
"FTP with file",
|
||||
"ftp://ftp.winehq.org/file",
|
||||
"ftp://ftp.winehq.org/file",
|
||||
"ftp:",
|
||||
"ftp.winehq.org:21",
|
||||
"ftp.winehq.org",
|
||||
"21",
|
||||
"file",
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
{
|
||||
"FILE",
|
||||
"file://C:\\windows\\win.ini",
|
||||
"file:///C:/windows/win.ini",
|
||||
"file:",
|
||||
NULL,
|
||||
NULL,
|
||||
"",
|
||||
"C:\\windows\\win.ini",
|
||||
NULL,
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
static int str_eq_wa(LPCWSTR strw, const char *stra)
|
||||
{
|
||||
|
@ -267,6 +261,7 @@ static void test_hash(IHTMLLocation *loc, const struct location_test *test)
|
|||
|
||||
static void perform_test(const struct location_test* test)
|
||||
{
|
||||
WCHAR url[INTERNET_MAX_URL_LENGTH];
|
||||
HRESULT hres;
|
||||
IBindCtx *bc;
|
||||
IMoniker *url_mon;
|
||||
|
@ -280,7 +275,8 @@ static void perform_test(const struct location_test* test)
|
|||
if(FAILED(hres))
|
||||
return;
|
||||
|
||||
hres = CreateURLMoniker(NULL, test->url, &url_mon);
|
||||
MultiByteToWideChar(CP_ACP, 0, test->url, -1, url, sizeof(url)/sizeof(WCHAR));
|
||||
hres = CreateURLMoniker(NULL, url, &url_mon);
|
||||
ok(hres == S_OK, "%s: CreateURLMoniker failed: 0x%08x\n", test->name, hres);
|
||||
if(FAILED(hres)){
|
||||
IBindCtx_Release(bc);
|
||||
|
@ -356,13 +352,12 @@ static void perform_test(const struct location_test* test)
|
|||
|
||||
START_TEST(htmllocation)
|
||||
{
|
||||
int i;
|
||||
|
||||
CoInitialize(NULL);
|
||||
|
||||
perform_test(&http_test);
|
||||
perform_test(&http_file_test);
|
||||
perform_test(&ftp_test);
|
||||
perform_test(&ftp_file_test);
|
||||
perform_test(&file_test);
|
||||
for(i=0; i < sizeof(location_tests)/sizeof(*location_tests); i++)
|
||||
perform_test(location_tests+i);
|
||||
|
||||
CoUninitialize();
|
||||
}
|
||||
|
|
|
@ -1803,6 +1803,11 @@ static HRESULT WINAPI ActiveScriptParse_ParseScriptText(IActiveScriptParse *ifac
|
|||
|
||||
test_func(dispex);
|
||||
test_nextdispid(dispex);
|
||||
|
||||
tmp = a2bstr("test");
|
||||
hres = IDispatchEx_DeleteMemberByName(dispex, tmp, fdexNameCaseSensitive);
|
||||
ok(hres == E_NOTIMPL, "DeleteMemberByName failed: %08x\n", hres);
|
||||
|
||||
IDispatchEx_Release(dispex);
|
||||
|
||||
script_disp = (IDispatch*)&scriptDisp;
|
||||
|
@ -1843,6 +1848,10 @@ static HRESULT WINAPI ActiveScriptParse_ParseScriptText(IActiveScriptParse *ifac
|
|||
CHECK_CALLED(script_testprop2_d);
|
||||
SysFreeString(tmp);
|
||||
|
||||
tmp = a2bstr("test");
|
||||
hres = IDispatchEx_DeleteMemberByName(window_dispex, tmp, fdexNameCaseSensitive);
|
||||
ok(hres == E_NOTIMPL, "DeleteMemberByName failed: %08x\n", hres);
|
||||
|
||||
test_global_id();
|
||||
|
||||
test_security();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue