コード例 #1
0
void UT_CMccRtpDataSource::UT_CMccRtpDataSource_TestBaseClassL()
    {
    // Test some base class functions which are hard to test by other means
    
    // Internal event to all clients (no users)
    iSource->SendInternalRtpEventToAllClients( 
        iSource->iUsers, KMccRtpSourceUid, EMccInternalEventNone, KMccStreamError, 0, KErrGeneral );
    
    // Users exist
    InitializeL();
    
    iSource->SendInternalRtpEventToAllClients( 
        iSource->iUsers, KMccRtpSourceUid, EMccInternalEventNone, KMccStreamError, 0, KErrGeneral );
    EUNIT_ASSERT_EQUALS( iEventHandler->iLastEvent.iEventType, KMccStreamError );
    
    // Secure events
    iSource->SendSecureRtpEventToClient( 
        NULL, KMccRtpSourceUid, EMccInternalEventNone, KMccStreamPaused, 0 );
    iSource->SendSecureRtpEventToClient( 
        iEventHandler, KMccRtpSourceUid, EMccInternalEventNone, KMccStreamPaused, 0 );
    EUNIT_ASSERT_EQUALS( iEventHandler->iLastEvent.iEventType, KMccStreamPaused );
    
    // SendJitterEventToClient()
    iSource->SendJitterEventToClient( iEventHandler, KMccRtpSourceUid, 
    	EMccInternalEventNone, KMccEventNone, 0, 0, 1,2,3,4,5,6 );
    EUNIT_ASSERT_EQUALS( iEventHandler->iLastEvent.iEventType, KMccEventNone );
    const TMccRtpEventDataExtended& rtpEvent = 
    	(*reinterpret_cast<const TMccRtpEventDataExtendedPackage*>( &iEventHandler->iLastEvent.iEventData ))();
    EUNIT_ASSERT_EQUALS( rtpEvent.iJitterEstimate, 1 );
    EUNIT_ASSERT_EQUALS( rtpEvent.iPacketsReceived, 2 );
    EUNIT_ASSERT_EQUALS( rtpEvent.iPrevTransTime, 3 );
    EUNIT_ASSERT_EQUALS( rtpEvent.iTriggeredJitterLevel, 4 );
    EUNIT_ASSERT_EQUALS( rtpEvent.iPacketLoss, 5 );
    EUNIT_ASSERT_EQUALS( rtpEvent.iTriggeredPacketLoss, 6 );
    }
コード例 #2
0
void UT_CMccRtpDataSource::UT_CMccRtpDataSource_SourcePlayLL()
    {
    // Not logged on
    EUNIT_ASSERT_SPECIFIC_LEAVE( iSource->SourcePlayL(), KErrNotFound );
    
    // Not allowed if not yet prepared
    InitializeL();
    EUNIT_ASSERT_SPECIFIC_LEAVE( iSource->SourcePlayL(), KErrNotReady );
    
    // Ok when already prepared
    iSource->iState = MMccRtpInterface::ERtpStatePrimed;
    
    EUNIT_ASSERT_NO_LEAVE( iSource->SourcePlayL() );
    EUNIT_ASSERT_EQUALS( iEventHandler->iLastEvent.iEventType, KMccStreamStarted );
    
    // Resuming
    iSource->iState = MMccRtpInterface::ERtpStatePaused; 
    EUNIT_ASSERT_NO_LEAVE( iSource->SourcePlayL() );
    EUNIT_ASSERT_EQUALS( iEventHandler->iLastEvent.iEventType, KMccStreamResumed );
    EUNIT_ASSERT( iRtpKeepaliveMechanism->iStopped == EFalse )
    
    // State downgrade is ignored
    EUNIT_ASSERT_NO_LEAVE( iSource->SourcePrimeL() );
    EUNIT_ASSERT( MMccRtpInterface::ERtpStatePlaying == iSource->State() );
    
    // "Secure session"
    iRtpKeepaliveMechanism->iStopped = ETrue;
    TInt fakeSecSession( 3 );
    iSource->iSecSession = reinterpret_cast<CSRTPSession*>( &fakeSecSession );
    EUNIT_ASSERT_NO_LEAVE( iSource->SourcePlayL() );
    EUNIT_ASSERT( iRtpKeepaliveMechanism->iStopped == ETrue )
    iSource->iSecSession = NULL;
    }
