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