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
ccf9b229
Commit
ccf9b229
authored
Dec 17, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 17, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shdocvw: Moved getting dochost pointer to separated function.
parent
07b6e423
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
42 deletions
+49
-42
webbrowser.c
dlls/shdocvw/tests/webbrowser.c
+49
-42
No files found.
dlls/shdocvw/tests/webbrowser.c
View file @
ccf9b229
...
@@ -212,6 +212,51 @@ static void _test_ready_state(unsigned line, READYSTATE exstate)
...
@@ -212,6 +212,51 @@ static void _test_ready_state(unsigned line, READYSTATE exstate)
ok_
(
__FILE__
,
line
)(
state
==
exstate
,
"ReadyState = %d, expected %d
\n
"
,
state
,
exstate
);
ok_
(
__FILE__
,
line
)(
state
==
exstate
,
"ReadyState = %d, expected %d
\n
"
,
state
,
exstate
);
}
}
#define get_document(u) _get_document(__LINE__,u)
static
IDispatch
*
_get_document
(
unsigned
line
,
IUnknown
*
unk
)
{
IHTMLDocument2
*
html_doc
;
IWebBrowser2
*
wb
;
IDispatch
*
disp
;
HRESULT
hres
;
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IWebBrowser2
,
(
void
**
)
&
wb
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"QueryInterface(IID_IWebBrowser2) failed: %08x
\n
"
,
hres
);
disp
=
NULL
;
hres
=
IWebBrowser2_get_Document
(
wb
,
&
disp
);
IWebBrowser2_Release
(
wb
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_Document failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
disp
!=
NULL
,
"doc_disp == NULL
\n
"
);
hres
=
IDispatch_QueryInterface
(
disp
,
&
IID_IHTMLDocument2
,
(
void
**
)
&
html_doc
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"Could not get IHTMLDocument iface: %08x
\n
"
,
hres
);
ok
(
disp
==
(
IDispatch
*
)
html_doc
,
"disp != html_doc
\n
"
);
IHTMLDocument_Release
(
html_doc
);
return
disp
;
}
#define get_dochost(u) _get_dochost(__LINE__,u)
static
IOleClientSite
*
_get_dochost
(
unsigned
line
,
IUnknown
*
unk
)
{
IOleClientSite
*
client_site
;
IOleObject
*
oleobj
;
IDispatch
*
doc
;
HRESULT
hres
;
doc
=
_get_document
(
line
,
unk
);
hres
=
IDispatch_QueryInterface
(
doc
,
&
IID_IOleObject
,
(
void
**
)
&
oleobj
);
IDispatch_Release
(
doc
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"Got 0x%08x
\n
"
,
hres
);
hres
=
IOleObject_GetClientSite
(
oleobj
,
&
client_site
);
IOleObject_Release
(
oleobj
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"Got 0x%08x
\n
"
,
hres
);
return
client_site
;
}
static
HRESULT
QueryInterface
(
REFIID
,
void
**
);
static
HRESULT
QueryInterface
(
REFIID
,
void
**
);
static
HRESULT
WINAPI
OleCommandTarget_QueryInterface
(
IOleCommandTarget
*
iface
,
static
HRESULT
WINAPI
OleCommandTarget_QueryInterface
(
IOleCommandTarget
*
iface
,
...
@@ -2482,31 +2527,6 @@ static void test_IServiceProvider(IUnknown *unk)
...
@@ -2482,31 +2527,6 @@ static void test_IServiceProvider(IUnknown *unk)
IServiceProvider_Release
(
servprov
);
IServiceProvider_Release
(
servprov
);
}
}
#define get_document(u) _get_document(__LINE__,u)
static
IDispatch
*
_get_document
(
unsigned
line
,
IUnknown
*
unk
)
{
IHTMLDocument2
*
html_doc
;
IWebBrowser2
*
wb
;
IDispatch
*
disp
;
HRESULT
hres
;
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IWebBrowser2
,
(
void
**
)
&
wb
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"QueryInterface(IID_IWebBrowser2) failed: %08x
\n
"
,
hres
);
disp
=
NULL
;
hres
=
IWebBrowser2_get_Document
(
wb
,
&
disp
);
IWebBrowser2_Release
(
wb
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_Document failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
disp
!=
NULL
,
"doc_disp == NULL
\n
"
);
hres
=
IDispatch_QueryInterface
(
disp
,
&
IID_IHTMLDocument2
,
(
void
**
)
&
html_doc
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"Could not get IHTMLDocument iface: %08x
\n
"
,
hres
);
ok
(
disp
==
(
IDispatch
*
)
html_doc
,
"disp != html_doc
\n
"
);
IHTMLDocument_Release
(
html_doc
);
return
disp
;
}
static
void
test_put_href
(
IUnknown
*
unk
)
static
void
test_put_href
(
IUnknown
*
unk
)
{
{
IHTMLLocation
*
location
;
IHTMLLocation
*
location
;
...
@@ -2646,9 +2666,8 @@ static void test_UIActivate(IUnknown *unk, BOOL activate)
...
@@ -2646,9 +2666,8 @@ static void test_UIActivate(IUnknown *unk, BOOL activate)
static
void
test_TranslateAccelerator
(
IUnknown
*
unk
)
static
void
test_TranslateAccelerator
(
IUnknown
*
unk
)
{
{
IOleClientSite
*
doc_clientsite
;
IOleInPlaceActiveObject
*
pao
;
IOleInPlaceActiveObject
*
pao
;
IOleObject
*
obj_doc
;
IDispatch
*
disp_doc
;
HRESULT
hres
;
HRESULT
hres
;
DWORD
keycode
;
DWORD
keycode
;
MSG
msg_a
=
{
MSG
msg_a
=
{
...
@@ -2705,15 +2724,8 @@ static void test_TranslateAccelerator(IUnknown *unk)
...
@@ -2705,15 +2724,8 @@ static void test_TranslateAccelerator(IUnknown *unk)
IOleInPlaceActiveObject_Release
(
pao
);
IOleInPlaceActiveObject_Release
(
pao
);
}
}
disp_doc
=
get_document
(
unk
);
doc_clientsite
=
get_dochost
(
unk
);
hres
=
IDispatch_QueryInterface
(
disp_doc
,
&
IID_IOleObject
,
(
void
**
)
&
obj_doc
);
if
(
doc_clientsite
)
{
ok
(
hres
==
S_OK
,
"Got 0x%08x
\n
"
,
hres
);
if
(
SUCCEEDED
(
hres
))
{
IOleClientSite
*
doc_clientsite
;
hres
=
IOleObject_GetClientSite
(
obj_doc
,
&
doc_clientsite
);
ok
(
hres
==
S_OK
,
"Got 0x%08x
\n
"
,
hres
);
if
(
SUCCEEDED
(
hres
))
{
IDocHostUIHandler2
*
dochost
;
IDocHostUIHandler2
*
dochost
;
IOleControlSite
*
doc_controlsite
;
IOleControlSite
*
doc_controlsite
;
IUnknown
*
unk_test
;
IUnknown
*
unk_test
;
...
@@ -2733,7 +2745,6 @@ static void test_TranslateAccelerator(IUnknown *unk)
...
@@ -2733,7 +2745,6 @@ static void test_TranslateAccelerator(IUnknown *unk)
hres
=
IOleClientSite_QueryInterface
(
doc_clientsite
,
&
IID_IDocHostUIHandler2
,
(
void
**
)
&
dochost
);
hres
=
IOleClientSite_QueryInterface
(
doc_clientsite
,
&
IID_IDocHostUIHandler2
,
(
void
**
)
&
dochost
);
ok
(
hres
==
S_OK
,
"Got 0x%08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"Got 0x%08x
\n
"
,
hres
);
if
(
SUCCEEDED
(
hres
))
{
if
(
SUCCEEDED
(
hres
))
{
msg_a
.
message
=
WM_KEYDOWN
;
msg_a
.
message
=
WM_KEYDOWN
;
hr_dochost_TranslateAccelerator
=
0xdeadbeef
;
hr_dochost_TranslateAccelerator
=
0xdeadbeef
;
for
(
keycode
=
0
;
keycode
<=
0x100
;
keycode
++
)
{
for
(
keycode
=
0
;
keycode
<=
0x100
;
keycode
++
)
{
...
@@ -2752,10 +2763,10 @@ static void test_TranslateAccelerator(IUnknown *unk)
...
@@ -2752,10 +2763,10 @@ static void test_TranslateAccelerator(IUnknown *unk)
IDocHostUIHandler2_Release
(
dochost
);
IDocHostUIHandler2_Release
(
dochost
);
}
}
hres
=
IOleClientSite_QueryInterface
(
doc_clientsite
,
&
IID_IOleControlSite
,
(
void
**
)
&
doc_controlsite
);
hres
=
IOleClientSite_QueryInterface
(
doc_clientsite
,
&
IID_IOleControlSite
,
(
void
**
)
&
doc_controlsite
);
ok
(
hres
==
S_OK
,
"Got 0x%08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"Got 0x%08x
\n
"
,
hres
);
if
(
SUCCEEDED
(
hres
))
{
if
(
SUCCEEDED
(
hres
))
{
msg_a
.
message
=
WM_KEYDOWN
;
msg_a
.
message
=
WM_KEYDOWN
;
hr_site_TranslateAccelerator
=
0xdeadbeef
;
hr_site_TranslateAccelerator
=
0xdeadbeef
;
for
(
keycode
=
0
;
keycode
<
0x100
;
keycode
++
)
{
for
(
keycode
=
0
;
keycode
<
0x100
;
keycode
++
)
{
...
@@ -2792,10 +2803,6 @@ static void test_TranslateAccelerator(IUnknown *unk)
...
@@ -2792,10 +2803,6 @@ static void test_TranslateAccelerator(IUnknown *unk)
IOleClientSite_Release
(
doc_clientsite
);
IOleClientSite_Release
(
doc_clientsite
);
}
}
IOleObject_Release
(
obj_doc
);
}
IDispatch_Release
(
disp_doc
);
test_UIActivate
(
unk
,
FALSE
);
test_UIActivate
(
unk
,
FALSE
);
}
}
...
...
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