os/security/cryptoservices/filebasedcertificateandkeystores/test/tfiletokens/t_filetokens.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2004-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 #ifndef __T_FILETOKENS_H__
    20 #define __T_FILETOKENS_H__
    21 
    22 #include "t_testaction.h"
    23 
    24 _LIT8(KServerOOMTestStart, "startserveroom");
    25 _LIT8(KServerOOMTestStop, "stopserveroom");
    26 _LIT8(KCheckServerHeapError, "checkserverheaperror");
    27 
    28 /**
    29  * A test action that turns on filetokens server-side OOM testing.
    30  */
    31 NONSHARABLE_CLASS(CServerOOMTestStart) : public CTestAction
    32 	{
    33 public:
    34 	IMPORT_C static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut,
    35 									  const TTestActionSpec& aTestActionSpec);
    36 	virtual ~CServerOOMTestStart();
    37 	
    38 	virtual void PerformAction(TRequestStatus& aStatus);
    39 	virtual void DoPerformPrerequisite(TRequestStatus& aStatus);
    40 	virtual void DoPerformPostrequisite(TRequestStatus& aStatus);
    41 	virtual void PerformCancel();
    42 	virtual void Reset();
    43 
    44 private:
    45 	CServerOOMTestStart(CConsoleBase& aConsole, Output& aOut);
    46 	void ConstructL(const TTestActionSpec& aTestActionSpec);
    47 	void DoReportAction();
    48 	void DoCheckResult(TInt aError);
    49 	};
    50 
    51 /**
    52  * A test action that turns off filetokens server-side OOM testing.
    53  */
    54 NONSHARABLE_CLASS(CServerOOMTestStop) : public CTestAction
    55 	{
    56 public:
    57 	IMPORT_C static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut,
    58 									  const TTestActionSpec& aTestActionSpec);
    59 	virtual ~CServerOOMTestStop();
    60 	
    61 	virtual void PerformAction(TRequestStatus& aStatus);
    62 	virtual void DoPerformPrerequisite(TRequestStatus& aStatus);
    63 	virtual void DoPerformPostrequisite(TRequestStatus& aStatus);
    64 	virtual void PerformCancel();
    65 	virtual void Reset();
    66 
    67 private:
    68 	CServerOOMTestStop(CConsoleBase& aConsole, Output& aOut);
    69 	void ConstructL(const TTestActionSpec& aTestActionSpec);
    70 	void DoReportAction();
    71 	void DoCheckResult(TInt aError);
    72 	};
    73 
    74 /**
    75  * A test actions to check whether the server has leaked memory.
    76  *
    77  * This works by checking for the presence of a file that the server writes when
    78  * shutting down, if it detects it has leaked memory.  This action must
    79  * therefore be called after the filetokens server has shut down - ie, there
    80  * must be an action to delete the keystore and an action to wait 3 seconds for
    81  * the server to shutdown, before this one.
    82  */
    83 NONSHARABLE_CLASS(CCheckServerHeapError) : public CTestAction
    84 	{
    85 public:
    86 	IMPORT_C static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut, const TTestActionSpec& aTestActionSpec);
    87 	virtual ~CCheckServerHeapError();
    88 	
    89 	virtual void PerformAction(TRequestStatus& aStatus);
    90 	virtual void DoPerformPrerequisite(TRequestStatus& aStatus);
    91 	virtual void DoPerformPostrequisite(TRequestStatus& aStatus);
    92 	virtual void PerformCancel();
    93 	virtual void Reset();
    94 	
    95 private:
    96 	CCheckServerHeapError(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
    97 	void ConstructL(const TTestActionSpec& aTestActionSpec);
    98 	void DoReportAction();
    99 	void DoCheckResult(TInt aError);
   100 
   101 private:
   102 	RFs& iFs;
   103 	};
   104 
   105 #endif