1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/cryptomgmtlibs/securitytestfw/test/testhandler2/Tcancel.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,139 @@
1.4 +/*
1.5 +* Copyright (c) 2005-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 +*/
1.25 +
1.26 +#include "tcancel.h"
1.27 +#include "t_output.h"
1.28 +#include "t_testhandler.h"
1.29 +#include "t_testrunner.h"
1.30 +
1.31 +CCancelStart* CCancelStart::NewL(CConsoleBase& aConsole,
1.32 + Output& aOut,
1.33 + const TTestActionSpec& aTestActionSpec)
1.34 + {
1.35 + CCancelStart* self = CCancelStart::NewLC(aConsole, aOut, aTestActionSpec);
1.36 + CleanupStack::Pop(self);
1.37 + return self;
1.38 + }
1.39 +
1.40 +CCancelStart* CCancelStart::NewLC(CConsoleBase& aConsole,
1.41 + Output& aOut,
1.42 + const TTestActionSpec& aTestActionSpec)
1.43 + {
1.44 + CCancelStart* self = new(ELeave) CCancelStart(aConsole, aOut);
1.45 + CleanupStack::PushL(self);
1.46 + self->ConstructL(aTestActionSpec);
1.47 + return self;
1.48 + }
1.49 +
1.50 +CCancelStart::~CCancelStart()
1.51 + {
1.52 + }
1.53 +
1.54 +void CCancelStart::PerformAction(TRequestStatus& aStatus)
1.55 + {
1.56 + iTestHandler->SetTestRunnerL(new (ELeave) CCancelTestRunner(iOut));
1.57 +
1.58 + TRequestStatus* status = &aStatus;
1.59 + User::RequestComplete(status, KErrNone);
1.60 + iResult = ETrue;
1.61 + iFinished = ETrue;
1.62 + iActionState = EPostrequisite;
1.63 + }
1.64 +
1.65 +CCancelStart::CCancelStart(CConsoleBase& aConsole,
1.66 + Output& aOut)
1.67 + : CTestAction(aConsole, aOut)
1.68 + {
1.69 + }
1.70 +
1.71 +void CCancelStart::ConstructL(const TTestActionSpec& aTestActionSpec)
1.72 + {
1.73 + CTestAction::ConstructL(aTestActionSpec);
1.74 + }
1.75 +
1.76 +void CCancelStart::DoReportAction()
1.77 + {
1.78 + iOut.writeString(_L("Starting cancellation test sequence..."));
1.79 + iOut.writeNewLine();
1.80 + iOut.writeNewLine();
1.81 + }
1.82 +
1.83 +void CCancelStart::DoCheckResult(TInt /*aError*/)
1.84 + {
1.85 + }
1.86 +
1.87 +CCancelStop* CCancelStop::NewL(CConsoleBase& aConsole,
1.88 + Output& aOut,
1.89 + const TTestActionSpec& aTestActionSpec)
1.90 + {
1.91 + CCancelStop* self = CCancelStop::NewLC(aConsole, aOut, aTestActionSpec);
1.92 + CleanupStack::Pop(self);
1.93 + return self;
1.94 + }
1.95 +
1.96 +CCancelStop* CCancelStop::NewLC(CConsoleBase& aConsole,
1.97 + Output& aOut,
1.98 + const TTestActionSpec& aTestActionSpec)
1.99 + {
1.100 + CCancelStop* self = new(ELeave) CCancelStop(aConsole, aOut);
1.101 + CleanupStack::PushL(self);
1.102 + self->ConstructL(aTestActionSpec);
1.103 + return self;
1.104 + }
1.105 +
1.106 +CCancelStop::~CCancelStop()
1.107 + {
1.108 + }
1.109 +
1.110 +void CCancelStop::PerformAction(TRequestStatus& aStatus)
1.111 + {
1.112 + iTestHandler->SetTestRunnerL(NULL);
1.113 +
1.114 + TRequestStatus* status = &aStatus;
1.115 + User::RequestComplete(status, KErrNone);
1.116 + iResult = ETrue;
1.117 + iFinished = ETrue;
1.118 + iActionState = EPostrequisite;
1.119 + }
1.120 +
1.121 +CCancelStop::CCancelStop(CConsoleBase& aConsole,
1.122 + Output& aOut)
1.123 +
1.124 + : CTestAction(aConsole, aOut)
1.125 + {
1.126 + }
1.127 +
1.128 +void CCancelStop::ConstructL(const TTestActionSpec& aTestActionSpec)
1.129 + {
1.130 + CTestAction::ConstructL(aTestActionSpec);
1.131 + }
1.132 +
1.133 +void CCancelStop::DoReportAction()
1.134 + {
1.135 + iOut.writeString(_L("Stopping cancel sequence..."));
1.136 + iOut.writeNewLine();
1.137 + iOut.writeNewLine();
1.138 + }
1.139 +
1.140 +void CCancelStop::DoCheckResult(TInt /*aError*/)
1.141 + {
1.142 + }