/** * @SYMTestCaseID BA-CTSYD-DIS-SMS-NEGATIVE-UN0004 * @SYMComponent telephony_ctsy * @SYMTestCaseDesc Test handing in CTSY dispatch when the GetMessageStoreInfo (a.k.a GetSmsStoreInfo) API is disabled * @SYMTestPriority High * @SYMTestActions Disable API, call API, check correct error returned * @SYMTestExpectedResults Pass * @SYMTestType CT */ void CCTsySmsFUNegative::TestGetSmsStoreInfoL() { TConfig config; config.SetSupportedValue(MLtsyDispatchSmsGetSmsStoreInfo::KLtsyDispatchSmsGetSmsStoreInfoApiId, EFalse); config.PushL(); OpenEtelServerL(EUseExtendedError); CleanupStack::PushL(TCleanupItem(Cleanup,this)); OpenPhoneL(); RMobileSmsMessaging messaging; TInt err = messaging.Open(iPhone); CleanupClosePushL(messaging); RMobilePhoneStore::TMobilePhoneStoreInfoV1 info; RMobilePhoneStore::TMobilePhoneStoreInfoV1Pckg pckgInfo(info); TInt index(0); TRequestStatus status; messaging.GetMessageStoreInfo(status, index, pckgInfo); User::WaitForRequest(status); ASSERT_EQUALS(status.Int(), KErrNotSupported); AssertMockLtsyStatusL(); CleanupStack::PopAndDestroy(3, &config); // messaging, this, config }
void RMobilePhoneStore::GetInfo( TRequestStatus& aReqStatus, TDes8& aInfo) const { RMobilePhoneBookStore::TMobilePhoneBookInfoV1 info; info.iCaps = 0x10000000; RMobilePhoneBookStore::TMobilePhoneBookInfoV1Pckg pckgInfo( info ); aInfo.Copy( pckgInfo ); TRequestStatus* tmp = &aReqStatus; User::RequestComplete(tmp, KErrNone); qDebug("RMobilePhoneStore::GetInfo mock"); }
LOCAL_C void LaunchClientProcessL() { __UHEAP_MARK; RProcess::Rendezvous(KErrNone); RSemaphore sem; User::LeaveIfError(sem.OpenGlobal(KEglStressTest)); CleanupClosePushL(sem); //Access data passed from the main process TStressProcessInfo info; TPckg<TStressProcessInfo> pckgInfo(info); User::LeaveIfError(User::GetDesParameter(KMultiProcessSlot, pckgInfo)); //Create RSgDriver and open the image RSgDriver driver; User::LeaveIfError(driver.Open()); CleanupClosePushL(driver); RSgImage image; User::LeaveIfError(image.Open(info.iSgId)); CleanupClosePushL(image); EGLDisplay display; EGL_LEAVE_NULL(display, eglGetDisplay(EGL_DEFAULT_DISPLAY)); EGL_LEAVE_ERROR(eglInitialize(display, NULL, NULL)); EGL_LEAVE_ERROR(eglBindAPI(EGL_OPENVG_API)); //Initialise to remove arm compiler warnings EGLConfig config = 0; EGLContext context = EGL_NO_CONTEXT; EGLSurface surface = EGL_NO_SURFACE; if(info.iTestType == EStressRead) { TSgImageInfo sginfo; User::LeaveIfError(image.GetInfo(sginfo)); //Create an independant pixmap surface on which to copy the vgimage RSgImage image2; User::LeaveIfError(image2.Create(sginfo, NULL, NULL)); CleanupClosePushL(image2); ChooseConfigAndCreateContextL(display, context, config, image2, KStressTestChildAppPanic, info.iAlphaPre); EGL_LEAVE_NULL(surface, CreatePixmapSurfaceL(display, config, image2, info.iAlphaPre)); CleanupStack::PopAndDestroy(&image2); } else { ChooseConfigAndCreateContextL(display, context, config, image, KStressTestChildAppPanic, info.iAlphaPre); EGL_LEAVE_NULL(surface, CreatePixmapSurfaceL(display, config, image, info.iAlphaPre)); } EGL_LEAVE_ERROR(eglMakeCurrent(display, surface, surface, context)); VGImage vgImage; GenerateVgImageL(display, &image, vgImage); /* Create and install the active scheduler */ CActiveScheduler* sched = new(ELeave) CActiveScheduler; CActiveScheduler::Install(sched); CleanupStack::PushL(sched); TInt width = vgGetParameteri(vgImage, VG_IMAGE_WIDTH); VgLeaveIfErrorL(); TInt height = vgGetParameteri(vgImage, VG_IMAGE_HEIGHT); VgLeaveIfErrorL(); VGImageFormat format = static_cast<VGImageFormat>(vgGetParameteri(vgImage, VG_IMAGE_FORMAT)); VgLeaveIfErrorL(); TBool testPass = ETrue; CTReadWriteChild* painter = CTReadWriteChild::NewL(vgImage, width, height, info.iByteSize, format, info.iTestType, testPass); CleanupStack::PushL(painter); painter->After(TTimeIntervalMicroSeconds32(0)); //Data access is synchronised from the main process sem.Wait(); sched->Start(); if(testPass == EFalse) { // Leave with a 'known' test error so that we can catch this particular failure User::Leave(KTestStressUnexpectedPixelError); } CleanupStack::PopAndDestroy(5, &sem); //painter, sched, image, driver, sem __UHEAP_MARKEND; }
TInt DDisplayLdd::SendControl(TMessageBase* aMsg) { TThreadMessage& m = *(TThreadMessage*)aMsg; TInt aReqNumber = m.iValue; //Use thread local copies of the configuration data that need to be exchanged between the client and DFC thread. RDisplayChannel::TPostCount kernelPostCount; RDisplayChannel::TDisplayRotation kernelRotation; TPckgBuf<RDisplayChannel::TDisplayInfo> pckgInfo(iDisplayInfo); TInt kernelpack[2]; TInt kernelBufferId; TBool kernelRotChanged; TInt kernelIndex; TAny* userConfigData0 = m.Ptr0(); TAny* userConfigData1 = m.Ptr1(); switch (aReqNumber) { //iDisplayInfo doesn't change after the driver initialisation so copy in client thread context case RDisplayChannel::ECtrlGetDisplayInfo: umemput32(userConfigData0, &pckgInfo, sizeof(TPckgBuf<RDisplayChannel::TDisplayInfo>) ); return KErrNone; case RDisplayChannel::ECtrlPostCompositionBuffer: //Client should read data updated in the DFC thread. m.iArg[1] = &kernelPostCount; break; case RDisplayChannel::ECtrlPostLegacyBuffer: //Client should read data updated in the DFC thread. m.iArg[1] = &kernelPostCount; break; case RDisplayChannel::ECtrlRegisterUserBuffer: //Both the client and DFC thread need to read data. umemget32(&kernelpack, userConfigData0, (sizeof(TInt)*2) ); m.iArg[0] = &kernelpack; m.iArg[1] = &kernelBufferId; break; case RDisplayChannel::ECtrlDeregisterUserBuffer: //Client data should be passed to the DFC thread. umemget32(&kernelBufferId, userConfigData0, sizeof(TInt) ); m.iArg[0] = &kernelBufferId; break; case RDisplayChannel::ECtrlSetRotation: //Both the client and DFC thread need to read data. umemget32(&kernelRotation, userConfigData0, sizeof(RDisplayChannel::TDisplayRotation) ); m.iArg[0] = &kernelRotation; m.iArg[1] = &kernelRotChanged; break; case RDisplayChannel::ECtrlCurrentRotation: //Client should read data updated in the DFC thread. m.iArg[0] = &kernelRotation; break; case RDisplayChannel::ECtrlGetCompositionBufferInfo: //Both the client and DFC thread need to read data. umemget32(&kernelIndex, userConfigData0, sizeof(TInt) ); m.iArg[0] = &kernelIndex; m.iArg[1] = &kernelpack; break; #ifdef _DEBUG case RDisplayChannel::ECtrlCreateUserBuffer: m.iArg[0] = userConfigData0; m.iArg[1] = userConfigData1; break; #endif // _DEBUG default: return KErrNotSupported; } TInt r = DLogicalChannel::SendMsg(aMsg); if (r != KErrNone) { return r; } //Copy config data from local copies to client, in context of client thread switch (aReqNumber) { case RDisplayChannel::ECtrlPostCompositionBuffer: __DEBUG_PRINT2("ECtrlPostCompositionBuffer =%d", kernelPostCount ); umemput32(userConfigData1, &kernelPostCount, sizeof(RDisplayChannel::TPostCount) ); break; case RDisplayChannel::ECtrlPostLegacyBuffer: __DEBUG_PRINT2("ECtrlPostLegacyBuffer=%d", kernelPostCount ); umemput32(userConfigData1, &kernelPostCount, sizeof(RDisplayChannel::TPostCount) ); break; case RDisplayChannel::ECtrlRegisterUserBuffer: __DEBUG_PRINT2("ECtrlRegisterUserBuffer kernelBufferId=%d", kernelBufferId ); umemput32(userConfigData1, &kernelBufferId, sizeof(TInt) ); break; case RDisplayChannel::ECtrlSetRotation: __DEBUG_PRINT2("ECtrlSetRotation kernelRotChanged=%d", kernelRotChanged ); umemput32(userConfigData1, &kernelRotChanged, sizeof(TBool) ); break; case RDisplayChannel::ECtrlCurrentRotation: __DEBUG_PRINT2("ECtrlCurrentRotation kernelRotation=%d", kernelRotation ); umemput32(userConfigData0, &kernelRotation, sizeof(RDisplayChannel::TDisplayRotation) ); break; case RDisplayChannel::ECtrlGetCompositionBufferInfo: __DEBUG_PRINT3("ECtrlGetCompositionBufferInfo kernelpack[0] =%d and kernelpack[1] =%d", kernelpack[0], kernelpack[1]); umemput32(userConfigData1, &kernelpack, (sizeof(TInt)*2) ); break; } return r; }