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
f77aabec
Commit
f77aabec
authored
May 10, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
May 10, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ieframe: Added more InternetExplorer object tests.
parent
778c6455
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
167 additions
and
0 deletions
+167
-0
ie.c
dlls/ieframe/tests/ie.c
+167
-0
No files found.
dlls/ieframe/tests/ie.c
View file @
f77aabec
...
@@ -26,8 +26,147 @@
...
@@ -26,8 +26,147 @@
#include "winbase.h"
#include "winbase.h"
#include "ole2.h"
#include "ole2.h"
#include "exdisp.h"
#include "exdisp.h"
#include "exdispid.h"
#include "mshtml.h"
#include "mshtml.h"
#define DEFINE_EXPECT(func) \
static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
#define SET_EXPECT(func) \
expect_ ## func = TRUE
#define CHECK_EXPECT2(func) \
do { \
ok(expect_ ##func, "unexpected call " #func "\n"); \
called_ ## func = TRUE; \
}while(0)
#define CHECK_EXPECT(func) \
do { \
CHECK_EXPECT2(func); \
expect_ ## func = FALSE; \
}while(0)
#define CHECK_CALLED(func) \
do { \
ok(called_ ## func, "expected " #func "\n"); \
expect_ ## func = called_ ## func = FALSE; \
}while(0)
DEFINE_EXPECT
(
Invoke_NAVIGATECOMPLETE2
);
static
BOOL
navigate_complete
;
static
BSTR
a2bstr
(
const
char
*
str
)
{
BSTR
ret
;
int
len
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
);
ret
=
SysAllocStringLen
(
NULL
,
len
);
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
);
return
ret
;
}
static
HRESULT
WINAPI
Dispatch_QueryInterface
(
IDispatch
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
||
IsEqualGUID
(
&
IID_IDispatch
,
riid
))
{
*
ppv
=
iface
;
return
S_OK
;
}
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
Dispatch_AddRef
(
IDispatch
*
iface
)
{
return
2
;
}
static
ULONG
WINAPI
Dispatch_Release
(
IDispatch
*
iface
)
{
return
1
;
}
static
HRESULT
WINAPI
Dispatch_GetTypeInfoCount
(
IDispatch
*
iface
,
UINT
*
pctinfo
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
Dispatch_GetTypeInfo
(
IDispatch
*
iface
,
UINT
iTInfo
,
LCID
lcid
,
ITypeInfo
**
ppTInfo
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
Dispatch_GetIDsOfNames
(
IDispatch
*
iface
,
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispId
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
Dispatch_Invoke
(
IDispatch
*
iface
,
DISPID
dispIdMember
,
REFIID
riid
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pDispParams
,
VARIANT
*
pVarResult
,
EXCEPINFO
*
pExcepInfo
,
UINT
*
puArgErr
)
{
switch
(
dispIdMember
)
{
case
DISPID_NAVIGATECOMPLETE2
:
CHECK_EXPECT
(
Invoke_NAVIGATECOMPLETE2
);
navigate_complete
=
TRUE
;
return
S_OK
;
}
return
E_NOTIMPL
;
}
static
IDispatchVtbl
DispatchVtbl
=
{
Dispatch_QueryInterface
,
Dispatch_AddRef
,
Dispatch_Release
,
Dispatch_GetTypeInfoCount
,
Dispatch_GetTypeInfo
,
Dispatch_GetIDsOfNames
,
Dispatch_Invoke
};
static
IDispatch
Dispatch
=
{
&
DispatchVtbl
};
static
void
advise_cp
(
IUnknown
*
unk
,
BOOL
init
)
{
IConnectionPointContainer
*
container
;
IConnectionPoint
*
point
;
HRESULT
hres
;
static
DWORD
cookie
=
100
;
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IConnectionPointContainer
,
(
void
**
)
&
container
);
ok
(
hres
==
S_OK
,
"QueryInterface(IID_IConnectionPointContainer) failed: %08x
\n
"
,
hres
);
if
(
FAILED
(
hres
))
return
;
hres
=
IConnectionPointContainer_FindConnectionPoint
(
container
,
&
DIID_DWebBrowserEvents2
,
&
point
);
IConnectionPointContainer_Release
(
container
);
ok
(
hres
==
S_OK
,
"FindConnectionPoint failed: %08x
\n
"
,
hres
);
if
(
FAILED
(
hres
))
return
;
if
(
init
)
{
hres
=
IConnectionPoint_Advise
(
point
,
(
IUnknown
*
)
&
Dispatch
,
&
cookie
);
ok
(
hres
==
S_OK
,
"Advise failed: %08x
\n
"
,
hres
);
}
else
{
hres
=
IConnectionPoint_Unadvise
(
point
,
cookie
);
ok
(
hres
==
S_OK
,
"Unadvise failed: %08x
\n
"
,
hres
);
}
IConnectionPoint_Release
(
point
);
}
static
void
test_visible
(
IWebBrowser2
*
wb
)
static
void
test_visible
(
IWebBrowser2
*
wb
)
{
{
VARIANT_BOOL
b
;
VARIANT_BOOL
b
;
...
@@ -66,6 +205,29 @@ static void test_html_window(IWebBrowser2 *wb)
...
@@ -66,6 +205,29 @@ static void test_html_window(IWebBrowser2 *wb)
IHTMLWindow2_Release
(
html_window
);
IHTMLWindow2_Release
(
html_window
);
}
}
static
void
test_navigate
(
IWebBrowser2
*
wb
,
const
char
*
url
)
{
VARIANT
urlv
,
emptyv
;
MSG
msg
;
HRESULT
hres
;
SET_EXPECT
(
Invoke_NAVIGATECOMPLETE2
);
V_VT
(
&
urlv
)
=
VT_BSTR
;
V_BSTR
(
&
urlv
)
=
a2bstr
(
url
);
V_VT
(
&
emptyv
)
=
VT_EMPTY
;
hres
=
IWebBrowser2_Navigate2
(
wb
,
&
urlv
,
&
emptyv
,
&
emptyv
,
&
emptyv
,
&
emptyv
);
ok
(
hres
==
S_OK
,
"Navigate2 failed: %08x
\n
"
,
hres
);
SysFreeString
(
V_BSTR
(
&
urlv
));
while
(
!
navigate_complete
&&
GetMessageW
(
&
msg
,
NULL
,
0
,
0
))
{
TranslateMessage
(
&
msg
);
DispatchMessage
(
&
msg
);
}
CHECK_CALLED
(
Invoke_NAVIGATECOMPLETE2
);
}
static
void
test_InternetExplorer
(
void
)
static
void
test_InternetExplorer
(
void
)
{
{
IWebBrowser2
*
wb
;
IWebBrowser2
*
wb
;
...
@@ -80,11 +242,16 @@ static void test_InternetExplorer(void)
...
@@ -80,11 +242,16 @@ static void test_InternetExplorer(void)
if
(
hres
!=
S_OK
)
if
(
hres
!=
S_OK
)
return
;
return
;
advise_cp
(
unk
,
TRUE
);
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IWebBrowser2
,
(
void
**
)
&
wb
);
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IWebBrowser2
,
(
void
**
)
&
wb
);
ok
(
hres
==
S_OK
,
"Could not get IWebBrowser2 interface: %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"Could not get IWebBrowser2 interface: %08x
\n
"
,
hres
);
test_visible
(
wb
);
test_visible
(
wb
);
test_html_window
(
wb
);
test_html_window
(
wb
);
test_navigate
(
wb
,
"http://test.winehq.org/tests/hello.html"
);
advise_cp
(
unk
,
FALSE
);
IWebBrowser2_Release
(
wb
);
IWebBrowser2_Release
(
wb
);
ref
=
IUnknown_Release
(
unk
);
ref
=
IUnknown_Release
(
unk
);
...
...
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