Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
51304cbe
Commit
51304cbe
authored
Mar 30, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 30, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Moved createAttribute tests to test_attr.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dfc60ddb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
33 deletions
+43
-33
dom.c
dlls/mshtml/tests/dom.c
+43
-33
No files found.
dlls/mshtml/tests/dom.c
View file @
51304cbe
...
...
@@ -1903,6 +1903,22 @@ static void _test_comment_text(unsigned line, IUnknown *unk, const char *extext)
SysFreeString
(
text
);
}
#define create_attr(a,b) _create_attr(__LINE__,a,b)
static
IHTMLDOMAttribute
*
_create_attr
(
unsigned
line
,
IUnknown
*
unk
,
const
char
*
name
)
{
IHTMLDocument5
*
doc
=
_get_htmldoc5_iface
(
line
,
unk
);
BSTR
str
=
a2bstr
(
"Test"
);
IHTMLDOMAttribute
*
attr
;
HRESULT
hres
;
hres
=
IHTMLDocument5_createAttribute
(
doc
,
str
,
&
attr
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"createAttribute dailed: %08x
\n
"
,
hres
);
SysFreeString
(
str
);
IHTMLDocument5_Release
(
doc
);
return
attr
;
}
#define test_attr_specified(a,b) _test_attr_specified(__LINE__,a,b)
static
void
_test_attr_specified
(
unsigned
line
,
IHTMLDOMAttribute
*
attr
,
VARIANT_BOOL
expected
)
{
...
...
@@ -8493,7 +8509,7 @@ static void test_elems(IHTMLDocument2 *doc)
IHTMLWindow2_Release
(
window
);
}
static
void
test_attr
(
IHTMLElement
*
elem
)
static
void
test_attr
(
IHTML
Document2
*
doc
,
IHTML
Element
*
elem
)
{
IHTMLDOMAttribute
*
attr
,
*
attr2
;
VARIANT
v
;
...
...
@@ -8575,6 +8591,31 @@ static void test_attr(IHTMLElement *elem)
test_attr_specified
(
attr
,
VARIANT_FALSE
);
test_attr_expando
(
attr
,
VARIANT_FALSE
);
IHTMLDOMAttribute_Release
(
attr
);
/* Test created, detached attribute. */
attr
=
create_attr
((
IUnknown
*
)
doc
,
"Test"
);
test_disp
((
IUnknown
*
)
attr
,
&
DIID_DispHTMLDOMAttribute
,
"[object]"
);
test_ifaces
((
IUnknown
*
)
attr
,
attr_iids
);
test_no_iface
((
IUnknown
*
)
attr
,
&
IID_IHTMLDOMNode
);
test_attr_node_name
(
attr
,
"Test"
);
test_attr_expando
(
attr
,
VARIANT_FALSE
);
get_attr_node_value
(
attr
,
&
v
,
VT_EMPTY
);
V_VT
(
&
v
)
=
VT_I4
;
V_I4
(
&
v
)
=
1
;
put_attr_node_value
(
attr
,
v
);
get_attr_node_value
(
attr
,
&
v
,
VT_I4
);
ok
(
V_I4
(
&
v
)
==
1
,
"nodeValue = %d
\n
"
,
V_I4
(
&
v
));
V_VT
(
&
v
)
=
VT_EMPTY
;
put_attr_node_value
(
attr
,
v
);
get_attr_node_value
(
attr
,
&
v
,
VT_EMPTY
);
IHTMLDOMAttribute_Release
(
attr
);
}
static
void
test_blocked
(
IHTMLDocument2
*
doc
,
IHTMLElement
*
outer_elem
)
...
...
@@ -8796,7 +8837,7 @@ static void test_elems2(IHTMLDocument2 *doc)
IHTMLElement_Release
(
elem2
);
}
test_attr
(
div
);
test_attr
(
d
oc
,
d
iv
);
test_blocked
(
doc
,
div
);
test_elem_names
(
doc
);
...
...
@@ -8807,7 +8848,6 @@ static void test_create_elems(IHTMLDocument2 *doc)
{
IHTMLElement
*
elem
,
*
body
,
*
elem2
;
IHTMLDOMNode
*
node
,
*
node2
,
*
node3
,
*
comment
;
IHTMLDOMAttribute
*
attr
;
IHTMLDocument5
*
doc5
;
IDispatch
*
disp
;
VARIANT
var
;
...
...
@@ -8911,36 +8951,6 @@ static void test_create_elems(IHTMLDocument2 *doc)
IHTMLDOMNode_Release
(
comment
);
}
str
=
a2bstr
(
"Test"
);
hres
=
IHTMLDocument5_createAttribute
(
doc5
,
str
,
&
attr
);
ok
(
hres
==
S_OK
,
"createAttribute dailed: %08x
\n
"
,
hres
);
SysFreeString
(
str
);
if
(
SUCCEEDED
(
hres
))
{
VARIANT
v
;
test_disp
((
IUnknown
*
)
attr
,
&
DIID_DispHTMLDOMAttribute
,
"[object]"
);
test_ifaces
((
IUnknown
*
)
attr
,
attr_iids
);
test_no_iface
((
IUnknown
*
)
attr
,
&
IID_IHTMLDOMNode
);
test_attr_node_name
(
attr
,
"Test"
);
test_attr_expando
(
attr
,
VARIANT_FALSE
);
get_attr_node_value
(
attr
,
&
v
,
VT_EMPTY
);
V_VT
(
&
v
)
=
VT_I4
;
V_I4
(
&
v
)
=
1
;
put_attr_node_value
(
attr
,
v
);
get_attr_node_value
(
attr
,
&
v
,
VT_I4
);
ok
(
V_I4
(
&
v
)
==
1
,
"nodeValue = %d
\n
"
,
V_I4
(
&
v
));
V_VT
(
&
v
)
=
VT_EMPTY
;
put_attr_node_value
(
attr
,
v
);
get_attr_node_value
(
attr
,
&
v
,
VT_EMPTY
);
IHTMLDOMAttribute_Release
(
attr
);
}
IHTMLDocument5_Release
(
doc5
);
}
...
...
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