コード例 #3
0
void UT_CMccRtpDataSource::UT_CMccRtpDataSource_SendMediaSignallingLL()
    {
    iSource->iEnableRtcp = ETrue;
    TMccEvent foo;
    UT_CMccRtpInterface::CreateRtcpEvent( foo );
    
    EUNIT_ASSERT_LEAVE( iSource->SendMediaSignallingL( foo ) );
    
    // No RtpApi
    foo.iEventCategory = KMccEventCategoryRtcp;
    foo.iEventType = KMccRtcpControl;
    TMccRtcpEventData eventData;
    eventData.iRtcpPacketType = KRtcpRrPacket;
    TMccRtcpEventDataPackage eventDataPkg( eventData );
    foo.iEventData.Copy( eventDataPkg );
    EUNIT_ASSERT_SPECIFIC_LEAVE( iSource->SendMediaSignallingL( foo ), KErrNotReady );
    
    // Rr, stream does not exist
    InitializeL( EFalse, ETrue );
    EUNIT_ASSERT_SPECIFIC_LEAVE( iSource->SendMediaSignallingL( foo ), KErrNotReady );
    
    // Stream exists
    CreateStreamL();
    EUNIT_ASSERT_NO_LEAVE( iSource->SendMediaSignallingL( foo ) );
    
    // Sr
    eventData.iRtcpPacketType = KRtcpSrPacket;
    eventDataPkg = eventData;
    foo.iEventData.Copy( eventDataPkg );
    EUNIT_ASSERT_SPECIFIC_LEAVE( iSource->SendMediaSignallingL( foo ), KErrArgument );
    }
コード例 #4
0
// ==========================================================================
// FUNCTION: ConstructL
// ==========================================================================
void CContainerStoreSearchHandler::ConstructL( RPointerArray<HBufC>&     aSearchStrings,
                                               TMsgStoreSearchCmdParams& aCmdParam,
                                               RArray<TContainerId>&     aFolderIds,
                                               RPointerArray<HBufC8>&    aPropertyNames )
    {
    __LOG_ENTER( "ConstructL" )
    
    CreateSearchPatternL( aSearchStrings, iSearchStrings );
    
    TInt maxSSLength = 0;
    for ( TInt i = 0 ; i < aSearchStrings.Count() ; i++ )
        {
        if ( aSearchStrings[i]->Length() > maxSSLength )
            {
            maxSSLength = aSearchStrings[i]->Length();
            }
        }
    
    iSearchBuffer.CreateL( KSearchBufferSize + maxSSLength * 2 );
    
    InitializeL( aCmdParam, aFolderIds, aPropertyNames );
    
    iSearchResultTable.DeleteAllL();
    
    __LOG_EXIT
    } // end ConstructL
コード例 #5
0
ファイル: asf.cpp プロジェクト: kuailexs/symbiandump-mw1
// -----------------------------------------------------------------------------
// CAsf::ConstructL
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CAsf::ConstructL( const RFile& aFile )
    {
    LOGFN( "CAsf::ConstructL (2)" );
    iFile.Duplicate( aFile );
    iFile.Size( iLength );
    InitializeL();
    }
コード例 #6
0
TVerdict CRandomBlobStep::doTestStepL()
	{
	__UHEAP_MARK;
	InitializeL();
	_LIT(KDoStepPrint,"CRandomBlobStep::doTestStepL()");
	INFO_PRINTF1(KDoStepPrint);  //Block start 
	
	const TDesC &run = ConfigSection();
	
	if( run == KRun1 )
		{
		INFO_PRINTF1(KTest1);
		BlobTestL();
		}
	else if( run == KRun2 )
		{
		INFO_PRINTF1(KTest2);
		MaxBlobTestL();
		}
	else
		{
		MissingTestPanic();
		}
	Cleanup();
	__UHEAP_MARKEND;

	return TestStepResult();
	}
コード例 #7
0
// ---------------------------------------------------------------------------
// CSsmLangSelCmd::Initialize
// ---------------------------------------------------------------------------
//
 TInt CSsmLangSelCmd::Initialize( CSsmCustomCommandEnv* aCmdEnv )
     {
     FUNC_LOG;

     iEnv = aCmdEnv;
     TRAPD( errorCode, InitializeL() );
     return errorCode;
     }
