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
666004cd
Commit
666004cd
authored
Feb 08, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 08, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Removed code duplication in frame collection tests.
parent
f83762e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
70 deletions
+24
-70
dom.c
dlls/mshtml/tests/dom.c
+24
-70
No files found.
dlls/mshtml/tests/dom.c
View file @
666004cd
...
...
@@ -5832,27 +5832,12 @@ static void test_frame(IDispatch *disp, const char *exp_id)
IHTMLDocument2_Release
(
top_doc
);
}
static
void
test_frames
et
(
IHTMLDocument2
*
doc
)
static
void
test_frames
_collection
(
IHTMLFramesCollection2
*
frames
,
const
char
*
frid
)
{
IHTMLWindow2
*
window
;
IHTMLFramesCollection2
*
frames
;
IHTMLElement
*
elem
;
IHTMLFrameBase
*
fbase
;
LONG
length
;
VARIANT
index_var
,
result_var
;
BSTR
str
;
LONG
length
;
HRESULT
hres
;
window
=
get_doc_window
(
doc
);
/* test using IHTMLFramesCollection object */
hres
=
IHTMLWindow2_get_frames
(
window
,
&
frames
);
ok
(
hres
==
S_OK
,
"IHTMLWindow2_get_frames failed: 0x%08x
\n
"
,
hres
);
IHTMLWindow2_Release
(
window
);
if
(
FAILED
(
hres
))
return
;
/* test result length */
hres
=
IHTMLFramesCollection2_get_length
(
frames
,
&
length
);
ok
(
hres
==
S_OK
,
"IHTMLFramesCollection2_get_length failed: 0x%08x
\n
"
,
hres
);
...
...
@@ -5888,12 +5873,12 @@ static void test_frameset(IHTMLDocument2 *doc)
/* string argument (element id lookup) */
V_VT
(
&
index_var
)
=
VT_BSTR
;
V_BSTR
(
&
index_var
)
=
a2bstr
(
"fr1"
);
V_BSTR
(
&
index_var
)
=
a2bstr
(
frid
);
hres
=
IHTMLFramesCollection2_item
(
frames
,
&
index_var
,
&
result_var
);
ok
(
hres
==
S_OK
,
"IHTMLFramesCollection2_item failed: 0x%08x
\n
"
,
hres
);
if
(
SUCCEEDED
(
hres
))
{
ok
(
V_VT
(
&
result_var
)
==
VT_DISPATCH
,
"result type should have been VT_DISPATCH, was: 0x%x
\n
"
,
V_VT
(
&
result_var
));
test_frame
(
V_DISPATCH
(
&
result_var
),
"fr1"
);
test_frame
(
V_DISPATCH
(
&
result_var
),
frid
);
}
VariantClear
(
&
result_var
);
VariantClear
(
&
index_var
);
...
...
@@ -5905,63 +5890,31 @@ static void test_frameset(IHTMLDocument2 *doc)
ok
(
hres
==
E_INVALIDARG
,
"IHTMLFramesCollection2_item should have"
"failed with E_INVALIDARG, instead: 0x%08x
\n
"
,
hres
);
VariantClear
(
&
result_var
);
}
IHTMLFramesCollection2_Release
(
frames
);
/* test using IHTMLWindow2 inheritance */
/* test result length */
hres
=
IHTMLWindow2_get_length
(
window
,
&
length
)
;
ok
(
hres
==
S_OK
,
"IHTMLWindow2_get_length failed: 0x%08x
\n
"
,
hres
)
;
ok
(
length
==
3
,
"IHTMLWindow2_get_length should have been 3, was: %d
\n
"
,
length
)
;
static
void
test_frameset
(
IHTMLDocument2
*
doc
)
{
IHTMLWindow2
*
window
;
IHTMLFramesCollection2
*
frames
;
IHTMLElement
*
elem
;
IHTMLFrameBase
*
fbase
;
BSTR
str
;
HRESULT
hres
;
/* test first frame */
V_VT
(
&
index_var
)
=
VT_I4
;
V_I4
(
&
index_var
)
=
0
;
hres
=
IHTMLWindow2_item
(
window
,
&
index_var
,
&
result_var
);
ok
(
hres
==
S_OK
,
"IHTMLWindow2_item failed: 0x%08x
\n
"
,
hres
);
if
(
SUCCEEDED
(
hres
))
{
ok
(
V_VT
(
&
result_var
)
==
VT_DISPATCH
,
"result type should have been VT_DISPATCH, was: 0x%x
\n
"
,
V_VT
(
&
result_var
));
test_frame
((
IDispatch
*
)
V_DISPATCH
(
&
result_var
),
"fr1"
);
}
VariantClear
(
&
result_var
);
window
=
get_doc_window
(
doc
);
/* test second frame */
V_I4
(
&
index_var
)
=
1
;
hres
=
IHTMLWindow2_item
(
window
,
&
index_var
,
&
result_var
);
ok
(
hres
==
S_OK
,
"IHTMLWindow2_item failed: 0x%08x
\n
"
,
hres
);
if
(
SUCCEEDED
(
hres
))
{
ok
(
V_VT
(
&
result_var
)
==
VT_DISPATCH
,
"result type should have been VT_DISPATCH, was: 0x%x
\n
"
,
V_VT
(
&
result_var
));
test_frame
((
IDispatch
*
)
V_DISPATCH
(
&
result_var
),
"fr2"
);
}
VariantClear
(
&
result_var
);
/* test using IHTMLFramesCollection object */
/* fail on next frame */
V_I4
(
&
index_var
)
=
3
;
hres
=
IHTMLWindow2_item
(
window
,
&
index_var
,
&
result_var
);
ok
(
hres
==
DISP_E_MEMBERNOTFOUND
,
"IHTMLWindow2_item should have"
"failed with DISP_E_MEMBERNOTFOUND, instead: 0x%08x
\n
"
,
hres
);
VariantClear
(
&
result_var
);
hres
=
IHTMLWindow2_get_frames
(
window
,
&
frames
);
ok
(
hres
==
S_OK
,
"IHTMLWindow2_get_frames failed: 0x%08x
\n
"
,
hres
);
if
(
FAILED
(
hres
))
return
;
/* string argument (element id lookup) */
V_VT
(
&
index_var
)
=
VT_BSTR
;
V_BSTR
(
&
index_var
)
=
a2bstr
(
"fr2"
);
hres
=
IHTMLWindow2_item
(
window
,
&
index_var
,
&
result_var
);
ok
(
hres
==
S_OK
,
"IHTMLWindow2_item failed: 0x%08x
\n
"
,
hres
);
if
(
SUCCEEDED
(
hres
))
{
ok
(
V_VT
(
&
result_var
)
==
VT_DISPATCH
,
"result type should have been VT_DISPATCH, was: 0x%x
\n
"
,
V_VT
(
&
result_var
));
test_frame
((
IDispatch
*
)
V_DISPATCH
(
&
result_var
),
"fr2"
);
}
VariantClear
(
&
result_var
);
VariantClear
(
&
index_var
);
test_frames_collection
(
frames
,
"fr1"
);
IHTMLFramesCollection2_Release
(
frames
);
/* invalid argument */
V_VT
(
&
index_var
)
=
VT_BOOL
;
V_BOOL
(
&
index_var
)
=
VARIANT_TRUE
;
hres
=
IHTMLWindow2_item
(
window
,
&
index_var
,
&
result_var
);
ok
(
hres
==
E_INVALIDARG
,
"IHTMLWindow2_item should have"
"failed with E_INVALIDARG, instead: 0x%08x
\n
"
,
hres
);
VariantClear
(
&
result_var
);
/* test using IHTMLWindow2 inheritance */
test_frames_collection
((
IHTMLFramesCollection2
*
)
window
,
"fr2"
);
/* getElementById with node name attributes */
elem
=
get_doc_elem_by_id
(
doc
,
"nm1"
);
...
...
@@ -6018,6 +5971,7 @@ static void test_frameset(IHTMLDocument2 *doc)
IHTMLFrameBase_Release
(
fbase
);
IHTMLElement_Release
(
elem
);
IHTMLWindow2_Release
(
window
);
}
static
IHTMLDocument2
*
create_docfrag
(
IHTMLDocument2
*
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