// ----------------------------------------------------------------------------- // CTestDomExtNotifiers::TestCANSASHandleMessageL // ----------------------------------------------------------------------------- // TInt CTestDomExtNotifiers::TestCANSASHandleMessageL( CStifItemParser& /*aItem*/ ) { // Print to UI _LIT( KTestDomExtNotifiers, "TestDomExtNotifiers" ); _LIT( KTestCANSASHandleMessageL, "TestCANSASHandleMessageL" ); TestModuleIf().Printf( 0, KTestDomExtNotifiers, KTestCANSASHandleMessageL ); // Print to log file iLog->Log( KTestCANSASHandleMessageL ); TBuf8<KGeneralBufferLength> buffer; TBuf8<KGeneralBufferLength> responseBuffer; RNotifier notify; User::LeaveIfError( notify.Connect() ); //Call StartL() function. notify.StartNotifier( KAknGlobalNoteUid, buffer, responseBuffer); notify.UpdateNotifier( KAknGlobalNoteUid, buffer, responseBuffer ); notify.CancelNotifier( KAknGlobalNoteUid ); notify.Close(); return KErrNone; }
void DoTests(TUid aUid,TBool aCheckMNotifierManager) { TInt r; test.Start(_L("Connect to notifier server")); RNotifier n; r = n.Connect(); test(r==KErrNone); test.Next(_L("StartNotifier (without response)")); r = n.StartNotifier(aUid,aCheckMNotifierManager?*&KMNotifierManager:*&KStartData); RDebug::Printf("r=%d", r); test(r==KErrNone); test.Next(_L("CancelNotifier")); r = n.CancelNotifier(aUid); test(r==KErrNone); test.Next(_L("StartNotifier")); TBuf8<128> response; response.SetMax(); response.FillZ(); response.Zero(); r = n.StartNotifier(aUid,aCheckMNotifierManager?*&KMNotifierManager:*&KStartData,response); test(r==KErrNone); test(response==KResponseData); test.Next(_L("UpdateNotifier")); response.SetMax(); response.FillZ(); response.Zero(); // EKA1 text notifier dies if current length < length of response r = n.UpdateNotifier(aUid,aCheckMNotifierManager?*&KMNotifierManager:*&KUpdateData,response); test(r==KErrNone); test(response==KResponseData); test.Next(_L("UpdateNotifierAndGetResponse")); response.SetMax(); response.FillZ(); response.Zero(); // EKA1 text notifier dies if current length < length of response TRequestStatus updateStat; n.UpdateNotifierAndGetResponse(updateStat,aUid,aCheckMNotifierManager?*&KMNotifierManager:*&KUpdateData,response); User::WaitForRequest(updateStat); test(updateStat==KErrNone); test(response==KResponseData); test.Next(_L("CancelNotifier")); r = n.CancelNotifier(aUid); test(r==KErrNone); test.Next(_L("StartNotifierAndGetResponse (to check previous notifier was cancelled)")); response.SetMax(); response.FillZ(); response.Zero(); TRequestStatus stat; n.StartNotifierAndGetResponse(stat,aUid,aCheckMNotifierManager?*&KMNotifierManagerWithCancelCheck:*&KStartWithCancelCheckData,response); User::WaitForRequest(stat); test(stat==KTestNotifierWasPreviouselyCanceled); test(response==KResponseData); test.Next(_L("CancelNotifier")); r = n.CancelNotifier(aUid); test(r==KErrNone); test.Next(_L("Close connection to notifier server")); n.Close(); test.Next(_L("Memory leak tests")); DoMemoryLeakTests(aUid,aCheckMNotifierManager); test.Next(_L("Session cleanup test")); DoCleanumpTests(aUid,aCheckMNotifierManager); test.End(); }