コード例 #8
0
// ==========================================================================
// FUNCTION: RestartL
// ==========================================================================
void CContainerStoreSearchHandler::RestartL( TMsgStoreSearchCmdParams& aCmdParam, 
                                             RArray<TContainerId>&     aFolderIds, 
                                             RPointerArray<HBufC8>&    aPropertyNames )
    {
    InitializeL( aCmdParam, aFolderIds, aPropertyNames );
    iIsNewSearch = EFalse;
    StartL();
    }
コード例 #9
0
EXPORT_C void CUnifiedCertStore::Initialize(TRequestStatus& aStatus)
	{
	BeginAsyncOp(aStatus, EInitializeGetTokenList);
	TRAPD(err, InitializeL());
	if (err != KErrNone)
		{
		Complete(err);
		}
	}
コード例 #10
0
TInt CMdSServer::ResetDBL()
	{
	DeInitializeL();

	CMdSMaintenanceEngine::DeleteDatabase();
	CMdSMaintenanceEngine::InitConnectionL();
	
    InitializeL();
	return KErrNone;
	}
コード例 #11
0
ファイル: TlsTest.cpp プロジェクト: cdaffara/symbiandump-os2
GLDEF_C TInt E32Main() // main function called by E32
    {
	__UHEAP_MARK;
	CTrapCleanup* cleanup=CTrapCleanup::New(); 
	TRAPD(error,InitializeL()); 
	__ASSERT_ALWAYS(!error,User::Panic(KTxtTlsTest,error));
	delete cleanup; 
	__UHEAP_MARKEND;
	return 0; 
    }
コード例 #12
0
// ------------------------------------------------------------------------
// CDRMConsume::HandleL
// ------------------------------------------------------------------------
//
void CDRMConsume::HandleL( ContentAccess::TIntent aIntent )
{
    DRMLOG( _L( "CDRMConsume::HandleL" ) );

    TTime time;
    TBool secure( SECURETIME( time ) );
    InitializeL( aIntent, secure, time );

    DRMLOG( _L( "CDRMConsume::HandleL ok" ) );
}
コード例 #13
0
void UT_CMccRtpDataSource::UT_CMccRtpDataSource_DoStandbyDecisionL()
    {
    // Standby not enabled
    iSource->DoStandByDecision( NULL );
    
    // Standby enabled
    InitializeL();
    iSource->DoStandByDecision( &iSource->iUsers[ 0 ] );
    EUNIT_ASSERT( iSource->iUsers[ 0 ].iStandbyState == EActive );
    }
コード例 #14
0
TVerdict CCustomLabelUid::doTestStepL()
	{
	
	__UHEAP_MARK;

	INFO_PRINTF1(KEnter);
	InitializeL();
	iIterate->Reset();
	
	const TDesC &run = ConfigSection();
	
	if( run == KRun1 )
		{
		INFO_PRINTF1(KTest1);
		TestCustomUidsL(iIterate->NextL() );
		}
	else if( run == KRun2 )
		{
		INFO_PRINTF1(KTest2);
		TestCustomLabelsL( iIterate->NextL() );
		}
	else if( run == KRun3 )
		{
		INFO_PRINTF1(KTest3);
		TestCustomUidLabelsL(iIterate->NextL(), EFalse);
		}
	else if( run == KRun4 )
		{
		INFO_PRINTF1(KTest4);
		TestCustomUidLabelsL(iIterate->NextL(), ETrue);
		}
	else if( run == KRun5 )
		{
		INFO_PRINTF1(KTest5);
		DuplicateUidsTestL( iIterate->NextL() );
		}
	else if( run == KRun6 )
		{
		INFO_PRINTF1(KTest6);
		ExistingUidsTestL( EDuplicateUids );
		}
	else if( run == KRun7 )
		{
		INFO_PRINTF1(KTest7);
		ExistingUidsTestL( EUniqueUids );
		}
	else
		{
		MissngTestPanic();
		}
	Cleanup();
	__UHEAP_MARKEND;
	
	return TestStepResult();
	}
