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
5d281947
Commit
5d281947
authored
Sep 20, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 22, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLDOMNode2::get_ownerDocument tests.
Also fixes typo in iface_cmp.
parent
58d67c27
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
2 deletions
+61
-2
dom.c
dlls/mshtml/tests/dom.c
+61
-2
No files found.
dlls/mshtml/tests/dom.c
View file @
5d281947
...
...
@@ -412,7 +412,7 @@ static BOOL iface_cmp(IUnknown *iface1, IUnknown *iface2)
IUnknown_QueryInterface
(
iface1
,
&
IID_IUnknown
,
(
void
**
)
&
unk1
);
IUnknown_Release
(
unk1
);
IUnknown_QueryInterface
(
iface
1
,
&
IID_IUnknown
,
(
void
**
)
&
unk2
);
IUnknown_QueryInterface
(
iface
2
,
&
IID_IUnknown
,
(
void
**
)
&
unk2
);
IUnknown_Release
(
unk2
);
return
unk1
==
unk2
;
...
...
@@ -584,6 +584,17 @@ static IHTMLDOMNode *_get_node_iface(unsigned line, IUnknown *unk)
return
node
;
}
#define get_node2_iface(u) _get_node2_iface(__LINE__,u)
static
IHTMLDOMNode2
*
_get_node2_iface
(
unsigned
line
,
IUnknown
*
unk
)
{
IHTMLDOMNode2
*
node
;
HRESULT
hres
;
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IHTMLDOMNode2
,
(
void
**
)
&
node
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"Could not get IHTMLDOMNode2: %08x
\n
"
,
hres
);
return
node
;
}
#define get_img_iface(u) _get_img_iface(__LINE__,u)
static
IHTMLImgElement
*
_get_img_iface
(
unsigned
line
,
IUnknown
*
unk
)
{
...
...
@@ -610,6 +621,26 @@ static void _test_node_name(unsigned line, IUnknown *unk, const char *exname)
SysFreeString
(
name
);
}
#define get_owner_doc(u) _get_owner_doc(__LINE__,u)
static
IHTMLDocument2
*
_get_owner_doc
(
unsigned
line
,
IUnknown
*
unk
)
{
IHTMLDOMNode2
*
node
=
_get_node2_iface
(
line
,
unk
);
IDispatch
*
disp
=
(
void
*
)
0xdeadbeef
;
IHTMLDocument2
*
doc
;
HRESULT
hres
;
hres
=
IHTMLDOMNode2_get_ownerDocument
(
node
,
&
disp
);
IHTMLDOMNode2_Release
(
node
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_ownerDocument failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
disp
!=
NULL
,
"disp = NULL
\n
"
);
hres
=
IDispatch_QueryInterface
(
disp
,
&
IID_IHTMLDocument2
,
(
void
**
)
&
doc
);
IDispatch_Release
(
disp
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"Could not get IHTMLDocument2 iface: %08x
\n
"
,
hres
);
return
doc
;
}
#define test_elem_tag(u,n) _test_elem_tag(__LINE__,u,n)
static
void
_test_elem_tag
(
unsigned
line
,
IUnknown
*
unk
,
const
char
*
extag
)
{
...
...
@@ -730,8 +761,26 @@ static void _test_elem_offset(unsigned line, IUnknown *unk)
IHTMLElement_Release
(
elem
);
}
#define get_doc_node(d) _get_doc_node(__LINE__,d)
static
IHTMLDocument2
*
_get_doc_node
(
unsigned
line
,
IHTMLDocument2
*
doc
)
{
IHTMLWindow2
*
window
;
IHTMLDocument2
*
ret
;
HRESULT
hres
;
hres
=
IHTMLDocument2_get_parentWindow
(
doc
,
&
window
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_parentWindow failed: %08x
\n
"
,
hres
);
hres
=
IHTMLWindow2_get_document
(
window
,
&
ret
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_document failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
ret
!=
NULL
,
"document = NULL
\n
"
);
return
ret
;
}
static
void
test_doc_elem
(
IHTMLDocument2
*
doc
)
{
IHTMLDocument2
*
doc_node
,
*
owner_doc
;
IHTMLElement
*
elem
;
IHTMLDocument3
*
doc3
;
HRESULT
hres
;
...
...
@@ -746,6 +795,12 @@ static void test_doc_elem(IHTMLDocument2 *doc)
test_node_name
((
IUnknown
*
)
elem
,
"HTML"
);
test_elem_tag
((
IUnknown
*
)
elem
,
"HTML"
);
doc_node
=
get_doc_node
(
doc
);
owner_doc
=
get_owner_doc
((
IUnknown
*
)
elem
);
ok
(
iface_cmp
((
IUnknown
*
)
doc_node
,
(
IUnknown
*
)
owner_doc
),
"doc_node != owner_doc
\n
"
);
IHTMLDocument2_Release
(
doc_node
);
IHTMLDocument2_Release
(
owner_doc
);
IHTMLElement_Release
(
elem
);
}
...
...
@@ -4659,6 +4714,7 @@ static void test_elems(IHTMLDocument2 *doc)
elem
=
get_elem_by_id
(
doc
,
"s"
,
TRUE
);
if
(
elem
)
{
IHTMLSelectElement
*
select
;
IHTMLDocument2
*
doc_node
;
hres
=
IHTMLElement_QueryInterface
(
elem
,
&
IID_IHTMLSelectElement
,
(
void
**
)
&
select
);
ok
(
hres
==
S_OK
,
"Could not get IHTMLSelectElement interface: %08x
\n
"
,
hres
);
...
...
@@ -4684,7 +4740,10 @@ static void test_elems(IHTMLDocument2 *doc)
hres
=
IHTMLElement_get_document
(
elem
,
&
disp
);
ok
(
hres
==
S_OK
,
"get_document failed: %08x
\n
"
,
hres
);
ok
(
iface_cmp
((
IUnknown
*
)
disp
,
(
IUnknown
*
)
doc
),
"disp != doc
\n
"
);
doc_node
=
get_doc_node
(
doc
);
ok
(
iface_cmp
((
IUnknown
*
)
disp
,
(
IUnknown
*
)
doc_node
),
"disp != doc
\n
"
);
IHTMLDocument2_Release
(
doc_node
);
IHTMLElement_Release
(
elem
);
}
...
...
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