void CTContentUpdateReceiver::DoSetInternalPriorityL()
	{
	RThread thread;
	User::LeaveIfError(thread.Open(iReceiverThreadId));
	thread.SetPriority(iInternalPriority);
	thread.Close();
	TInt compositionInterval = KCompositionInterval;
	CPeriodic::TPriority priority = CPeriodic::EPriorityStandard;
	if(iInternalPriority < EPriorityNormal)
		{
		priority = CPeriodic::EPriorityIdle;
		compositionInterval = KCompositionIntervalLong;
		}
	else if (iInternalPriority > EPriorityNormal)
		{
		priority = CPeriodic::EPriorityHigh;
		compositionInterval = KCompositionIntervalShort;
		}

	TCallBack callback(CallBack);
	callback.iPtr = this;
	iPeriodic->Cancel();
	delete iPeriodic;
	iPeriodic= CPeriodic::NewL(priority);
	iPeriodic->Start(TTimeIntervalMicroSeconds32(compositionInterval),TTimeIntervalMicroSeconds32(compositionInterval), callback);
	iSetInternalPriority = EFalse;
	iPriorityLock.Signal();
	}
// ---------------------------------------------------------------------------
// CDTMFPayloadFormatWrite::HandleControlChar
// Takes care of handling 'p' and 'w' chars in a DTMF string.
// ---------------------------------------------------------------------------
//
void CDTMFPayloadFormatWrite::HandleControlChar( const TChar& aChar )
    {
    if ( 'p' == aChar )
        {
        // 'p' char is interpreted as a 2.5 second pause
        DP_DTMF_WRITE( _L("CDTMFPayloadFormatWrite::HandleControlChar - PAUSE DETECTED") );
        iSendTimer->Cancel();
        iStateMachine->ChangeStateTo( EStateSendPaused );
        TCallBack callBack( HandleTimerEventL, this );
        iSendTimer->Start( 
            TTimeIntervalMicroSeconds32( KDTMFPauseLengthInUs ),
            TTimeIntervalMicroSeconds32( KDTMFPauseLengthInUs ), 
            callBack );
        }
    else if ( 'w' == aChar )
        {
        // Stop in a DTMF string
        DP_DTMF_WRITE( _L("CDTMFPayloadFormatWrite::HandleControlChar - STOP DETECTED ") );

        if ( iNotifyStopReq )
            {
            iSendTimer->Cancel();
            iStateMachine->ChangeStateTo( EStateSendStopped );

            SendEventSignalToClient( KMccDtmfStopInDtmfString );
            }
        }
    else
        {
        // not a control character
        }
    }
void CBatteryInfoObserver::ConstructL()
	{
    iPeriodic = CPeriodic::NewL( EPriorityNormal );
    // Start the timer with 2 minute interval
    iPeriodic->Start( TTimeIntervalMicroSeconds32(KHalfSecond),
        TTimeIntervalMicroSeconds32(KTwoMins),
        TCallBack(CBatteryInfoObserver::RunTimer,
        this ));
	}	
void CTContentUpdateReceiver::ConstructL()
	{
	TCallBack callback(CallBack);
	callback.iPtr = this;
	User::LeaveIfError(iLock.CreateLocal());
	User::LeaveIfError(iPriorityLock.CreateLocal(0));
    iPeriodic= CPeriodic::NewL(CPeriodic::EPriorityStandard);
    iPeriodic->Start(TTimeIntervalMicroSeconds32(0),TTimeIntervalMicroSeconds32(KCompositionInterval), callback);
	}