コード例 #15
0
void CAudioDecoderThread::HandleExceptionL()
	{
	// handle exceptions
	
	// Note: After adding support for 3rd Ed, there is no longer actual
	// thread exception handling - instead, inter-thread communication is done 
	// via active object/scheduler. This function is now called from MyActive.
	
	switch( iShared.iExc )
	 {
	 case EExcUserInterrupt:		 // Command from client
		{
		switch( iShared.iCmd )
			{

			case EAudioCmdInitialize:
			 {
			 InitializeL();
			 break;
			 }

			case EAudioCmdStart:
			 {
			 StartMixerL();
			 break;
			 }

			case EAudioCmdStop:
			 {
			 StopMixer();
			 break;
			 }

			case EAudioCmdPause:
			{
			PauseMixer();
			break;
			}

			case EAudioCmdDestroy:
			 {
			 CActiveScheduler::Stop();	// Exit
			 break;
			 }
			}
		break;
		}
	 default:
		{
		// if unknown exception, just exit this thread
		CActiveScheduler::Stop();		 // Exit
		break;
		}
	 }
	}
コード例 #16
0
// -----------------------------------------------------------------------------
// CTARMDmAdapter::
// 
// -----------------------------------------------------------------------------
//
TInt CTARMDmAdapter::CheckPolicyL( const TDesC8& aURI )
	{
	RDEBUG( "CTARMDmAdapter::CheckPolicyL >" );
	InitializeL();
	TPtrC8 resource = PolicyRequestResourceL( aURI );

//sf	TPolicyRequestParams params = iAdapter->CreatePolicyRequestParamsL( aURI );
	TInt ret = CheckPolicy2L( resource );
	RDEBUG_2( "CTARMDmAdapter::CheckPolicyL < %d", ret );
	return ret;
	}
コード例 #17
0
/**
 * Second phase constructor
 * Initialize the backend resources
 */
void CCompassSym::ConstructL()
    {
    // Initialize the backend
    InitializeL();
    // Create magnetometer, this is required as in sensor server,
    // calibration data is available only for magnetometer
    // We need to have a QSensor instance for the magnetometer backend or we will crash
    iMagnetometer = CMagnetometerSensorSym::NewL(new QSensor("QMagnetometer", this));
    // Listen only for property change on magnetometer as we are
    // interested only in calibration property
    iMagnetometer->SetListening(EFalse, ETrue);
    }
コード例 #18
0
/**
 * Second phase constructor
 * Initialize the backend resources
 */
void CAccelerometerSensorSym::ConstructL()
{
    //Initialize the backend resources
    InitializeL();

    TInt err;
    TSensrvProperty unitProperty;
    TRAP(err, iBackendData.iSensorChannel->GetPropertyL(KSensrvPropIdChannelUnit, ESensrvSingleProperty, unitProperty));
    if(err == KErrNone)
    {
        unitProperty.GetValue(iUnit);
    }
}
コード例 #19
0
TVerdict CViewDefAllFieldsTest::doTestStepL()
	{
	
	__UHEAP_MARK;

	InitializeL();
	iIterate->Reset();
	INFO_PRINTF1(KTest1);
	FieldCountTestL();
	Cleanup();
	__UHEAP_MARKEND;
	
	return TestStepResult();
	}
コード例 #20
0
TVerdict CAccessCountTests::doTestStepL()
	{
	
	__UHEAP_MARK;

	InitializeL();
	iIterate->Reset();
	
	const TDesC &run = ConfigSection();
	
	if( run == KRun1 )
		{
		INFO_PRINTF1(KTest1);
		AccessCountTestL( iIterate->NextL() );
		}
	else if( run == KRun2 )
		{
		INFO_PRINTF1(KTest2);
		ForwardAgentDeletionTestL( 10 );
		}
	else if( run == KRun3 )
		{
		INFO_PRINTF1(KTest3);
		ReverseAgentDeletionTestL( 10 );
		}
	else if( run == KRun4 )
		{
		INFO_PRINTF1(KTest4);
		AddGetAgentTestL(iIterate->NextL());
		}
	else if( run == KRun5 )
		{
		INFO_PRINTF1(KTest5);
		AgentAccessCountTestL();
		}
	else if( run == KRun6 )
		{
		INFO_PRINTF1(KTest6);
		AgentExportImportAccessTestL();
		}
	else
		{
		MissngTestPanic();
		}
	Cleanup();
	__UHEAP_MARKEND;

	
	return TestStepResult();
	}
