msctf/tests: Test activation and deactivation of a text service.
This commit is contained in:
parent
0cdb39fa2b
commit
94624ee307
|
@ -33,6 +33,11 @@ static ITfInputProcessorProfiles* g_ipp;
|
||||||
static LANGID gLangid;
|
static LANGID gLangid;
|
||||||
static ITfCategoryMgr * g_cm = NULL;
|
static ITfCategoryMgr * g_cm = NULL;
|
||||||
static ITfThreadMgr* g_tm = NULL;
|
static ITfThreadMgr* g_tm = NULL;
|
||||||
|
static TfClientId cid = 0;
|
||||||
|
static TfClientId tid = 0;
|
||||||
|
|
||||||
|
static BOOL test_ShouldActivate = FALSE;
|
||||||
|
static BOOL test_ShouldDeactivate = FALSE;
|
||||||
|
|
||||||
static DWORD tmSinkCookie;
|
static DWORD tmSinkCookie;
|
||||||
static DWORD tmSinkRefCount;
|
static DWORD tmSinkRefCount;
|
||||||
|
@ -240,6 +245,27 @@ static void test_ThreadMgrUnadviseSinks(void)
|
||||||
ITfSource_Release(source);
|
ITfSource_Release(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_Activate(void)
|
||||||
|
{
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
hr = ITfInputProcessorProfiles_ActivateLanguageProfile(g_ipp,&CLSID_FakeService,gLangid,&CLSID_FakeService);
|
||||||
|
todo_wine ok(SUCCEEDED(hr),"Failed to Activate text service\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void test_startSession(void)
|
||||||
|
{
|
||||||
|
test_ShouldActivate = TRUE;
|
||||||
|
ITfThreadMgr_Activate(g_tm,&cid);
|
||||||
|
todo_wine ok(cid != tid,"TextService id mistakenly matches Client id\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void test_endSession(void)
|
||||||
|
{
|
||||||
|
test_ShouldDeactivate = TRUE;
|
||||||
|
ITfThreadMgr_Deactivate(g_tm);
|
||||||
|
}
|
||||||
|
|
||||||
START_TEST(inputprocessor)
|
START_TEST(inputprocessor)
|
||||||
{
|
{
|
||||||
if (SUCCEEDED(initialize()))
|
if (SUCCEEDED(initialize()))
|
||||||
|
@ -250,6 +276,9 @@ START_TEST(inputprocessor)
|
||||||
test_EnumInputProcessorInfo();
|
test_EnumInputProcessorInfo();
|
||||||
test_Enable();
|
test_Enable();
|
||||||
test_ThreadMgrAdviseSinks();
|
test_ThreadMgrAdviseSinks();
|
||||||
|
test_Activate();
|
||||||
|
test_startSession();
|
||||||
|
test_endSession();
|
||||||
test_EnumLanguageProfiles();
|
test_EnumLanguageProfiles();
|
||||||
test_FindClosestCategory();
|
test_FindClosestCategory();
|
||||||
test_Disable();
|
test_Disable();
|
||||||
|
@ -527,12 +556,15 @@ static HRESULT WINAPI TextService_Activate(ITfTextInputProcessor *iface,
|
||||||
ITfThreadMgr *ptim, TfClientId id)
|
ITfThreadMgr *ptim, TfClientId id)
|
||||||
{
|
{
|
||||||
trace("TextService_Activate\n");
|
trace("TextService_Activate\n");
|
||||||
|
ok(test_ShouldActivate,"Activation came unexpectedly\n");
|
||||||
|
tid = id;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI TextService_Deactivate(ITfTextInputProcessor *iface)
|
static HRESULT WINAPI TextService_Deactivate(ITfTextInputProcessor *iface)
|
||||||
{
|
{
|
||||||
trace("TextService_Deactivate\n");
|
trace("TextService_Deactivate\n");
|
||||||
|
ok(test_ShouldDeactivate,"Deactivation came unexpectedly\n");
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue