Aric Stewart : msctf/tests: Test activation and deactivation of a text service.

Alexandre Julliard julliard at winehq.org
Wed Apr 22 10:18:48 CDT 2009


Module: wine
Branch: master
Commit: 94624ee307e46c952c73e192f9a6d168743cb008
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=94624ee307e46c952c73e192f9a6d168743cb008

Author: Aric Stewart <aric at codeweavers.com>
Date:   Tue Apr 21 11:02:24 2009 -0500

msctf/tests: Test activation and deactivation of a text service.

---

 dlls/msctf/tests/inputprocessor.c |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/dlls/msctf/tests/inputprocessor.c b/dlls/msctf/tests/inputprocessor.c
index 4fd61b5..62c93d7 100644
--- a/dlls/msctf/tests/inputprocessor.c
+++ b/dlls/msctf/tests/inputprocessor.c
@@ -33,6 +33,11 @@ static ITfInputProcessorProfiles* g_ipp;
 static LANGID gLangid;
 static ITfCategoryMgr * g_cm = 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 tmSinkRefCount;
@@ -240,6 +245,27 @@ static void test_ThreadMgrUnadviseSinks(void)
     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)
 {
     if (SUCCEEDED(initialize()))
@@ -250,6 +276,9 @@ START_TEST(inputprocessor)
         test_EnumInputProcessorInfo();
         test_Enable();
         test_ThreadMgrAdviseSinks();
+        test_Activate();
+        test_startSession();
+        test_endSession();
         test_EnumLanguageProfiles();
         test_FindClosestCategory();
         test_Disable();
@@ -527,12 +556,15 @@ static HRESULT WINAPI TextService_Activate(ITfTextInputProcessor *iface,
         ITfThreadMgr *ptim, TfClientId id)
 {
     trace("TextService_Activate\n");
+    ok(test_ShouldActivate,"Activation came unexpectedly\n");
+    tid = id;
     return S_OK;
 }
 
 static HRESULT WINAPI TextService_Deactivate(ITfTextInputProcessor *iface)
 {
     trace("TextService_Deactivate\n");
+    ok(test_ShouldDeactivate,"Deactivation came unexpectedly\n");
     return S_OK;
 }
 




More information about the wine-cvs mailing list