コード例 #21
0
// ------------------------------------------------------------------------
// CDRMConsume::DoContinueL
// ------------------------------------------------------------------------
//
void CDRMConsume::DoContinueL()
{
    DRMLOG( _L( "CDRMConsume::DoContinueL" ) );

    TTime time;
    TBool secureTime( EFalse );
    secureTime = SECURETIME( time );

    if ( !iChild || !iCombined )
    {
        InitializeL( iIntent, secureTime, time );
        // User::Leave( KErrCANoRights );
        return;
    }

    ConsumeTimedItemsL( iCurrentDelay, secureTime, time );
    UpdateDBL();
    iCurrentDelay = 0;

    CombinePermissionsL();

    // If the content has expired, find new permissions, unless the expired
    // constraint was a timed count. In that case, the constraint
    // did not really expire.
    if ( SecurityLevelChanged( secureTime ) ||
            ( iCombined->Expired( time ) &&
              !SERVER->HasActiveCountConstraint( *iURI ) ) )
    {
        InitializeL( iIntent, secureTime, time );
    }
    else
    {
        ActivateL( secureTime, time );
    }

    DRMLOG( _L( "CDRMConsume::DoContinueL ok" ) );
}
コード例 #22
0
TVerdict CViewDefAnyFieldsTest::doTestStepL()
	{
	
	__UHEAP_MARK;
	
	
	InitializeL();
	iIterate->Reset();
	
	const TDesC &run = ConfigSection();
	
	if( run == KRun1 )
		{
		INFO_PRINTF1(KTest1);
		doAnyFieldsTestL(iIterate->NextL());
		}
	else if( run == KRun2 )
		{
		INFO_PRINTF1(KTest2);
		doUniqueUidsTestL(iIterate->NextL());
		}
	else if( run == KRun3 )
		{
		//this panics as only one instance of a uid is allowed within a viewdef
		//only panics in debug mode
		#ifdef _DEBUG
		
		INFO_PRINTF1(KTest3);
		doIdenticalUidsTestL(iIterate->NextL());
		
		#else
		
		INFO_PRINTF1(KTest3);
		_LIT(KTestPanic,"TestPanic");
		User::Panic(KTestPanic, ECntPanicDuplicateViewFields);
		
		#endif
		}
	else
		{
		MissngTestPanic();
		}
	
	Cleanup();
	
	__UHEAP_MARKEND;
	
	return TestStepResult();
	}
コード例 #23
0
// ----------------------------------------------------------------------------
// CWmDrmDlaDefaultHttpManager::RunL
// Overrides CActive::RunL
// ----------------------------------------------------------------------------
void CWmDrmDlaDefaultHttpManager::RunL()
    {
    LOGFN( "CWmDrmDlaDefaultHttpManager::RunL" );
    TInt error( iStatus.Int() );
    LOG3( "CWmDrmDlaDefaultHttpManager State: %d Status: %d", iState, error );

    if ( iState == EOpen && error == KErrNotFound )
        {
        iState=EOpenFailed;
        }
    else
        {
        User::LeaveIfError( error );
        }

    switch (iState)
        {
        case EStart:
            InitializeL();
            break;
        case EInitialize:
            OpenL();
            break;
        case EOpenFailed: // Called only if open fails
            ReconnectL();
            break;
        case EReconnect:
            iState=EOpen;
            // Note: intentionally no break
            // Successfully completed EReconnect is same as EOpen.
        case EOpen:
            SubmitL();
            break;
        default:
            // Panic if called while in ESubmit
            ASSERT( 0 );
            break;
        }

    // Do not advance the state if the transaction was submitted
    // MHFRunL will be called by the HTTP stack while the transaction
    // progresses
    if ( iState != ESubmit )
        {
        // Go to the next state if not finished
        CompleteSelf();
        }
    }
コード例 #24
0
TVerdict CConcurrentNotifierStep::doTestStepL()
	{
	__UHEAP_MARK;
	InitializeL();
	_LIT(KDoStepPrint,"CTransactionsStep::doTestStepL()");
	INFO_PRINTF1(KDoStepPrint);  //Block start
	iIterate->Reset();

	SetSharedTextL(KSharedEvents,KNullDesC, EFalse);
	CActiveScheduler::Add(iMyActive);
	iMyActive->Activate();
	CActiveScheduler::Start();

	Cleanup();
	__UHEAP_MARKEND;

	return TestStepResult();
	}
