1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/authorisation/userpromptservice/test/tups/src/tupsclientstep.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,120 @@
1.4 +/*
1.5 +* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +/**
1.23 + @file
1.24 + @test
1.25 +*/
1.26 +
1.27 +
1.28 +#if (!defined UPSQUERRY_STEP_H)
1.29 +#define UPSQUERRY_STEP_H
1.30 +#include <test/testexecutestepbase.h>
1.31 +#include <bautils.h>
1.32 +#include "tupsintegstepbase.h"
1.33 +#include "tups_clientapi_sysserver.h"
1.34 +#include "tupsproperty.h"
1.35 +
1.36 +class TServiceRequestParameters
1.37 + {
1.38 + public:
1.39 + TServiceRequestParameters();
1.40 + TInt iServiceUID;
1.41 + TBuf<30> iServerName;
1.42 + TBuf<60> iDestination;
1.43 + TInt iExpectedError;
1.44 + TBuf8<50> iOpaqueData;
1.45 + TBuf<20> iSelectDialogOption;
1.46 + TInt iButtonsDisplayed;
1.47 + TInt iDialogCreatorInvoked;
1.48 + TInt iPolicyEvaluatorInvoked;
1.49 + TBuf<30> iAccessGranted;
1.50 + TBool iCloseSession;
1.51 + TBool iHoldEvaluatorOpen;
1.52 + TBool iHoldPrepareDialogOpen;
1.53 + TBool iHoldDisplayDialogOpen;
1.54 + TInt iRequestDurationThreshold;
1.55 + TBool iLeaveDialog;
1.56 + TBool iLeaveEvaluator;
1.57 + TBool iCancelUpsRequest;
1.58 + TBool iPlatSecPass;
1.59 + TBool iForcePrompt;
1.60 + TInt iExpectedEvaluatorInfo;
1.61 + TInt iSelectFingerprint;
1.62 + TBuf<60> iWaitUntilFileAppears;
1.63 + };
1.64 +
1.65 +class COpenSession
1.66 + {
1.67 + public:
1.68 + static COpenSession* NewL(const TPtrC& aServerName);
1.69 + void ConstructL(const TPtrC& aServerName);
1.70 + ~COpenSession();
1.71 + TBuf<30> iServerName;
1.72 + RUpsTestServ* iPointerToServer;
1.73 + RUpsTestSession* iPointerToSession;
1.74 + };
1.75 +
1.76 +
1.77 +class CUpsClientStep : public CTUpsIntegStepBase
1.78 + {
1.79 +public:
1.80 + CUpsClientStep();
1.81 + ~CUpsClientStep();
1.82 + virtual TVerdict doTestStepPreambleL();
1.83 + virtual TVerdict doTestStepL();
1.84 + virtual TVerdict doTestStepPostambleL();
1.85 +
1.86 +
1.87 + TBool FindOpenSession(const TDesC& aServerName,TInt &position);
1.88 + RUpsTestSession* GetSessionToServerL(const TDesC& aServerName);
1.89 + void CloseSessionL(const TDesC& aServerName);
1.90 + void CloseAllOpenSessions();
1.91 + void SetTestDataL(TInt aIndex);
1.92 + void SetClientStatusCompleteL();
1.93 + TUpsDecision StringToTUpsDecision(const TPtrC& aString);
1.94 + TPtrC TUpsDecisionToString(TUpsDecision aDecision);
1.95 + TInt ButtonToInt(const TPtrC& aButton);
1.96 + TBool CheckResultsL(TInt aIndex);
1.97 + TBool CheckDialogCreatorResultsL(TInt aIndex);
1.98 + TBool CheckPolicyEvaluatorResultsL(TInt aIndex);
1.99 + void HoldClientL(void);
1.100 +
1.101 + // Array containing pointers to open sessions
1.102 + // maps server name to pointer to session
1.103 + RArray<COpenSession*> iArraySessionsInUse;
1.104 +
1.105 +public:
1.106 + // This array will hold all the services to be requested.
1.107 + RArray<TServiceRequestParameters> iArraySersToRequest;
1.108 +
1.109 + TUpsTestServiceRequestData iRequestData;
1.110 + TUpsTestServiceReturn iReturnData;
1.111 +
1.112 + CUpsProperty* iPropertyReader;
1.113 + TInt iStepRepeat;
1.114 + TInt iServerId;
1.115 + TName iTEFServerName;
1.116 + TInt32 iExpectedClientSid;
1.117 + TInt iHoldClientStepKey;
1.118 +
1.119 + };
1.120 +
1.121 +_LIT(KUPSClientStep,"UPSClientStep");
1.122 +
1.123 +#endif