Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1d4d1068
Commit
1d4d1068
authored
Aug 23, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml/tests: Added dynamic properties accessing tests.
parent
ff449dd1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
1 deletion
+52
-1
dom.c
dlls/mshtml/tests/dom.c
+52
-1
No files found.
dlls/mshtml/tests/dom.c
View file @
1d4d1068
...
...
@@ -55,6 +55,7 @@ static const char elem_test_str[] =
"<img id=
\"
imgid
\"
name=
\"
WineImg
\"
/>"
"<iframe src=
\"
about:blank
\"
id=
\"
ifr
\"
></iframe>"
"<form id=
\"
frm
\"
></form>"
"<div id=
\"
attr
\"
attr1=
\"
attr1
\"
attr2 attr3=
\"
attr3
\"
></div>"
"</body></html>"
;
static
const
char
elem_test2_str
[]
=
"<html><head><title>test</title><style>.body { margin-right: 0px; }</style>"
...
...
@@ -2338,6 +2339,49 @@ static void _test_img_name(unsigned line, IUnknown *unk, const char *pValue)
SysFreeString
(
sName
);
}
static
void
test_dynamic_properties
(
IHTMLElement
*
elem
)
{
static
const
WCHAR
attr1W
[]
=
{
'a'
,
't'
,
't'
,
'r'
,
'1'
,
0
};
IDispatchEx
*
dispex
;
BSTR
name
,
attr1
=
SysAllocString
(
attr1W
);
VARIANT_BOOL
succ
;
VARIANT
val
;
int
checked_no
=
0
;
DISPID
id
=
DISPID_STARTENUM
;
HRESULT
hres
;
hres
=
IHTMLElement_QueryInterface
(
elem
,
&
IID_IDispatchEx
,
(
void
**
)
&
dispex
);
ok
(
hres
==
S_OK
,
"QueryInterface failed: %08x
\n
"
,
hres
);
hres
=
IHTMLElement_removeAttribute
(
elem
,
attr1
,
0
,
&
succ
);
ok
(
hres
==
S_OK
,
"removeAttribute failed: %08x
\n
"
,
hres
);
ok
(
succ
,
"removeAttribute set succ to FALSE
\n
"
);
while
(
1
)
{
hres
=
IDispatchEx_GetNextDispID
(
dispex
,
fdexEnumAll
,
id
,
&
id
);
ok
(
hres
==
S_OK
||
hres
==
S_FALSE
,
"GetNextDispID failed: %08x
\n
"
,
hres
);
if
(
hres
!=
S_OK
)
break
;
hres
=
IDispatchEx_GetMemberName
(
dispex
,
id
,
&
name
);
ok
(
hres
==
S_OK
,
"GetMemberName failed: %08x
\n
"
,
hres
);
if
(
!
strcmp_wa
(
name
,
"attr1"
))
ok
(
0
,
"attr1 should be removed
\n
"
);
else
if
(
!
strcmp_wa
(
name
,
"attr2"
)
||
!
strcmp_wa
(
name
,
"attr3"
))
checked_no
++
;
SysFreeString
(
name
);
}
ok
(
checked_no
==
2
,
"checked_no=%d, expected 2
\n
"
,
checked_no
);
IDispatchEx_Release
(
dispex
);
V_VT
(
&
val
)
=
VT_BSTR
;
V_BSTR
(
&
val
)
=
attr1
;
hres
=
IHTMLElement_setAttribute
(
elem
,
attr1
,
val
,
0
);
ok
(
hres
==
S_OK
,
"setAttribute failed: %08x
\n
"
,
hres
);
SysFreeString
(
attr1
);
}
#define test_input_type(i,t) _test_input_type(__LINE__,i,t)
static
void
_test_input_type
(
unsigned
line
,
IHTMLInputElement
*
input
,
const
char
*
extype
)
{
...
...
@@ -4664,7 +4708,8 @@ static void test_elems(IHTMLDocument2 *doc)
ET_EMBED
,
ET_IMG
,
ET_IFRAME
,
ET_FORM
ET_FORM
,
ET_DIV
};
static
const
elem_type_t
item_types
[]
=
{
...
...
@@ -4911,6 +4956,12 @@ static void test_elems(IHTMLDocument2 *doc)
IHTMLElement_Release
(
elem
);
}
elem
=
get_elem_by_id
(
doc
,
"attr"
,
TRUE
);
if
(
elem
)
{
test_dynamic_properties
(
elem
);
IHTMLElement_Release
(
elem
);
}
elem
=
get_elem_by_id
(
doc
,
"styleid"
,
TRUE
);
if
(
elem
)
{
test_style_media
((
IUnknown
*
)
elem
,
NULL
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment