os/security/cryptoservices/filebasedcertificateandkeystores/test/tfiletokens/t_filetokens.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/cryptoservices/filebasedcertificateandkeystores/test/tfiletokens/t_filetokens.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,105 @@
1.4 +/*
1.5 +* Copyright (c) 2004-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 +#ifndef __T_FILETOKENS_H__
1.23 +#define __T_FILETOKENS_H__
1.24 +
1.25 +#include "t_testaction.h"
1.26 +
1.27 +_LIT8(KServerOOMTestStart, "startserveroom");
1.28 +_LIT8(KServerOOMTestStop, "stopserveroom");
1.29 +_LIT8(KCheckServerHeapError, "checkserverheaperror");
1.30 +
1.31 +/**
1.32 + * A test action that turns on filetokens server-side OOM testing.
1.33 + */
1.34 +NONSHARABLE_CLASS(CServerOOMTestStart) : public CTestAction
1.35 + {
1.36 +public:
1.37 + IMPORT_C static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut,
1.38 + const TTestActionSpec& aTestActionSpec);
1.39 + virtual ~CServerOOMTestStart();
1.40 +
1.41 + virtual void PerformAction(TRequestStatus& aStatus);
1.42 + virtual void DoPerformPrerequisite(TRequestStatus& aStatus);
1.43 + virtual void DoPerformPostrequisite(TRequestStatus& aStatus);
1.44 + virtual void PerformCancel();
1.45 + virtual void Reset();
1.46 +
1.47 +private:
1.48 + CServerOOMTestStart(CConsoleBase& aConsole, Output& aOut);
1.49 + void ConstructL(const TTestActionSpec& aTestActionSpec);
1.50 + void DoReportAction();
1.51 + void DoCheckResult(TInt aError);
1.52 + };
1.53 +
1.54 +/**
1.55 + * A test action that turns off filetokens server-side OOM testing.
1.56 + */
1.57 +NONSHARABLE_CLASS(CServerOOMTestStop) : public CTestAction
1.58 + {
1.59 +public:
1.60 + IMPORT_C static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut,
1.61 + const TTestActionSpec& aTestActionSpec);
1.62 + virtual ~CServerOOMTestStop();
1.63 +
1.64 + virtual void PerformAction(TRequestStatus& aStatus);
1.65 + virtual void DoPerformPrerequisite(TRequestStatus& aStatus);
1.66 + virtual void DoPerformPostrequisite(TRequestStatus& aStatus);
1.67 + virtual void PerformCancel();
1.68 + virtual void Reset();
1.69 +
1.70 +private:
1.71 + CServerOOMTestStop(CConsoleBase& aConsole, Output& aOut);
1.72 + void ConstructL(const TTestActionSpec& aTestActionSpec);
1.73 + void DoReportAction();
1.74 + void DoCheckResult(TInt aError);
1.75 + };
1.76 +
1.77 +/**
1.78 + * A test actions to check whether the server has leaked memory.
1.79 + *
1.80 + * This works by checking for the presence of a file that the server writes when
1.81 + * shutting down, if it detects it has leaked memory. This action must
1.82 + * therefore be called after the filetokens server has shut down - ie, there
1.83 + * must be an action to delete the keystore and an action to wait 3 seconds for
1.84 + * the server to shutdown, before this one.
1.85 + */
1.86 +NONSHARABLE_CLASS(CCheckServerHeapError) : public CTestAction
1.87 + {
1.88 +public:
1.89 + IMPORT_C static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut, const TTestActionSpec& aTestActionSpec);
1.90 + virtual ~CCheckServerHeapError();
1.91 +
1.92 + virtual void PerformAction(TRequestStatus& aStatus);
1.93 + virtual void DoPerformPrerequisite(TRequestStatus& aStatus);
1.94 + virtual void DoPerformPostrequisite(TRequestStatus& aStatus);
1.95 + virtual void PerformCancel();
1.96 + virtual void Reset();
1.97 +
1.98 +private:
1.99 + CCheckServerHeapError(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
1.100 + void ConstructL(const TTestActionSpec& aTestActionSpec);
1.101 + void DoReportAction();
1.102 + void DoCheckResult(TInt aError);
1.103 +
1.104 +private:
1.105 + RFs& iFs;
1.106 + };
1.107 +
1.108 +#endif