authorisation/userpromptservice/test/tups/src/tupsclientstep.h
changeset 8 35751d3474b7
child 15 da2ae96f639b
equal deleted inserted replaced
2:675a964f4eb5 8:35751d3474b7
       
     1 /*
       
     2 * Copyright (c) 2007-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 /**
       
    20  @file  
       
    21  @test
       
    22 */
       
    23 
       
    24 
       
    25 #if (!defined UPSQUERRY_STEP_H)
       
    26 #define  UPSQUERRY_STEP_H 
       
    27 #include <test/testexecutestepbase.h>
       
    28 #include <bautils.h>
       
    29 #include <swi/swispubsubdefs.h>
       
    30 #include "tupsintegstepbase.h"
       
    31 #include <test/tups_clientapi_sysserver.h>
       
    32 #include "tupsproperty.h"
       
    33 
       
    34 class TServiceRequestParameters
       
    35 	{
       
    36 	public:
       
    37   	TServiceRequestParameters();
       
    38 	TInt 		iServiceUID;
       
    39 	TBuf<30> 	iServerName;
       
    40 	TBuf<60> 	iDestination;
       
    41 	TInt  		iExpectedError; 
       
    42 	TBuf8<50>	iOpaqueData;
       
    43  	TBuf<20>	iSelectDialogOption;
       
    44 	TInt		iButtonsDisplayed;	
       
    45 	TInt		iDialogCreatorInvoked;
       
    46 	TInt		iPolicyEvaluatorInvoked;
       
    47 	TBuf<30>	iAccessGranted;
       
    48 	TBool		iCloseSession;
       
    49 	TBool		iHoldEvaluatorOpen;
       
    50 	TBool		iHoldPrepareDialogOpen;
       
    51 	TBool		iHoldDisplayDialogOpen;
       
    52 	TInt		iRequestDurationThreshold;
       
    53 	TBool		iLeaveDialog;
       
    54 	TBool		iLeaveEvaluator;
       
    55 	TBool		iCancelUpsRequest;
       
    56 	TBool		iPlatSecPass; 
       
    57 	TBool		iForcePrompt;
       
    58 	TInt		iExpectedEvaluatorInfo;
       
    59 	TInt		iSelectFingerprint; 
       
    60 	TBuf<60> 	iWaitUntilFileAppears; 
       
    61 	};
       
    62 
       
    63 class COpenSession
       
    64 	{
       
    65 	public:
       
    66 	static 	COpenSession* NewL(const TPtrC& aServerName);
       
    67 	void	ConstructL(const TPtrC& aServerName);
       
    68 	~COpenSession();
       
    69 	TBuf<30> iServerName;  
       
    70   	RUpsTestServ* iPointerToServer;
       
    71 	RUpsTestSession* iPointerToSession;
       
    72 	};
       
    73 
       
    74 
       
    75 class CUpsClientStep : public CTUpsIntegStepBase
       
    76 	{
       
    77 public:
       
    78 	CUpsClientStep();
       
    79 	~CUpsClientStep();
       
    80 	virtual TVerdict doTestStepPreambleL();
       
    81 	virtual TVerdict doTestStepL();
       
    82 	virtual TVerdict doTestStepPostambleL();
       
    83 
       
    84  
       
    85 	TBool				FindOpenSession(const TDesC& aServerName,TInt &position);
       
    86 	RUpsTestSession*	GetSessionToServerL(const TDesC& aServerName);
       
    87 	void				CloseSessionL(const TDesC& aServerName);
       
    88 	void 				CloseAllOpenSessions();
       
    89 	void 				SetTestDataL(TInt aIndex);
       
    90 	void 				SetClientStatusCompleteL();
       
    91 	TUpsDecision 		StringToTUpsDecision(const TPtrC& aString);
       
    92 	TPtrC		 		TUpsDecisionToString(TUpsDecision aDecision);
       
    93 	TInt				ButtonToInt(const TPtrC& aButton);
       
    94 	TBool 				CheckResultsL(TInt aIndex);
       
    95 	TBool				CheckDialogCreatorResultsL(TInt aIndex);	
       
    96 	TBool				CheckPolicyEvaluatorResultsL(TInt aIndex);
       
    97 	void				WaitThatFileAppearsL(const TDesC& aFileName);			
       
    98 	void 				HoldClientL(void);
       
    99 		
       
   100 	// Array containing pointers to open sessions
       
   101 	// maps server name to pointer to session 
       
   102 	RArray<COpenSession*> iArraySessionsInUse;
       
   103 
       
   104 public:
       
   105 	// This array will hold all the services to be requested.
       
   106 	RArray<TServiceRequestParameters>	iArraySersToRequest;   
       
   107 	 
       
   108 	TUpsTestServiceRequestData 	iRequestData;
       
   109 	TUpsTestServiceReturn		iReturnData;
       
   110 	
       
   111 	CUpsProperty*				iPropertyReader;
       
   112 	TInt						iStepRepeat;
       
   113 	TInt						iServerId;
       
   114 	TName 						iTEFServerName;
       
   115 	TInt32 						iExpectedClientSid;
       
   116 	TInt 						iHoldClientStepKey;
       
   117 	
       
   118 	};
       
   119 
       
   120 _LIT(KUPSClientStep,"UPSClientStep");
       
   121 
       
   122 #endif