コード例 #25
0
TVerdict CNotificationStep::doTestStepL()
	{
	__UHEAP_MARK;
	InitializeL();
	
	_LIT(KDoStepPrint,"CNotificationStep::doTestStepL()");
	INFO_PRINTF1(KDoStepPrint);  //Block start 
	iIterate->Reset();
	
	CActiveScheduler::Add(iMyActive);
	ClearNotifications();
	
	const TDesC &run = ConfigSection();
	
	if( run == KRun1 )
		{
		UnkownChangeTestL();
		}
	else if( run == KRun2 )
		{
		TransactionUnkownChangeTestL( EFalse );
		}
	else if( run == KRun3 )
		{
		PlusTransactionUnkownChangeTestL( EFalse );
		}
	else if( run == KRun4 )
		{
		TransactionUnkownChangeTestL( ETrue );
		}
	else if( run == KRun5 )
		{
		PlusTransactionUnkownChangeTestL( ETrue );
		}
	else
		{
		MissingTestPanic();
		}

	Cleanup();
	__UHEAP_MARKEND;

	return TestStepResult();
	}
コード例 #26
0
TVerdict CCompactAndRecoverStep::doTestStepL()
	{
#ifdef __SYMBIAN_CNTMODEL_USE_SQLITE__
	return EPass;
#else	
	__UHEAP_MARK;
	InitializeL();
	_LIT(KPrintStart, "CCompactAndRecoverStep::doTestStepL()");
	INFO_PRINTF1(KPrintStart);  //Block start 
	iIterate->Reset();

	const TDesC &run = ConfigSection();
	
	if( run.Find( KRun1 ) > KErrNotFound )
		{
		INFO_PRINTF1( KTest1 );
		TestWrapperL( &CCompactAndRecoverStep::CRUDOperationsL, KErrNotReady, KErrNotReady, KErrNone, KErrNotReady );
		}
	else if( run.Find( KRun2 ) > KErrNotFound )
		{
		INFO_PRINTF1( KTest2 );
		TestWrapperL(  &CCompactAndRecoverStep::TransactionOperations, KErrNotReady, KErrNotReady, KErrNone, KErrNotReady );
		}
	else if( run.Find( KRun3 ) > KErrNotFound )
		{
		INFO_PRINTF1( KTest3 );
		TestWrapperL(  &CCompactAndRecoverStep::SimpleOperationsL, KErrAccessDenied, KErrNone, KErrNone, KErrNone );
		}
	else if( run.Find( KRun4 ) > KErrNotFound )
		{
		INFO_PRINTF1( KTest4 );
		OpenAsyncTestL();
		}
	else
		{
		MissingTestPanic();
		}
		
	Cleanup();
	__UHEAP_MARKEND;

	return TestStepResult();
#endif
	}
コード例 #27
0
TVerdict CConcurrentTimeOutNotifierStep::doTestStepL()
	{
	__UHEAP_MARK;
	InitializeL();
	_LIT(KDoStepPrint,"CConcurrentTimeOutNotifierStep::doTestStepL()");
	INFO_PRINTF1(KDoStepPrint);  //Block start 
	iIterate->Reset();
	SetTimerL(-1);
	SetContactL( -1 );
	SetSharedTextL(KSharedNextTest, KDoubleChar, EFalse);
	CActiveScheduler::Add(iMyActive);
	iMyActive->Activate();
	CActiveScheduler::Start();
	
	Cleanup();
	__UHEAP_MARKEND;

	return TestStepResult();
	}
コード例 #28
0
ファイル: asf.cpp プロジェクト: kuailexs/symbiandump-mw1
// -----------------------------------------------------------------------------
// CAsf::ConstructL
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CAsf::ConstructL( const TDesC& aFileName )
    {
    TInt r = KErrNone;

    LOGFN( "CAsf::ConstructL" );
    LOG( aFileName );
    User::LeaveIfError( iFs.Connect() );
    r = iFile.Open( iFs, aFileName, EFileStream | EFileRead | EFileShareReadersOrWriters );
    if( r == KErrInUse )
        {
        r = iFile.Open( iFs, aFileName, EFileStream | EFileRead | EFileShareAny);
        if ( r == KErrInUse )
            {
            r = iFile.Open( iFs, aFileName, EFileStream | EFileRead |
                EFileShareReadersOnly);
            }
        }
    User::LeaveIfError( r );
    InitializeL();
    }
