mshtml/tests: Added area element tests.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2017-04-21 13:50:29 +02:00 committed by Alexandre Julliard
parent 331205d88c
commit 939eafcce0

View File

@ -132,7 +132,8 @@ typedef enum {
ET_NOSCRIPT, ET_NOSCRIPT,
ET_LINK, ET_LINK,
ET_LABEL, ET_LABEL,
ET_BUTTON ET_BUTTON,
ET_AREA
} elem_type_t; } elem_type_t;
static const IID * const none_iids[] = { static const IID * const none_iids[] = {
@ -221,6 +222,13 @@ static const IID *const button_iids[] = {
NULL NULL
}; };
static const IID *const area_iids[] = {
ELEM_IFACES,
&IID_IHTMLAreaElement,
&IID_IConnectionPointContainer,
NULL
};
static const IID * const label_iids[] = { static const IID * const label_iids[] = {
ELEM_IFACES, ELEM_IFACES,
&IID_IHTMLLabelElement, &IID_IHTMLLabelElement,
@ -491,7 +499,8 @@ static const elem_type_info_t elem_type_infos[] = {
{"NOSCRIPT", elem_iids, NULL /*&DIID_DispHTMLNoShowElement*/}, {"NOSCRIPT", elem_iids, NULL /*&DIID_DispHTMLNoShowElement*/},
{"LINK", link_iids, &DIID_DispHTMLLinkElement}, {"LINK", link_iids, &DIID_DispHTMLLinkElement},
{"LABEL", label_iids, &DIID_DispHTMLLabelElement}, {"LABEL", label_iids, &DIID_DispHTMLLabelElement},
{"BUTTON", button_iids, &DIID_DispHTMLButtonElement} {"BUTTON", button_iids, &DIID_DispHTMLButtonElement},
{"AREA", area_iids, &DIID_DispHTMLAreaElement}
}; };
static int strcmp_wa(LPCWSTR strw, const char *stra) static int strcmp_wa(LPCWSTR strw, const char *stra)
@ -1137,11 +1146,16 @@ static void _test_elem_tag(unsigned line, IUnknown *unk, const char *extag)
#define test_elem_type(ifc,t) _test_elem_type(__LINE__,ifc,t) #define test_elem_type(ifc,t) _test_elem_type(__LINE__,ifc,t)
static void _test_elem_type(unsigned line, IUnknown *unk, elem_type_t type) static void _test_elem_type(unsigned line, IUnknown *unk, elem_type_t type)
{ {
const char *expected_value = "[object]";
_test_elem_tag(line, unk, elem_type_infos[type].tag); _test_elem_tag(line, unk, elem_type_infos[type].tag);
_test_ifaces(line, unk, elem_type_infos[type].iids); _test_ifaces(line, unk, elem_type_infos[type].iids);
if(elem_type_infos[type].dispiid && type != ET_A) if(elem_type_infos[type].dispiid && type != ET_A) {
_test_disp(line, unk, elem_type_infos[type].dispiid, "[object]"); if(type == ET_AREA)
expected_value = NULL;
_test_disp(line, unk, elem_type_infos[type].dispiid, expected_value);
}
} }
#define get_node_type(n) _get_node_type(__LINE__,n) #define get_node_type(n) _get_node_type(__LINE__,n)
@ -9290,6 +9304,13 @@ static void test_elems2(IHTMLDocument2 *doc)
IHTMLElement_Release(elem); IHTMLElement_Release(elem);
} }
test_elem_set_innerhtml((IUnknown*)div, "<map><area id=\"areaid\"></area></map>");
elem = get_elem_by_id(doc, "areaid", TRUE);
if(elem) {
test_elem_type((IUnknown*)elem, ET_AREA);
IHTMLElement_Release(elem);
}
test_td_elem(doc, div); test_td_elem(doc, div);
test_attr(doc, div); test_attr(doc, div);
test_blocked(doc, div); test_blocked(doc, div);