// ---------------------------------------------------------------------------
// CDTMFPayloadFormatWrite::DoToneOffActionsL
// Called by sendtimer. Does actions belonging to tone off state and exits
// state when exit conditions are met. Actions include: sending final packets.
// ---------------------------------------------------------------------------
//
void CDTMFPayloadFormatWrite::DoToneOffActionsL( TBool aEntryToState )
    {
    DP_DTMF_WRITE2( _L("CDTMFPayloadFormatWrite::DoToneOffActionsL, tick = %u"), 
        User::NTickCount() );

    #ifdef VOIP_TRACE_ENABLED
        VoipTrace( "%x %x", MCC_TRACE, MCC_DTMF_PLF_WRITE_SENDFINALPKT );
    #endif
    
    if ( aEntryToState )
        {
        iSendTimer->Cancel();
        iFinalPacketCtr = 0;
        
        TCallBack callBack( HandleTimerEventL, this );
        iSendTimer->Start(
            TTimeIntervalMicroSeconds32( iCInfo.iPtime * KFactor1000 ),
            TTimeIntervalMicroSeconds32( iCInfo.iPtime * KFactor1000 ),
            callBack );
        }
    else
        {
        iFinalPacketCtr++;
        if ( KNumOfFinalPackets >= iFinalPacketCtr )
            {
            DeliverPacketL( *iSinkBuffer, EFalse );
            }
        else
            {
            TUint curOffDur = iFinalPacketCtr * iCInfo.iPtime * KFactor1000;
            if ( EModeManual == iSendingMode || 
                 KDTMFDefToneOffLengthInUs <= curOffDur )
                {
                // Prevent audio sending during final packet retransmission by
                // sending completion event only when also retransmissions are
                // done.
                if ( EModeManual == iSendingMode )
                    {
                    SendEventSignalToClient( KMccDtmfManualStop );
                    }
                else
                    {
                    SendEventSignalToClient( KMccDtmfSequenceStop );
                    }
                
                iSendTimer->Cancel();
                iFinalPacketCtr = 0;
                if ( iSendBuffer.Count() > 0 )
                	{
                	iSendBuffer.Remove( 0 );	
                	}
                iStateMachine->ChangeStateTo( EStateEncodeNextDigit );
                }
            }
        }
    }
Example #6
0
void CRKWindow::SetKeyboardRepeatRate(const TTimeIntervalMicroSeconds32 &aInitialTime, const TTimeIntervalMicroSeconds32 &aTime)
	{
	iInitialRepeatSet=aInitialTime;
	iRepeatSet=aTime;
	iMinGap=TTimeIntervalMicroSeconds32(100000000);	// Any very big number will do
	iMaxGap=TTimeIntervalMicroSeconds32(0);
	iTotalGap=TTimeIntervalMicroSeconds32(0);
	SetState(EStateWaitingForKeyDown);
	Client()->iWs.Flush();
	}
void CAnimationDlg::PostLayoutDynInitL()
	{
	CAnimateFramesCtl* animationCtl = static_cast<CAnimateFramesCtl*>(Control(EBmpAnimationCtlId));
	animationCtl->StartAnimationL();


	TCallBack cb(Execute,this);
	iTimer = CPeriodic::NewL(EPriorityLow);
	iTimer->Start(TTimeIntervalMicroSeconds32(7000000), TTimeIntervalMicroSeconds32(1), cb);
		
	}
