installationservices/swi/test/tasynccancel/asynccancelstep.cpp
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "asynccancelstep.h"
       
    20 
       
    21 
       
    22 	
       
    23 CAsyncCancelStep::~CAsyncCancelStep()
       
    24 	{
       
    25 	}	
       
    26 	
       
    27 CAsyncCancelStep::CAsyncCancelStep()
       
    28 	{
       
    29 	SetTestStepName(KAsyncCancelStep);
       
    30 	}
       
    31 
       
    32 TVerdict CAsyncCancelStep::doTestStepPreambleL()
       
    33 	{
       
    34 	SetTestStepResult(EPass);
       
    35 	return TestStepResult();
       
    36 	}
       
    37 	
       
    38 TVerdict CAsyncCancelStep::doTestStepL()
       
    39 	{
       
    40 	
       
    41 	
       
    42 	// read sis filename
       
    43 	TPtrC sisToInstall;
       
    44 	GetStringFromConfig(ConfigSection(), _L("sisToInstall"), sisToInstall);
       
    45 	
       
    46 	// read uid
       
    47 	TInt tmpUid;
       
    48 	if(GetHexFromConfig(ConfigSection(), _L("uidToInstall"), tmpUid) == EFalse)
       
    49 		{
       
    50 		tmpUid = 0;
       
    51 		}
       
    52 	
       
    53 	// read data related to cancelling intervals
       
    54 	TInt whenToCancelLow;
       
    55 	GetIntFromConfig(ConfigSection(),_L("whenToCancelLow"),whenToCancelLow);
       
    56 	TInt whenToCancelHigh;
       
    57 	GetIntFromConfig(ConfigSection(),_L("whenToCancelHigh"),whenToCancelHigh);
       
    58 	TInt howManyCancelations;
       
    59 	GetIntFromConfig(ConfigSection(),_L("howManyCancelations"),howManyCancelations);
       
    60 	TInt minWhenToCancelInc;
       
    61 	GetIntFromConfig(ConfigSection(),_L("minWhenToCancelInc"),minWhenToCancelInc);
       
    62 
       
    63 	CInstallPrefs* prefs=CInstallPrefs::NewLC();
       
    64 	
       
    65 	
       
    66 	// OCSP related options	
       
    67 	TPtrC ocspUri;
       
    68 	if (GetStringFromConfig(ConfigSection(), _L("ocspUri"), ocspUri))
       
    69 		{
       
    70 		const TUint KMaxUriLength=512;
       
    71 		TBuf8<KMaxUriLength> temp;
       
    72 		temp.Copy(ocspUri);
       
    73 		prefs->SetRevocationServerUriL(temp);
       
    74 		}
       
    75 
       
    76 	TInt useOcsp=0;
       
    77 	if (GetIntFromConfig(ConfigSection(), _L("useOcsp"), useOcsp))
       
    78 		{
       
    79 		prefs->SetPerformRevocationCheck(useOcsp ? ETrue : EFalse);
       
    80 		}
       
    81 	
       
    82 	
       
    83 	// run test
       
    84 	TInt err= DoTestL(
       
    85 					 whenToCancelLow, whenToCancelHigh, howManyCancelations, minWhenToCancelInc,
       
    86 					 sisToInstall, TUid::Uid(tmpUid),
       
    87 					 prefs
       
    88 					 );
       
    89 	if (err != KErrNone)
       
    90 		{
       
    91 		SetTestStepResult(EFail);
       
    92 		}
       
    93 		
       
    94 		
       
    95 	CleanupStack::PopAndDestroy(prefs);
       
    96 		
       
    97 	return TestStepResult();
       
    98 	}		
       
    99 		
       
   100 TVerdict CAsyncCancelStep::doTestStepPostambleL()
       
   101 	{
       
   102 	return TestStepResult();
       
   103 	}
       
   104 
       
   105 // End of file