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
e7615e00
Commit
e7615e00
authored
Mar 18, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLImgElement::onload tests.
parent
21f0c64d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
1 deletion
+59
-1
events.c
dlls/mshtml/tests/events.c
+59
-1
No files found.
dlls/mshtml/tests/events.c
View file @
e7615e00
...
...
@@ -68,6 +68,7 @@ DEFINE_EXPECT(iframe_onreadystatechange_loading);
DEFINE_EXPECT
(
iframe_onreadystatechange_interactive
);
DEFINE_EXPECT
(
iframe_onreadystatechange_complete
);
DEFINE_EXPECT
(
iframedoc_onreadystatechange
);
DEFINE_EXPECT
(
img_onload
);
static
HWND
container_hwnd
=
NULL
;
static
IHTMLWindow2
*
window
;
...
...
@@ -93,7 +94,10 @@ static const char click_doc_str[] =
"</body></html>"
;
static
const
char
readystate_doc_str
[]
=
"<<html><body><iframe id=
\"
iframe
\"
></iframe></body></html>"
;
"<html><body><iframe id=
\"
iframe
\"
></iframe></body></html>"
;
static
const
char
img_doc_str
[]
=
"<html><body><img id=
\"
imgid
\"
></img></body></html>"
;
static
const
char
*
debugstr_guid
(
REFIID
riid
)
{
...
...
@@ -880,6 +884,17 @@ static HRESULT WINAPI body_onclick(IDispatchEx *iface, DISPID id, LCID lcid, WOR
EVENT_HANDLER_FUNC_OBJ
(
body_onclick
);
static
HRESULT
WINAPI
img_onload
(
IDispatchEx
*
iface
,
DISPID
id
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pdp
,
VARIANT
*
pvarRes
,
EXCEPINFO
*
pei
,
IServiceProvider
*
pspCaller
)
{
CHECK_EXPECT
(
img_onload
);
test_event_args
(
&
DIID_DispHTMLImg
,
id
,
wFlags
,
pdp
,
pvarRes
,
pei
,
pspCaller
);
test_event_src
(
"IMG"
);
return
S_OK
;
}
EVENT_HANDLER_FUNC_OBJ
(
img_onload
);
static
HRESULT
WINAPI
iframedoc_onreadystatechange
(
IDispatchEx
*
iface
,
DISPID
id
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pdp
,
VARIANT
*
pvarRes
,
EXCEPINFO
*
pei
,
IServiceProvider
*
pspCaller
)
{
...
...
@@ -1359,6 +1374,48 @@ static void test_onreadystatechange(IHTMLDocument2 *doc)
IHTMLFrameBase_Release
(
iframe
);
}
static
void
test_imgload
(
IHTMLDocument2
*
doc
)
{
IHTMLImgElement
*
img
;
IHTMLElement
*
elem
;
VARIANT
v
;
BSTR
str
;
HRESULT
hres
;
elem
=
get_elem_id
(
doc
,
"imgid"
);
hres
=
IHTMLElement_QueryInterface
(
elem
,
&
IID_IHTMLImgElement
,
(
void
**
)
&
img
);
IHTMLElement_Release
(
elem
);
ok
(
hres
==
S_OK
,
"Could not get IHTMLImgElement iface: %08x
\n
"
,
hres
);
V_VT
(
&
v
)
=
VT_EMPTY
;
hres
=
IHTMLImgElement_get_onload
(
img
,
&
v
);
ok
(
hres
==
S_OK
,
"get_onload failed: %08x
\n
"
,
hres
);
ok
(
V_VT
(
&
v
)
==
VT_NULL
,
"V_VT(onload) = %d
\n
"
,
V_VT
(
&
v
));
V_VT
(
&
v
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
v
)
=
(
IDispatch
*
)
&
img_onload_obj
;
hres
=
IHTMLImgElement_put_onload
(
img
,
v
);
ok
(
hres
==
S_OK
,
"put_onload failed: %08x
\n
"
,
hres
);
V_VT
(
&
v
)
=
VT_EMPTY
;
hres
=
IHTMLImgElement_get_onload
(
img
,
&
v
);
ok
(
hres
==
S_OK
,
"get_onload failed: %08x
\n
"
,
hres
);
ok
(
V_VT
(
&
v
)
==
VT_DISPATCH
,
"V_VT(onload) = %d
\n
"
,
V_VT
(
&
v
));
ok
(
V_DISPATCH
(
&
v
)
==
(
IDispatch
*
)
&
img_onload_obj
,
"V_DISPATCH(onload) != onloadkFunc
\n
"
);
VariantClear
(
&
v
);
str
=
a2bstr
(
"http://www.winehq.org/images/winehq_logo_text.png"
);
hres
=
IHTMLImgElement_put_src
(
img
,
str
);
ok
(
hres
==
S_OK
,
"put_src failed: %08x
\n
"
,
hres
);
SysFreeString
(
str
);
SET_EXPECT
(
img_onload
);
pump_msgs
(
&
called_img_onload
);
CHECK_CALLED
(
img_onload
);
IHTMLImgElement_Release
(
img
);
}
static
void
test_timeout
(
IHTMLDocument2
*
doc
)
{
IHTMLWindow3
*
win3
;
...
...
@@ -1998,6 +2055,7 @@ START_TEST(events)
run_test
(
empty_doc_str
,
test_timeout
);
run_test
(
click_doc_str
,
test_onclick
);
run_test
(
readystate_doc_str
,
test_onreadystatechange
);
run_test
(
img_doc_str
,
test_imgload
);
DestroyWindow
(
container_hwnd
);
CoUninitialize
();
...
...
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