Example #8
0
/**
This text case will verify that vertical text drawing of XCoeTextDrawer class is correct and 
consistent with horizontal drawing of the same alignment. Clip area will also be set to check that 
drawing will not happen outside this area. The text will consist of a few lines.

defect INC122592  
Visual verification is required.
*/
TBool CCone7TestAppUi::TestTextDrawer_5L()
	{
	CCtlTestTextDrawer* testTextDrawer = new(ELeave) CCtlTestTextDrawer();
	CleanupStack::PushL(testTextDrawer);
	testTextDrawer->ConstructL();
	testTextDrawer->SetExtent(TPoint(20,20),TSize(600,200));
	testTextDrawer->ActivateL();
	testTextDrawer->DrawNow();
	
	const TInt noOfLines = TCoeTextTypeAdaptor(KMultipleLineText1).NumberOfLines();

	TOpenFontFaceAttrib openFontFaceAttrib;
	((CFbsFont&)(testTextDrawer->FontUsed())).GetFaceAttrib(openFontFaceAttrib);
	TBuf<25> buf(openFontFaceAttrib.FullName());
	INFO_PRINTF2(_L("CCtlTestTextDrawer : Typeface being used is %S"), &buf);
	
	//testing with clip area
	TRect clipRect = testTextDrawer->Rect();
	clipRect.Shrink(40, 40);
	TRgb nonClippedText = KRgbRed;
	
	//drawing vertical text, up direction
	for(TInt testIndex = 0; testIndex <= 8; testIndex++)
		{
		testTextDrawer->TestTextDrawer(testIndex, ETrue, NULL, &nonClippedText);
		testTextDrawer->TestTextDrawer(testIndex, ETrue, &clipRect, NULL, EFalse);
		User::After( TTimeIntervalMicroSeconds32(1000000) );

		testTextDrawer->TestTextDrawer(testIndex, EFalse, NULL, &nonClippedText);
		testTextDrawer->TestTextDrawer(testIndex, EFalse, &clipRect, NULL, EFalse);
		User::After( TTimeIntervalMicroSeconds32(1000000) );
		}

	//drawing vertical text, up direction
	for(TInt testIndex = 0; testIndex <= 8; testIndex++)
		{
		testTextDrawer->TestTextDrawer(testIndex, ETrue, NULL, &nonClippedText);
		testTextDrawer->TestTextDrawer(testIndex, ETrue, &clipRect, NULL, EFalse);
		User::After( TTimeIntervalMicroSeconds32(1000000) );

		testTextDrawer->TestTextDrawer(testIndex, EFalse, NULL,     &nonClippedText, ETrue, EFalse);
		testTextDrawer->TestTextDrawer(testIndex, EFalse, &clipRect, NULL,         EFalse, EFalse);
		User::After( TTimeIntervalMicroSeconds32(1000000) );
		}
	
	CleanupStack::PopAndDestroy(testTextDrawer);		
	return ETrue;
	}
/**
 *
 * Do the test step.
 * Each test step must supply an implementation for DoTestStepL.
 *
 * @return	"TVerdict"
 *			The result of the test step
 *
 * @xxxx
 * 
 */
TVerdict CTestStepToneSetDTMFLengths::DoTestStepL()
	{
	iTestStepResult = EPass;
	TInt err = KErrNone;

	_LIT(KDTMFStr1, "AB,C, "); 
	//_LIT(KDTMFStr2, "125774 6788* #A *d GHET"); //HIJKLMNOPQRSTUVWXYZ");
	//_LIT(KDTMFStrInvalid, "123   <>?$%&$%^&");

	// test1 //
	for (TInt dur = 1; dur<3000000; dur*=2)
		{
		// create the Tone utility
		TRAP( err, (iTone = CMMFMdaAudioToneUtility::NewL(*this)) );
		if ( err != KErrNone )
			return EInconclusive;

		iTone->SetDTMFLengths( TTimeIntervalMicroSeconds32(dur), 
							   TTimeIntervalMicroSeconds32(dur),
							   TTimeIntervalMicroSeconds32(dur) );
		//if (iTone->State() != EMdaAudioToneUtilityPrepared)
		//	{
		//	return EFail;
		//	}
		TRAP(err, iTone->PrepareToPlayDTMFString( KDTMFStr1 ) );
		CActiveScheduler::Start();
		if (err != KErrNone ||
			iError != KErrNone ||
			iTone->State() != EMdaAudioToneUtilityPrepared	)
			return EInconclusive;

		// play just for confirmation
		//iTone->Play();
		//CActiveScheduler::Start();
		//User::After(2000000); //6*dur);
		//if (iError != KErrNone)
		//	iTestStepResult = EInconclusive;
		delete iTone;
		iTone = NULL;
		}

	//iTestStepResult = EFail;
	//INFO_PRINTF1(_L("!*****FAILED ON PURPOSE, problem with corrupt CMdaAudioToneUtility object after playing"));

	INFO_PRINTF1(_L("finished with this test step"));
	// test steps return a result
	return iTestStepResult;
	}
// --------------------------------------------------------------------------
// CUPnPBrowseTimer::Start
// Starts the periodizer.
// --------------------------------------------------------------------------
//
void CUPnPBrowseTimer::Start()
    {
    if ( !IsActive() )
        {
        After( TTimeIntervalMicroSeconds32( iTimerWavelength ) );
        }
    }
