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
f2669d6e
Commit
f2669d6e
authored
Jul 07, 2015
by
Zhenbo Li
Committed by
Alexandre Julliard
Jul 08, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml/tests: Wait for the document to be completely loaded.
parent
270790a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
0 deletions
+83
-0
xmlhttprequest.c
dlls/mshtml/tests/xmlhttprequest.c
+83
-0
No files found.
dlls/mshtml/tests/xmlhttprequest.c
View file @
f2669d6e
...
...
@@ -279,6 +279,84 @@ static IDispatchExVtbl xmlhttprequest_onreadystatechangeFuncVtbl = {
};
static
IDispatchEx
xmlhttprequest_onreadystatechange_obj
=
{
&
xmlhttprequest_onreadystatechangeFuncVtbl
};
static
BOOL
doc_complete
;
static
IHTMLDocument2
*
notif_doc
;
static
HRESULT
WINAPI
PropertyNotifySink_QueryInterface
(
IPropertyNotifySink
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
if
(
IsEqualGUID
(
&
IID_IPropertyNotifySink
,
riid
))
{
*
ppv
=
iface
;
return
S_OK
;
}
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
PropertyNotifySink_AddRef
(
IPropertyNotifySink
*
iface
)
{
return
2
;
}
static
ULONG
WINAPI
PropertyNotifySink_Release
(
IPropertyNotifySink
*
iface
)
{
return
1
;
}
static
HRESULT
WINAPI
PropertyNotifySink_OnChanged
(
IPropertyNotifySink
*
iface
,
DISPID
dispID
)
{
if
(
dispID
==
DISPID_READYSTATE
){
BSTR
state
;
HRESULT
hres
;
hres
=
IHTMLDocument2_get_readyState
(
notif_doc
,
&
state
);
ok
(
hres
==
S_OK
,
"get_readyState failed: %08x
\n
"
,
hres
);
if
(
!
strcmp_wa
(
state
,
"complete"
))
doc_complete
=
TRUE
;
SysFreeString
(
state
);
}
return
S_OK
;
}
static
HRESULT
WINAPI
PropertyNotifySink_OnRequestEdit
(
IPropertyNotifySink
*
iface
,
DISPID
dispID
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
IPropertyNotifySinkVtbl
PropertyNotifySinkVtbl
=
{
PropertyNotifySink_QueryInterface
,
PropertyNotifySink_AddRef
,
PropertyNotifySink_Release
,
PropertyNotifySink_OnChanged
,
PropertyNotifySink_OnRequestEdit
};
static
IPropertyNotifySink
PropertyNotifySink
=
{
&
PropertyNotifySinkVtbl
};
static
void
do_advise
(
IUnknown
*
unk
,
REFIID
riid
,
IUnknown
*
unk_advise
)
{
IConnectionPointContainer
*
container
;
IConnectionPoint
*
cp
;
DWORD
cookie
;
HRESULT
hres
;
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IConnectionPointContainer
,
(
void
**
)
&
container
);
ok
(
hres
==
S_OK
,
"QueryInterface(IID_IConnectionPointContainer) failed: %08x
\n
"
,
hres
);
hres
=
IConnectionPointContainer_FindConnectionPoint
(
container
,
riid
,
&
cp
);
IConnectionPointContainer_Release
(
container
);
ok
(
hres
==
S_OK
,
"FindConnectionPoint failed: %08x
\n
"
,
hres
);
hres
=
IConnectionPoint_Advise
(
cp
,
unk_advise
,
&
cookie
);
IConnectionPoint_Release
(
cp
);
ok
(
hres
==
S_OK
,
"Advise failed: %08x
\n
"
,
hres
);
}
static
void
pump_msgs
(
BOOL
*
b
)
{
MSG
msg
;
...
...
@@ -611,6 +689,11 @@ static IHTMLDocument2 *create_doc_from_url(const char *start_url)
IBindCtx_Release
(
bc
);
SysFreeString
(
url
);
doc_complete
=
FALSE
;
notif_doc
=
doc
;
do_advise
((
IUnknown
*
)
doc
,
&
IID_IPropertyNotifySink
,
(
IUnknown
*
)
&
PropertyNotifySink
);
pump_msgs
(
&
doc_complete
);
return
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