sysstatemgmt/systemstatemgr/test/tss/src/tss_appstartapparcinit.cpp
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Old Test CaseID 		APPFWK-SSS-0003
       
    15 // New Test CaseID 		DEVSRVS-SSMA-STARTSAFE-0003
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file
       
    21  @test
       
    22  @internalComponent - Internal Symbian test code
       
    23 */
       
    24 
       
    25 
       
    26 #include "tss_appstartapparcinit.h"
       
    27 
       
    28 
       
    29 
       
    30 TVerdict CSsTestStepAppStartAppArcInit::doTestStepL( void )
       
    31 	{
       
    32 
       
    33 	CSsmStartSafe* ss = CSsmStartSafe::NewL();	
       
    34 	CleanupStack::PushL( ss );
       
    35 	
       
    36 	CSsmStartupProperties* properties = CSsmStartupProperties::NewL();
       
    37 	CleanupStack::PushL( properties );
       
    38 	
       
    39 	RProcess process;
       
    40 	CleanupClosePushL( process );
       
    41 	
       
    42 	properties->SetFileParamsL( KTestAppGood, KNullDesC );
       
    43 	properties->SetCommandTypeL( ESsmCmdStartApp );
       
    44 	properties->SetExecutionBehaviour( ESsmDeferredWaitForSignal );
       
    45 	
       
    46 	INFO_PRINTF1(_L("Starting the Test-App process asynchronously"));
       
    47 
       
    48 	TInt index = 0;
       
    49 	CAsStopper* stopper = new(ELeave) CAsStopper( KSsAsStopperNominalTimeout );
       
    50 	CleanupStack::PushL( stopper );
       
    51 	
       
    52 	TRequestStatus& trs = stopper->Trs();
       
    53 	
       
    54 	ss->Start(*properties, process, trs, index);
       
    55 	
       
    56 	//Application is started using Deferred Wait for start execution behaviour, 
       
    57 	//Start method always sets TRequestStatus to KRequestPending.
       
    58 	if( KRequestPending == trs.Int() )
       
    59 		{
       
    60 		CActiveScheduler::Start();
       
    61 		INFO_PRINTF3( _L("Rendezvous completed with %d. Anticipated value %d"), trs.Int(), KErrNone );
       
    62 		}
       
    63 	
       
    64 	TInt appArcErr = ss->InitAppArcServer(); // try to initiate apparc, to see if that causes any problems
       
    65 
       
    66 	TEST( KErrNone == appArcErr );
       
    67 	TEST( 1 == FindAndKill(KTestAppGood) );
       
    68 	TEST( trs == KErrNone );
       
    69 		
       
    70 	CleanupStack::PopAndDestroy( 4, ss );
       
    71 	return TestStepResult();	
       
    72 	}
       
    73 
       
    74 
       
    75 
       
    76 CSsTestStepAppStartAppArcInit::CSsTestStepAppStartAppArcInit()
       
    77 	{
       
    78 	SetTestStepName(KCTestCaseAppStartAppArcInit);
       
    79 	}
       
    80 
       
    81 
       
    82 
       
    83 CSsTestStepAppStartAppArcInit::~CSsTestStepAppStartAppArcInit()
       
    84 	{
       
    85 	delete iActiveScheduler;
       
    86 	}
       
    87 
       
    88 
       
    89 TVerdict CSsTestStepAppStartAppArcInit::doTestStepPreambleL()
       
    90 	{
       
    91 	iActiveScheduler = new(ELeave) CActiveScheduler;
       
    92 	CActiveScheduler::Install( iActiveScheduler );
       
    93 
       
    94 	return CTestStep::doTestStepPreambleL();	
       
    95 	}
       
    96 
       
    97 
       
    98 
       
    99 TVerdict CSsTestStepAppStartAppArcInit::doTestStepPostambleL()
       
   100 	{
       
   101 	return CTestStep::doTestStepPostambleL();
       
   102 	}
       
   103 
       
   104 
       
   105 
       
   106 
       
   107