Example #11
0
/**
@SYMTestCaseID		GRAPHICS-WSERV-GCE-0700

@SYMDEF  			DEF123129

@SYMTestCaseDesc    Test activating a sprite twice does not cause the system to hang

@SYMTestPriority    High

@SYMTestStatus      Implemented

@SYMTestActions     Construct a sprite and add a member to it. Activate twice.

@SYMTestExpectedResults The test should terminate smoothly and it should not hang the system.
*/
void CTTSprite::DoubleActivateL()
	{
	RWsSession ws;
	User::LeaveIfError(ws.Connect());
	CleanupClosePushL(ws);
	
	RWindowGroup group(ws);
	User::LeaveIfError(group.Construct(890, EFalse));
	CleanupClosePushL(group);
	
	RWsSprite sprite = RWsSprite(ws);
	User::LeaveIfError(sprite.Construct(group,TPoint(),0));
	CleanupClosePushL(sprite);
	CFbsBitmap* bitmap=new(ELeave) CFbsBitmap;
	CleanupStack::PushL(bitmap);
	User::LeaveIfError(bitmap->Create(TSize(10,12),EColor256));
	TSpriteMember member;
	member.iMaskBitmap=NULL;
	member.iInvertMask=EFalse;
	member.iDrawMode=CGraphicsContext::EDrawModePEN;
	member.iOffset=TPoint();
	member.iInterval=TTimeIntervalMicroSeconds32(0);
	member.iBitmap=bitmap;
	User::LeaveIfError(sprite.AppendMember(member));
	User::LeaveIfError(sprite.Activate());
	User::LeaveIfError(sprite.Activate());
	
	sprite.Close();
	CleanupStack::PopAndDestroy(4, &ws);
	
	group.Close();
	ws.Close();
	}
Example #12
0
void CTTSprite::ResizeMemberL()
	{
#ifndef __WINS__
	CTBlankWindow* win=new(ELeave) CTBlankWindow();
	CleanupStack::PushL(win);
	win->ConstructL(*TheClient->iGroup);
	win->SetExt(TPoint(),TSize(640,240));
	RWindowBase& window=*win->BaseWin();
	window.Activate();
	RWsSprite sprite(TheClient->iWs);
	CleanupClosePushL(sprite);
	User::LeaveIfError(sprite.Construct(window,TPoint(),0));
	TSpriteMember member;
	member.iMaskBitmap=NULL;
	member.iInvertMask=EFalse;
	member.iDrawMode=CGraphicsContext::EDrawModePEN;
	member.iOffset=TPoint();
	member.iInterval=TTimeIntervalMicroSeconds32(250000);
	member.iBitmap=&iBitmap;
	User::LeaveIfError(sprite.AppendMember(member));
	User::LeaveIfError(sprite.AppendMember(member));
	User::LeaveIfError(sprite.Activate());
	User::After(1000000); // // Interval is 1 sec.
	User::LeaveIfError(iBitmap.Resize(iBitmap.SizeInPixels() + TSize(100,100)));
	User::After(1000000);  // Interval is 1 sec.
	CleanupStack::PopAndDestroy(&sprite);
	CleanupStack::PopAndDestroy(win);
#endif // __WINS__
	}
Example #13
0
/**
 * @return - TVerdict code
 * Override of base class virtual
 */
TVerdict CEtel1Step::doTestStepPreambleL()
	{
	LBSLOG(ELogP1,"CEtel1Step::doTestStepPreambleL - Start");
	
	RLbsSystemController lbsSysController;
	lbsSysController.OpenL(KLbsSuplTestUid);
	//Start the LBS sub-system if it is not running
	if(lbsSysController.RequestSystemStartup()!= ELbsStartupSuccess)
		{
		lbsSysController.Close();
		User::Leave(KErrNotReady); 
		}
	
	//We do not need Lbs to be running - not to interfere with our tests
	User::LeaveIfError(lbsSysController.RequestCompleteCloseDown());	
	
	lbsSysController.Close();
	
	// Call base class method for pre test actions	
	CTe_suplprotocolSuiteStepBase::doTestStepPreambleL();
	 
	TLbsNetProtocolModuleParams param(*iGatewayObserver);
	iModule = CSuplGatewayInterface::NewL(reinterpret_cast<TAny*>(&param));	
	
	iSchedulerWait = new(ELeave) CActiveSchedulerWait;
	iTimer = CLbsCallbackTimer::NewL(*this);
	
	//Start active scheduler for a while to complete the async initialization calls
	iTimer->EventAfter(TTimeIntervalMicroSeconds32(KInitializationTimeout), 0);
	iSchedulerWait->Start();
	 
	LBSLOG(ELogP1,"CEtel1Step::doTestStepPreambleL - End");
	return TestStepResult();
	}
