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
d8030d15
Commit
d8030d15
authored
Dec 16, 2022
by
Santino Mazza
Committed by
Alexandre Julliard
Jan 26, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml/tests: Test for get_all and get_body in document fragments.
parent
26e5482a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
4 deletions
+68
-4
dom.c
dlls/mshtml/tests/dom.c
+68
-4
No files found.
dlls/mshtml/tests/dom.c
View file @
d8030d15
...
...
@@ -10987,7 +10987,7 @@ static IHTMLDocument2 *create_docfrag(IHTMLDocument2 *doc)
static
void
test_docfrag
(
IHTMLDocument2
*
doc
)
{
IHTMLDocument2
*
frag
,
*
owner_doc
,
*
doc_node
;
IHTMLElement
*
div
,
*
body
,
*
br
;
IHTMLElement
*
div
,
*
main_body
,
*
frag_body
,
*
br
,
*
html
;
IHTMLElementCollection
*
col
;
IHTMLLocation
*
location
;
HRESULT
hres
;
...
...
@@ -11001,20 +11001,38 @@ static void test_docfrag(IHTMLDocument2 *doc)
ET_BR
};
static
const
elem_type_t
empty_types
[]
=
{};
static
const
elem_type_t
frag_types
[]
=
{
ET_HTML
,
ET_DIV
,
ET_DIV
,
ET_BODY
};
frag
=
create_docfrag
(
doc
);
test_disp
((
IUnknown
*
)
frag
,
&
DIID_DispHTMLDocument
,
&
CLSID_HTMLDocument
,
L"[object]"
);
body
=
(
void
*
)
0xdeadbeef
;
hres
=
IHTMLDocument2_get_body
(
frag
,
&
body
);
frag_
body
=
(
void
*
)
0xdeadbeef
;
hres
=
IHTMLDocument2_get_body
(
frag
,
&
frag_
body
);
ok
(
hres
==
S_OK
,
"get_body failed: %08lx
\n
"
,
hres
);
ok
(
!
body
,
"body != NULL
\n
"
);
ok
(
!
frag_
body
,
"body != NULL
\n
"
);
location
=
(
void
*
)
0xdeadbeef
;
hres
=
IHTMLDocument2_get_location
(
frag
,
&
location
);
ok
(
hres
==
E_UNEXPECTED
,
"get_location failed: %08lx
\n
"
,
hres
);
ok
(
location
==
(
void
*
)
0xdeadbeef
,
"location changed
\n
"
);
col
=
NULL
;
hres
=
IHTMLDocument2_get_all
(
frag
,
&
col
);
todo_wine
ok
(
hres
==
S_OK
,
"get_all failed: %08lx
\n
"
,
hres
);
todo_wine
ok
(
col
!=
NULL
,
"got null elements collection
\n
"
);
if
(
col
)
{
test_elem_collection
((
IUnknown
*
)
col
,
empty_types
,
ARRAY_SIZE
(
empty_types
));
IHTMLElementCollection_Release
(
col
);
}
br
=
test_create_elem
(
doc
,
L"BR"
);
test_elem_source_index
(
br
,
-
1
);
test_node_append_child
((
IUnknown
*
)
frag
,
(
IUnknown
*
)
br
);
...
...
@@ -11033,6 +11051,52 @@ static void test_docfrag(IHTMLDocument2 *doc)
test_elem_collection
((
IUnknown
*
)
col
,
all_types
,
ARRAY_SIZE
(
all_types
));
IHTMLElementCollection_Release
(
col
);
html
=
test_create_elem
(
doc
,
L"HTML"
);
test_elem_source_index
(
html
,
-
1
);
test_node_append_child
((
IUnknown
*
)
frag
,
(
IUnknown
*
)
html
);
test_elem_source_index
(
html
,
0
);
div
=
test_create_elem
(
doc
,
L"DIV"
);
test_elem_source_index
(
div
,
-
1
);
test_node_append_child
((
IUnknown
*
)
html
,
(
IUnknown
*
)
div
);
test_elem_source_index
(
div
,
1
);
IHTMLElement_Release
(
div
);
div
=
test_create_elem
(
doc
,
L"DIV"
);
test_elem_source_index
(
div
,
-
1
);
test_node_append_child
((
IUnknown
*
)
html
,
(
IUnknown
*
)
div
);
test_elem_source_index
(
div
,
2
);
frag_body
=
test_create_elem
(
doc
,
L"BODY"
);
test_elem_source_index
(
frag_body
,
-
1
);
test_node_append_child
((
IUnknown
*
)
div
,
(
IUnknown
*
)
frag_body
);
test_elem_source_index
(
frag_body
,
3
);
IHTMLElement_Release
(
frag_body
);
IHTMLElement_Release
(
div
);
IHTMLElement_Release
(
html
);
hres
=
IHTMLDocument2_get_body
(
doc
,
&
main_body
);
ok
(
hres
==
S_OK
,
"get_body failed: %08lx
\n
"
,
hres
);
ok
(
main_body
!=
NULL
,
"body == NULL
\n
"
);
hres
=
IHTMLDocument2_get_body
(
frag
,
&
frag_body
);
ok
(
hres
==
S_OK
,
"get_body failed: %08lx
\n
"
,
hres
);
todo_wine
ok
(
frag_body
!=
NULL
,
"body == NULL
\n
"
);
if
(
frag_body
)
{
todo_wine
ok
(
!
iface_cmp
((
IUnknown
*
)
frag_body
,
(
IUnknown
*
)
main_body
),
"frag_body == main_body
\n
"
);
IHTMLElement_Release
(
frag_body
);
}
IHTMLElement_Release
(
main_body
);
col
=
NULL
;
hres
=
IHTMLDocument2_get_all
(
frag
,
&
col
);
todo_wine
ok
(
hres
==
S_OK
,
"get_all failed: %08lx
\n
"
,
hres
);
todo_wine
ok
(
col
!=
NULL
,
"got null elements collection
\n
"
);
if
(
col
)
{
test_elem_collection
((
IUnknown
*
)
col
,
frag_types
,
ARRAY_SIZE
(
frag_types
));
IHTMLElementCollection_Release
(
col
);
}
div
=
test_create_elem
(
frag
,
L"div"
);
owner_doc
=
get_owner_doc
((
IUnknown
*
)
div
);
doc_node
=
get_doc_node
(
doc
);
...
...
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