applayerprotocols/httptransportfw/Test/TestScriptTest/TestScriptTestStep.cpp
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 // Copyright (c) 2006-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  @file
       
    18  @internalTechnology 
       
    19 */
       
    20 
       
    21 // User Include
       
    22 #include "TestScriptTestStep.h"
       
    23 #include "CPipeliningTestEngine.h"
       
    24 
       
    25 /**
       
    26 Constructor. Sets the test step name
       
    27 */
       
    28 CTestScriptTestStep::CTestScriptTestStep()
       
    29 	{
       
    30 	//Call base class method to set human readable name for test step
       
    31 	SetTestStepName(KTestScriptTestStep);
       
    32 	}
       
    33 
       
    34 /**
       
    35 Tries to create a file mentioned in the ini file.
       
    36 @internalTechnology
       
    37 @param		None
       
    38 @return		EPass or EFail indicating the success or failure of file creation.
       
    39 */
       
    40 TVerdict CTestScriptTestStep::doTestStepL()
       
    41 	{
       
    42 	
       
    43 	// Create and install the active scheduler
       
    44  	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
       
    45 	CleanupStack::PushL(scheduler);
       
    46 	CActiveScheduler::Install(scheduler);
       
    47 
       
    48 	// Create the test engine
       
    49 	CPipeliningTestEngine* testEngine = CPipeliningTestEngine::NewL();
       
    50 	CleanupStack::PushL(testEngine);
       
    51 
       
    52 	TPtrC ptr(ConfigSection());
       
    53 	TRAPD(error, testEngine->StartTestsL(ptr));
       
    54 	
       
    55 	if(error != KErrNone)
       
    56 		{
       
    57 		SetTestStepError(error);
       
    58 		SetTestStepResult(EFail);		
       
    59 		}
       
    60 	else
       
    61 		{
       
    62 		SetTestStepResult(EPass);		
       
    63 		}
       
    64 
       
    65 	CleanupStack::PopAndDestroy(testEngine);
       
    66 	CleanupStack::PopAndDestroy(scheduler); 
       
    67 	
       
    68 	return TestStepResult();
       
    69 	
       
    70 	}	// doTestStepL
       
    71