os/security/authorisation/userpromptservice/test/include/tups_clientapi_sysserver.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/authorisation/userpromptservice/test/include/tups_clientapi_sysserver.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,104 @@
1.4 +/*
1.5 +* Copyright (c) 2007-2009 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 +#if !(defined UPS_TEST_CLIENT_H)
1.28 +#define UPS_TEST_CLIENT_H
1.29 +
1.30 +#include <e32base.h>
1.31 +#include <test/tefexportconst.h>
1.32 +#include <ups/upsclient.h>
1.33 +
1.34 +enum {
1.35 + EUpsTest_ConnectServer,
1.36 + EUpsTest_UseTestService, // Simulates the use of a service provided by the test system server.
1.37 + EUpsTest_OpenSession, // Opens subsession to test system server.
1.38 + EUpsTest_CloseSession, // Closes subsession to test system server.
1.39 + EUpsTest_GetServerSid, // returns sid of server.
1.40 + };
1.41 +
1.42 +class TUpsTestServiceRequestData
1.43 + {
1.44 + public:
1.45 + inline TUpsTestServiceRequestData();
1.46 + TBool iOpaquePresent;
1.47 + TBuf8<50> iOpaqueData;
1.48 + TBool iMeasureResponceTime;
1.49 + TUid iServiceUid;
1.50 + TBuf<60> iDestination;
1.51 + TBool iCancelRequest;
1.52 + TBool iPlatSecPass;
1.53 + };
1.54 +
1.55 +inline TUpsTestServiceRequestData::TUpsTestServiceRequestData():
1.56 +iOpaquePresent(0),iOpaqueData(0),iMeasureResponceTime(0),iServiceUid(TUid::Uid(0)),iDestination(0),iCancelRequest(0),iPlatSecPass(0)
1.57 + {
1.58 + }
1.59 +
1.60 +
1.61 +
1.62 +class TUpsTestServiceReturn
1.63 + {
1.64 + public:
1.65 + inline TUpsTestServiceReturn();
1.66 + TUpsDecision iDecision;
1.67 + TInt iError;
1.68 + TBuf<50> iErrorMessage;
1.69 + TUint32 iRequestDuration;
1.70 + };
1.71 +
1.72 +inline TUpsTestServiceReturn::TUpsTestServiceReturn():
1.73 +iDecision(TUpsDecision(EUpsDecNo)),iError(0),iErrorMessage(0)
1.74 + {
1.75 + }
1.76 +
1.77 +class RUpsTestServ : public RSessionBase
1.78 +
1.79 + {
1.80 +public:
1.81 + IMPORT_C TInt Connect(const TDesC& aServerName, TBool aDebugMode = EFalse);
1.82 + IMPORT_C const TDesC& ServerName() const;
1.83 +protected:
1.84 +private:
1.85 + RLibrary iLibrary;
1.86 + TBuf<KMaxTestExecuteNameLength> iServerName;
1.87 + TVersion Version() const;
1.88 + };
1.89 +
1.90 +class RUpsTestSession : public RSubSessionBase
1.91 +
1.92 + {
1.93 +public:
1.94 + IMPORT_C TInt Open(RUpsTestServ& aServ);
1.95 + IMPORT_C TInt UseTestService(TUpsTestServiceRequestData& aTestServiceRequestData,TUpsTestServiceReturn& aServiceCompoundReturn);
1.96 + IMPORT_C void Close(void);
1.97 + IMPORT_C TInt GetServerSid();
1.98 + IMPORT_C void ShutdownUPS(void);
1.99 +protected:
1.100 +
1.101 +
1.102 +private:
1.103 +
1.104 +
1.105 + };
1.106 +
1.107 +#endif