sl@0: /* sl@0: * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: #ifndef __T_FILETOKENS_H__ sl@0: #define __T_FILETOKENS_H__ sl@0: sl@0: #include "t_testaction.h" sl@0: sl@0: _LIT8(KServerOOMTestStart, "startserveroom"); sl@0: _LIT8(KServerOOMTestStop, "stopserveroom"); sl@0: _LIT8(KCheckServerHeapError, "checkserverheaperror"); sl@0: sl@0: /** sl@0: * A test action that turns on filetokens server-side OOM testing. sl@0: */ sl@0: NONSHARABLE_CLASS(CServerOOMTestStart) : public CTestAction sl@0: { sl@0: public: sl@0: IMPORT_C static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut, sl@0: const TTestActionSpec& aTestActionSpec); sl@0: virtual ~CServerOOMTestStart(); sl@0: sl@0: virtual void PerformAction(TRequestStatus& aStatus); sl@0: virtual void DoPerformPrerequisite(TRequestStatus& aStatus); sl@0: virtual void DoPerformPostrequisite(TRequestStatus& aStatus); sl@0: virtual void PerformCancel(); sl@0: virtual void Reset(); sl@0: sl@0: private: sl@0: CServerOOMTestStart(CConsoleBase& aConsole, Output& aOut); sl@0: void ConstructL(const TTestActionSpec& aTestActionSpec); sl@0: void DoReportAction(); sl@0: void DoCheckResult(TInt aError); sl@0: }; sl@0: sl@0: /** sl@0: * A test action that turns off filetokens server-side OOM testing. sl@0: */ sl@0: NONSHARABLE_CLASS(CServerOOMTestStop) : public CTestAction sl@0: { sl@0: public: sl@0: IMPORT_C static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut, sl@0: const TTestActionSpec& aTestActionSpec); sl@0: virtual ~CServerOOMTestStop(); sl@0: sl@0: virtual void PerformAction(TRequestStatus& aStatus); sl@0: virtual void DoPerformPrerequisite(TRequestStatus& aStatus); sl@0: virtual void DoPerformPostrequisite(TRequestStatus& aStatus); sl@0: virtual void PerformCancel(); sl@0: virtual void Reset(); sl@0: sl@0: private: sl@0: CServerOOMTestStop(CConsoleBase& aConsole, Output& aOut); sl@0: void ConstructL(const TTestActionSpec& aTestActionSpec); sl@0: void DoReportAction(); sl@0: void DoCheckResult(TInt aError); sl@0: }; sl@0: sl@0: /** sl@0: * A test actions to check whether the server has leaked memory. sl@0: * sl@0: * This works by checking for the presence of a file that the server writes when sl@0: * shutting down, if it detects it has leaked memory. This action must sl@0: * therefore be called after the filetokens server has shut down - ie, there sl@0: * must be an action to delete the keystore and an action to wait 3 seconds for sl@0: * the server to shutdown, before this one. sl@0: */ sl@0: NONSHARABLE_CLASS(CCheckServerHeapError) : public CTestAction sl@0: { sl@0: public: sl@0: IMPORT_C static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut, const TTestActionSpec& aTestActionSpec); sl@0: virtual ~CCheckServerHeapError(); sl@0: sl@0: virtual void PerformAction(TRequestStatus& aStatus); sl@0: virtual void DoPerformPrerequisite(TRequestStatus& aStatus); sl@0: virtual void DoPerformPostrequisite(TRequestStatus& aStatus); sl@0: virtual void PerformCancel(); sl@0: virtual void Reset(); sl@0: sl@0: private: sl@0: CCheckServerHeapError(RFs& aFs, CConsoleBase& aConsole, Output& aOut); sl@0: void ConstructL(const TTestActionSpec& aTestActionSpec); sl@0: void DoReportAction(); sl@0: void DoCheckResult(TInt aError); sl@0: sl@0: private: sl@0: RFs& iFs; sl@0: }; sl@0: sl@0: #endif