void CTReadWrite::ReadWriteImageL()
    {
    ReadImageFuncL();

    TBool ret = EFalse; 
    for(TInt i=0; i<iBufferSize; i++)
        {
        if(iData[i] == iInitialColour)
            {
            iData[i] = iFinalColour;
            WriteImageFuncL();

            //Re-issue the request
            After(TTimeIntervalMicroSeconds32(0));
            
            ret = ETrue;
            break;
            }
        else if(iData[i] != iFinalColour)
            {
            CActiveScheduler::Stop();
            iTestPass = EFalse;
            
            ret = ETrue;
            break;
            }
        }

    //If no pixels have been modified, check to see if the test should finish
    if( (IsFinished() != EFalse) && (ret == EFalse) )
        {
        //Stop the active scheduler and process with test termination
        CActiveScheduler::Stop();
        }
    }
// ---------------------------------------------------------------------------
// TEST CASE: Start timer with After (32 bit) without connecting first
// ---------------------------------------------------------------------------
//
TInt CTestRFlexTimer::After32WithoutConnect(
    TTestResult& aResult, 
    CTestFlexTimer* aCallback )
    {
    TRequestStatus status;

    // Test should panic with
    // Category: "KERN-EXEC"
    // Reason:   0
    aCallback->TestModuleIf().SetExitReason( 
        CTestModuleIf::EPanic,
        0 );
    
    // Do the actual test
    //-----------------------------------------------------

    RFlexTimer timer;
    timer.After( status, TTimeIntervalMicroSeconds32( 1000000 ) );
    User::WaitForRequest( status ); // PANIC
    timer.Close();
    
    //-----------------------------------------------------

    // No panic, change result back to normal
    aCallback->TestModuleIf().SetExitReason( 
        CTestModuleIf::ENormal,
        KErrNone );

    aResult.SetResult( KErrGeneral, _L("Test case failed. No panic.") );

    return KErrNone;
    }
void CTReadWrite::ReadL()
    {
    ReadFuncL();

    if(iFrameNumber != KNumberOfFrames)
         {
         iFrameNumber++;

         for(TInt i=0; i<iBufferSize; i++)
             {
             if(iData[i] != iInitialColour)
                 {
                 RDebug::Print(_L("Unexpected pixel colour %x"), iData[i]);
                 CActiveScheduler::Stop();
                 iTestPass = EFalse;
                 return;
                 }
             }
         //Re-issue the request
         After(TTimeIntervalMicroSeconds32(0));
         }
     else
         {
         //Stop the active scheduler and process with test termination
         CActiveScheduler::Stop();
         }
    }
// ---------------------------------------------------------
// CT_LbsTestTimerPsy::StopTracking
// 
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CT_LbsTestTimerPsy::StopTracking()
	{
	iInterval = TTimeIntervalMicroSeconds32(KMinimumUpdateInterval);
    iTrackingEnabled = EFalse;
    iFirst = ETrue;
    iPeriodicTimer->Cancel();
	}
	EXPORT_C void KillApplicationL(RWsSession& aWs, TUid aUid, TInt aRetryInterval )
	{
		TTime wait_until; wait_until.HomeTime();
		wait_until+=TTimeIntervalSeconds(15);
	
		TApaTaskList taskList( aWs );

		for(;;) {
			TApaTask task = taskList.FindApp(aUid);
			if(! task.Exists()) {
				break;
			}
			TTime now; now.HomeTime();
			if (now < wait_until) {
				task.EndTask();
				//DebugMsg(_L("waiting..."), aDebugLog);
				User::After(TTimeIntervalMicroSeconds32(aRetryInterval*1000) );
			} else {
				break;
			}
		}
		TApaTask task = taskList.FindApp(aUid);
		if( task.Exists()) {
#ifdef __S60V3__
			task.KillTask();
#else
			RThread t;
			if (t.Open(task.ThreadId())==KErrNone) {
				//DebugMsg(_L("killing"), aDebugLog);
				t.Kill(2003);
				t.Close();
			}
#endif
		}
	}
