sysstatemgmt/systemstarter/test/tsysstart2/src/tsysstart2_procstart.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 //
       
    15 
       
    16 
       
    17 #include <e32std.h>
       
    18 #include "tsysstart2_procstart.h"
       
    19 #include "testprocgood.h"
       
    20 #include "testapps.h"
       
    21 
       
    22 CAppFwkSysStart2TestStepProcStart::CAppFwkSysStart2TestStepProcStart()
       
    23 	{
       
    24 	SetTestStepName(KCTestCaseProcStart);
       
    25 	}
       
    26  
       
    27 /**
       
    28 Old Test CaseID 		APPFWK-SYSSTART-0080
       
    29 New Test CaseID 		DEVSRVS-SYSSTART-STARTUP2-0080
       
    30  */
       
    31 
       
    32 TVerdict CAppFwkSysStart2TestStepProcStart::doTestStepL()
       
    33 	{	
       
    34 	
       
    35 	// The test process should have been started, as indicated in tsysstart2-procstart_emulator.rss
       
    36 	TFullName name;
       
    37 	RProcess process;
       
    38 	CleanupClosePushL( process );
       
    39 
       
    40 	
       
    41 	if( ProcessExists(KTestProcGood, name) && (KErrNone == process.Open(name)) )
       
    42 		{
       
    43 		INFO_PRINTF1( _L("The test-process was started successfully at startup") );		
       
    44 		INFO_PRINTF1( _L("Now Kill() the test-process and wait for the throttle time") );
       
    45 		
       
    46 		
       
    47 		process.Kill( KSysStart2TestKillCode );
       
    48 		process.Close();
       
    49 		User::After( KThrottleTime );
       
    50 		
       
    51 		
       
    52 		if( !ProcessExists(KTestProcGood, name) )
       
    53 			{
       
    54 			INFO_PRINTF1( _L("The test-process has correctly _not been restarted") );
       
    55 			
       
    56 			SetTestStepResult( EPass );						
       
    57 			}
       
    58 		else
       
    59 			{
       
    60 			INFO_PRINTF1( _L("The test-process has INcorrectly been restarted") );	
       
    61 			
       
    62 			SetTestStepResult( EFail );
       
    63 			}
       
    64 		
       
    65 		}
       
    66 	else
       
    67 		{
       
    68 		INFO_PRINTF1(_L("The test-process was not started or a handle could not be opened on it"));	
       
    69 		
       
    70 		SetTestStepResult( EFail );
       
    71 		}
       
    72 
       
    73 	CleanupStack::PopAndDestroy( &process );
       
    74 	
       
    75 	return TestStepResult();	
       
    76 	}
       
    77 
       
    78 
       
    79 
       
    80