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
4585687e
Commit
4585687e
authored
May 05, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
May 05, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msctf: Added ITfTransitoryExtensionSink tests.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a9d4b034
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
0 deletions
+67
-0
inputprocessor.c
dlls/msctf/tests/inputprocessor.c
+67
-0
No files found.
dlls/msctf/tests/inputprocessor.c
View file @
4585687e
...
...
@@ -62,6 +62,7 @@ static BOOL test_ShouldDeactivate = FALSE;
static
DWORD
tmSinkCookie
;
static
DWORD
tmSinkRefCount
;
static
DWORD
dmSinkCookie
;
static
DWORD
documentStatus
;
static
ITfDocumentMgr
*
test_CurrentFocus
=
NULL
;
static
ITfDocumentMgr
*
test_PrevFocus
=
NULL
;
...
...
@@ -622,6 +623,42 @@ static HRESULT ThreadMgrEventSink_Constructor(IUnknown **ppOut)
return
S_OK
;
}
static
HRESULT
WINAPI
TfTransitoryExtensionSink_QueryInterface
(
ITfTransitoryExtensionSink
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
||
IsEqualGUID
(
&
IID_ITfTransitoryExtensionSink
,
riid
))
{
*
ppv
=
iface
;
return
S_OK
;
}
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
TfTransitoryExtensionSink_AddRef
(
ITfTransitoryExtensionSink
*
iface
)
{
return
2
;
}
static
ULONG
WINAPI
TfTransitoryExtensionSink_Release
(
ITfTransitoryExtensionSink
*
iface
)
{
return
1
;
}
static
HRESULT
WINAPI
TfTransitoryExtensionSink_OnTransitoryExtensionUpdated
(
ITfTransitoryExtensionSink
*
iface
,
ITfContext
*
pic
,
TfEditCookie
ecReadOnly
,
ITfRange
*
pResultRange
,
ITfRange
*
pCompositionRange
,
BOOL
*
pfDeleteResultRange
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
const
ITfTransitoryExtensionSinkVtbl
TfTransitoryExtensionSinkVtbl
=
{
TfTransitoryExtensionSink_QueryInterface
,
TfTransitoryExtensionSink_AddRef
,
TfTransitoryExtensionSink_Release
,
TfTransitoryExtensionSink_OnTransitoryExtensionUpdated
};
static
ITfTransitoryExtensionSink
TfTransitoryExtensionSink
=
{
&
TfTransitoryExtensionSinkVtbl
};
/********************************************************************************************
* Stub text service for testing
...
...
@@ -1053,6 +1090,34 @@ static void test_ThreadMgrUnadviseSinks(void)
ITfSource_Release
(
source
);
}
static
void
test_DocumentMgrAdviseSinks
(
void
)
{
ITfSource
*
source
;
HRESULT
hr
;
hr
=
ITfDocumentMgr_QueryInterface
(
g_dm
,
&
IID_ITfSource
,
(
void
**
)
&
source
);
ok
(
hr
==
S_OK
,
"Failed to get IID_ITfSource for DocumentMgr
\n
"
);
dmSinkCookie
=
0
;
hr
=
ITfSource_AdviseSink
(
source
,
&
IID_ITfTransitoryExtensionSink
,
(
IUnknown
*
)
&
TfTransitoryExtensionSink
,
&
dmSinkCookie
);
ok
(
hr
==
S_OK
,
"Failed to Advise Sink
\n
"
);
ITfSource_Release
(
source
);
}
static
void
test_DocumentMgrUnadviseSinks
(
void
)
{
ITfSource
*
source
=
NULL
;
HRESULT
hr
;
hr
=
ITfDocumentMgr_QueryInterface
(
g_dm
,
&
IID_ITfSource
,
(
void
**
)
&
source
);
ok
(
hr
==
S_OK
,
"Failed to get IID_ITfSource for DocumentMgr
\n
"
);
hr
=
ITfSource_UnadviseSink
(
source
,
dmSinkCookie
);
ok
(
hr
==
S_OK
,
"Failed to unadvise Sink
\n
"
);
ITfSource_Release
(
source
);
}
/**********************************************************************
* ITfKeyEventSink
**********************************************************************/
...
...
@@ -2240,6 +2305,7 @@ START_TEST(inputprocessor)
test_ThreadMgrAdviseSinks
();
test_Activate
();
test_startSession
();
test_DocumentMgrAdviseSinks
();
test_TfGuidAtom
();
test_ClientId
();
test_KeystrokeMgr
();
...
...
@@ -2250,6 +2316,7 @@ START_TEST(inputprocessor)
test_FindClosestCategory
();
test_Disable
();
test_ThreadMgrUnadviseSinks
();
test_DocumentMgrUnadviseSinks
();
test_UnregisterCategory
();
test_Unregister
();
test_profile_mgr
();
...
...
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