コード例 #29
0
void CMdSServer::ConstructL()
    {
    __INIT_LOGGER;
    StartL( KMdSServerName );
    __LOGLB( ELogAlways, "Server start" );

    RProcess process;
    process.SetPriority( EPriorityBackground );
    process.Close();
    
    CheckInitSriptL();
    
    iLockList = CMdSObjectLockList::NewL();
    CMdSSqLiteConnection* conn = CMdSSqLiteConnection::NewLC();
    iDefaultDBConnection = conn;
    MMdSDbConnectionPool::SetDefaultDB( conn );
    CleanupStack::Pop( conn );

    CMdSMaintenanceEngine::InitConnectionL();    
    
    iNotifier = CMdSNotifier::NewL();

    InitializeL();

    iDiskSpaceGarbageCollectorNotifier = 
    	CMdSDiskSpaceNotifierAO::NewL( *this, 
    								   KDiskSpaceGarbageCollectorThreshold,
    								   KMdsSqlDbDefaultName );
    
    iDiskFullNotifier = 
    	CMdSDiskSpaceNotifierAO::NewL( *this, 
    									KDiskFullThreshold,
    									KMdsSqlDbDefaultName );

    // Create a backup & restore watcher and add this server as its observer.								   
    iBURWatcher = CMdEBackupRestoreWatcherAO::NewL(*this);
    
    // create shutdown observer
    iShutdownObserver = CMDSShutdownObserver::NewL( *this );
    iShutdown = EFalse;   
    }
コード例 #30
0
void UT_CMccRtpDataSource::UT_CMccRtpDataSource_StandbyL()
    {
    EUNIT_ASSERT_EQUALS( iSource->StandBy( EForceStandby, 100 ), KErrNotFound );
    
    // Standby force when properly initialized
    InitializeL();
   
    EUNIT_ASSERT_EQUALS( iSource->iUsers.Count(), 2 );
    EUNIT_ASSERT_EQUALS( iSource->StandBy( EForceStandby, KPcmuPayloadType ), KErrNone );
    iSource->iState = MMccRtpInterface::ERtpStatePlaying;
    EUNIT_ASSERT_EQUALS( iSource->StandBy( EForceStandby, KPcmuPayloadType ), KErrNone );
    EUNIT_ASSERT( iSource->iUsers[ 0 ].iStandbyState == EInactive );
    
    // Test activation when already inactive
    EUNIT_ASSERT_EQUALS( iSource->StandBy( EActivateStandby, KPcmuPayloadType ), KErrNone );
    EUNIT_ASSERT( iSource->iUsers[ 0 ].iStandbyState == EInactive );
    
    // Test activation when activating
    iSource->iUsers[ 0 ].iStandbyState = EActivating;
    EUNIT_ASSERT_EQUALS( iSource->StandBy( EActivateStandby, KPcmuPayloadType ), KErrNone );
    EUNIT_ASSERT( iSource->iUsers[ 0 ].iStandbyState == EActivating );
    
    // Test activation when inactive
    iSource->iUsers[ 0 ].iStandbyState = EActive;
    EUNIT_ASSERT_EQUALS( iSource->StandBy( EActivateStandby, KPcmuPayloadType ), KErrNone );
    EUNIT_ASSERT( iSource->iUsers[ 0 ].iStandbyState == EInactive );
    
    // Test deactivation
    EUNIT_ASSERT_EQUALS( iSource->StandBy( EDeactivateStandby, KPcmuPayloadType ), KErrNone );
    EUNIT_ASSERT( iSource->iUsers[ 0 ].iStandbyState == ETurnedOff );
    
    // Test activation when standby is turned off (timer expires)
    iSource->iUsers[ 0 ].iTimerId = 2;
    EUNIT_ASSERT_SPECIFIC_LEAVE( iSource->TimerExpiredL( 2, NULL ), KErrNotSupported );
    
    // Test timer expiration for inactivity
    iSource->iInactivityTimerId = 3;
    iSource->TimerExpiredL( 3, NULL );
    EUNIT_ASSERT_EQUALS( iEventHandler->iLastEvent.iEventType, KMccInactivityEvent );
    }