// EPOC default constructor can leave.
void CT_LbsTestTimerPsy::ConstructL(TAny* aConstructionParameters)
	{
	BaseConstructL(aConstructionParameters);
	iPositioner = PositionerStatus();
	iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityStandard);
	iInterval = TTimeIntervalMicroSeconds32(0);
    }
void CPackagerAppUi::RunTestStepL(TInt aNumStep)
{
    TKeyEvent theKeyEvent;
    Mem::FillZ(&theKeyEvent, sizeof(TKeyEvent));
    TBuf<128> buf;

    //only for debug
#ifdef FORCE_AUTO
    User::After(TTimeIntervalMicroSeconds32(1000000));
#endif
    switch(aNumStep)
    {
    case 1:
    {
        RDebug::Print(_L("\nGet the language"));
        buf.Copy(_L("\nGet the language"));
        SetFromString(buf, ((TText8*)__FILE__), __LINE__);
        TLanguage appLang = ApplicationLanguageL();
        buf.Copy(_L("\nLanguage is "));
        buf.AppendNum(appLang);
        SetFromString(buf, ((TText8*)__FILE__), __LINE__);
        if(appLang != ELangFrench)
        {
            buf.Format(_L("\nLanguage is %d but should be enum for ELangFrench"), appLang);
            SetErrorFromString(buf, ((TText8*)__FILE__), __LINE__, 1);
            AutoTestManager().FinishAllTestCases(CAutoTestManager::EFailed);
        }
        else
        {
            AutoTestManager().FinishAllTestCases(CAutoTestManager::EPass);
        }
        break;
    }
    }
}
TTimeIntervalMicroSeconds32 SecsToUsecs(TInt secs)
{
  TInt64 us64 = TInt64(secs) * 1000000LL;
  // max time is around 35 minutes only
  TInt us = ((us64 > 2147483647LL) ? 2147483647 : (int)us64);
  return TTimeIntervalMicroSeconds32(us);
}
EXPORT_C TInt CComponentBase::CheckedRunError(TInt aError)
{
	if (aError==KErrDiskFull || aError==KErrNoMemory) return KErrDiskFull;
	
	TUid uid; TInt id; TInt version;
	ComponentId(uid, id, version);
	iErrorCount++;
	CC_TRAPD(err, StopL());
	if (err!=KErrNone || iErrorCount>MaxErrorCount()) {
		ComponentRecovery().ReportError(uid, id, ComponentErrorInfoMgr().GetLastErrorInfo(MakeErrorCode(uid.iUid, aError)));
		iActiveState=MRecovery::EFailed;
		ReportState();
		ComponentAppContext().SetCurrentComponent(TUid::Uid(0), 0);
		return KErrNone;
	}
	
	iActiveState=MRecovery::ERestarting;
	iStatus=KRequestPending;
	Cancel();
	SetActive();
	iTimer.After(iStatus, TTimeIntervalMicroSeconds32( iWaitTime*1000 ) );
	iWaitTime *= 1.5;
	ReportState();
	
	ComponentAppContext().SetCurrentComponent(TUid::Uid(0), 0);
	return KErrNone;
}
// ---------------------------------------------------------------------------
// TEST CASE: Configure (32 bit) timer without connecting first
// ---------------------------------------------------------------------------
//
TInt CTestRFlexTimer::Configure32WithoutConnect(
    TTestResult& aResult, 
    CTestFlexTimer* aCallback )
    {
    // Test should panic with
    // Category: "KERN-EXEC"
    // Reason:   0
    aCallback->TestModuleIf().SetExitReason( 
        CTestModuleIf::EPanic,
        0 );
    
    // Do the actual test
    //-----------------------------------------------------

    RFlexTimer timer;

    timer.Configure( TTimeIntervalMicroSeconds32( 1000000 ) ); // PANIC
    // Configure is synchronous command. No need to wait.
    timer.Close();

    //-----------------------------------------------------

    // No panic, change result back to normal
    aCallback->TestModuleIf().SetExitReason( 
        CTestModuleIf::ENormal,
        KErrNone );

    aResult.SetResult( KErrGeneral, _L("Test case failed. No panic.") );
    
    return KErrNone;
    }
Example #24
0
// -----------------------------------------------------------------------------
// CFMSServer::LogAsyncCallMonitorL() 
// Async request to monitor active phone call end
// -----------------------------------------------------------------------------
void CFMSServer::LogAsyncCallMonitorL()
    {
    if(iLogAsyncRequest)
        {
        FLOG(_L("CFMSServer::LogAsyncCallMonitorL():- cancel)"));
        iLogAsyncRequest->Cancel();
        delete iLogAsyncRequest;
        iLogAsyncRequest = NULL;
        }
    iLogAsyncRequest = CPeriodic::NewL (EPriorityNormal) ;
    FLOG(_L("CFMSServer::LogAsyncCallMonitorL(): created)"));
    iLogAsyncRequest->Start(
            TTimeIntervalMicroSeconds32(KRequestTriggerWaitTime*1)
            , TTimeIntervalMicroSeconds32(KRequestTriggerWaitTime*4)
            , TCallBack(LogCallEndMonitorRequestL,this) ) ;
    FLOG(_L("CFMSServer::LogAsyncCallMonitorL():-Request logged)"));
    }
Example #25
0
/** Perform CX3pStep7 test step.
This test verifies that the Test Protocol Module correctly handles 
an X3P with timeout after registering for X3P.

@return TVerdict test result code
*/
TVerdict CX3pStep7::doTestStepL()
	{
	INFO_PRINTF1(_L("\t********************************************************************"));
	INFO_PRINTF1(_L("\tX3P timeout after registering request"));
	INFO_PRINTF1(_L("\t********************************************************************"));
	INFO_PRINTF1(_L("- START -"));

	// Initiate X3P
	INFO_PRINTF1(_L("\tLBS -> TransmitLocation"));
	TLbsNetSessionId sessionId(TUid::Uid(KDummyUid), KX3pSessionId);
	iModule->RequestTransmitLocation(sessionId, KX3pDestination(), KX3pPriority);

	// Check network receives X3P request
	if (EFail == CheckNetworkCallbackL(
				CNetworkObserver::ERegisterLcsMoLr) ||
		KX3pDestination() != iNetworkObserver->X3pDestination())
		{
		SetTestStepResult(EFail);
		return TestStepResult();
		}
	INFO_PRINTF1(_L("\t                                            RegisterLcsMoLr -> NET"));
	
	// Delay activity by 25 secs
	INFO_PRINTF1(_L("*** DELAY 25 SECONDS ***"));
	User::After(TTimeIntervalMicroSeconds32(25000000));

	// Check network session completed with timeout
	if (EFail == CheckNetworkCallbackL(
				CNetworkObserver::EReleaseLcsMoLr) ||
		KErrTimedOut != iNetworkObserver->SessionCloseReason())
		{
		SetTestStepResult(EFail);
		return TestStepResult();
		}
	INFO_PRINTF1(_L("\t                                   ReleaseLcsMoLr (TIMEOUT) -> NET"));

	// Check gateway session completed
	if (EFail == CheckGatewayCallbackL(CGatewayObserver::EProcessSessionComplete) ||
		sessionId != iGatewayObserver->SessionIdValue() ||
		KErrTimedOut != iGatewayObserver->SessionCloseReason())
		{
		SetTestStepResult(EFail);
		return TestStepResult();
		}
	INFO_PRINTF1(_L("\tLBS <- ProcessSessionComplete (TIMEOUT)"));

	// Check if more observer activity takes place
	if (iGatewayObserver->IsMoreObserverActivity() ||
		iNetworkObserver->IsMoreObserverActivity())
		{
		SetTestStepResult(EFail);
		return TestStepResult();
		}

	INFO_PRINTF1(_L("- END -"));
	SetTestStepResult(EPass);
	return TestStepResult();
	}
/**
Cancel OpenDevice
*/
TVerdict CTestStep_MMF_A2DPBLUETOOTH_U_0202::DoTestStepL( void )
	{
	TVerdict verdict = EPass;
	TRequestStatus* status = &(iAsyncTestStepNotifier->RequestStatus());
	iA2dpBTHeadsetAudioInterface->CancelOpenDevice();
	iA2dpBTHeadsetAudioInterface->Initialize(*iBTheadsetAddress, *status);
	iAsyncTestStepNotifier->HandleAsyncRequest();
	if (iError != KErrNone)
		{
		INFO_PRINTF2(_L("Initialization error %d" ), iError);
		verdict = EInconclusive;
		}
	else
		{	
		if (verdict == EPass)
			{
			iA2dpBTHeadsetAudioInterface->OpenDevice(*status);
			//need to choose a time long enough for the device open sequence to start
			//but not long enough for the open sequence to complete
			iTimer->StopAfter(TTimeIntervalMicroSeconds32(10000));//try 10mS
			CActiveScheduler::Current()->Start();
			if (*status != KRequestPending)
				{
				INFO_PRINTF1(_L("request status no longer pending-Open probably completed" ));
				verdict = EInconclusive;//can't really say it failed-might have been a fast init
				}
			}
		if (verdict == EPass)
			{
			iA2dpBTHeadsetAudioInterface->CancelOpenDevice();
			iAsyncTestStepNotifier->HandleAsyncRequest();
			if (*status != KErrCancel)
				{
				INFO_PRINTF1(_L("request status not still be pending" ));
				verdict = EFail;
				}
			
			else if (iError != KErrCancel)
				{
				INFO_PRINTF2(_L("expected KErrCancel got error %d" ), iError);
				verdict = EFail;
				}
			}
		if (verdict == EPass)
			{
			//check we really are cancelled 
			//should be able to set the sample rate if we are
			iError = iA2dpBTHeadsetAudioInterface->SetSampleRate(KDefaultTestSampleRate);
			if (iError != KErrNone)
				{
				INFO_PRINTF2(_L("failed to set sample rate - OpenDevice might not really be cancelled %d" ), iError);
				verdict = EFail;
				}
			}
		}
	
	return verdict;
	}
Example #27
0
void CTTSprite::SetUpMember(TSpriteMember &aMember)
	{
	aMember.iMaskBitmap=NULL;
	aMember.iInvertMask=EFalse;
	aMember.iDrawMode=CGraphicsContext::EDrawModePEN;
	aMember.iOffset=TPoint();
	aMember.iInterval=TTimeIntervalMicroSeconds32(0);
	aMember.iBitmap=&iBitmap;
	}
void CTReadWriteChild::ReadFuncL()
    {
    vgDrawImage(iImage);
    vgReadPixels(iData, iWidth*iByteSize, iFormat, 0, 0, iWidth, iHeight);
    VgLeaveIfErrorL();

    //Small delay to aid pixel access sharing between processes
    User::After(TTimeIntervalMicroSeconds32(1000));
    }
/** Check if more observer activity takes place
*/
TBool CSuplNetworkTestObserver::IsMoreObserverActivity()
	{
	TBool ret;
	ResetWasObserverCalled();
	iTimer->EventAfter(TTimeIntervalMicroSeconds32(KNetworkTimerDurationInMicroSec), KNetworkTimerId);
	WaitForCallBack();
	ret = ETimeout == CallBackResult()? EFalse : ETrue;
	ResetWasObserverCalled();
	return ret;
	}
Example #30
0
/**
   Auxiliary function for all Test Cases
  
   The method is an override from CTestAppUi. The method initiates all tests
   to be performed.
   
 */
void CTestAutoAddLibraryAppUi::RunTestStepL(TInt aNumStep)
	{
	
	User::After(TTimeIntervalMicroSeconds32(1000000));
		switch(aNumStep)
			{
			case 1:
			AutoTestManager().FinishAllTestCases(CAutoTestManager::EPass);
			break;
			}
	}