|
1 /* |
|
2 * Copyright (c) 2005-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 |
|
20 |
|
21 /** |
|
22 @file |
|
23 */ |
|
24 |
|
25 #include "tcancel.h" |
|
26 #include "t_output.h" |
|
27 #include "t_testhandler.h" |
|
28 #include "t_testrunner.h" |
|
29 |
|
30 CCancelStart* CCancelStart::NewL(CConsoleBase& aConsole, |
|
31 Output& aOut, |
|
32 const TTestActionSpec& aTestActionSpec) |
|
33 { |
|
34 CCancelStart* self = CCancelStart::NewLC(aConsole, aOut, aTestActionSpec); |
|
35 CleanupStack::Pop(self); |
|
36 return self; |
|
37 } |
|
38 |
|
39 CCancelStart* CCancelStart::NewLC(CConsoleBase& aConsole, |
|
40 Output& aOut, |
|
41 const TTestActionSpec& aTestActionSpec) |
|
42 { |
|
43 CCancelStart* self = new(ELeave) CCancelStart(aConsole, aOut); |
|
44 CleanupStack::PushL(self); |
|
45 self->ConstructL(aTestActionSpec); |
|
46 return self; |
|
47 } |
|
48 |
|
49 CCancelStart::~CCancelStart() |
|
50 { |
|
51 } |
|
52 |
|
53 void CCancelStart::PerformAction(TRequestStatus& aStatus) |
|
54 { |
|
55 iTestHandler->SetTestRunnerL(new (ELeave) CCancelTestRunner(iOut)); |
|
56 |
|
57 TRequestStatus* status = &aStatus; |
|
58 User::RequestComplete(status, KErrNone); |
|
59 iResult = ETrue; |
|
60 iFinished = ETrue; |
|
61 iActionState = EPostrequisite; |
|
62 } |
|
63 |
|
64 CCancelStart::CCancelStart(CConsoleBase& aConsole, |
|
65 Output& aOut) |
|
66 : CTestAction(aConsole, aOut) |
|
67 { |
|
68 } |
|
69 |
|
70 void CCancelStart::ConstructL(const TTestActionSpec& aTestActionSpec) |
|
71 { |
|
72 CTestAction::ConstructL(aTestActionSpec); |
|
73 } |
|
74 |
|
75 void CCancelStart::DoReportAction() |
|
76 { |
|
77 iOut.writeString(_L("Starting cancellation test sequence...")); |
|
78 iOut.writeNewLine(); |
|
79 iOut.writeNewLine(); |
|
80 } |
|
81 |
|
82 void CCancelStart::DoCheckResult(TInt /*aError*/) |
|
83 { |
|
84 } |
|
85 |
|
86 CCancelStop* CCancelStop::NewL(CConsoleBase& aConsole, |
|
87 Output& aOut, |
|
88 const TTestActionSpec& aTestActionSpec) |
|
89 { |
|
90 CCancelStop* self = CCancelStop::NewLC(aConsole, aOut, aTestActionSpec); |
|
91 CleanupStack::Pop(self); |
|
92 return self; |
|
93 } |
|
94 |
|
95 CCancelStop* CCancelStop::NewLC(CConsoleBase& aConsole, |
|
96 Output& aOut, |
|
97 const TTestActionSpec& aTestActionSpec) |
|
98 { |
|
99 CCancelStop* self = new(ELeave) CCancelStop(aConsole, aOut); |
|
100 CleanupStack::PushL(self); |
|
101 self->ConstructL(aTestActionSpec); |
|
102 return self; |
|
103 } |
|
104 |
|
105 CCancelStop::~CCancelStop() |
|
106 { |
|
107 } |
|
108 |
|
109 void CCancelStop::PerformAction(TRequestStatus& aStatus) |
|
110 { |
|
111 iTestHandler->SetTestRunnerL(NULL); |
|
112 |
|
113 TRequestStatus* status = &aStatus; |
|
114 User::RequestComplete(status, KErrNone); |
|
115 iResult = ETrue; |
|
116 iFinished = ETrue; |
|
117 iActionState = EPostrequisite; |
|
118 } |
|
119 |
|
120 CCancelStop::CCancelStop(CConsoleBase& aConsole, |
|
121 Output& aOut) |
|
122 |
|
123 : CTestAction(aConsole, aOut) |
|
124 { |
|
125 } |
|
126 |
|
127 void CCancelStop::ConstructL(const TTestActionSpec& aTestActionSpec) |
|
128 { |
|
129 CTestAction::ConstructL(aTestActionSpec); |
|
130 } |
|
131 |
|
132 void CCancelStop::DoReportAction() |
|
133 { |
|
134 iOut.writeString(_L("Stopping cancel sequence...")); |
|
135 iOut.writeNewLine(); |
|
136 iOut.writeNewLine(); |
|
137 } |
|
138 |
|
139 void CCancelStop::DoCheckResult(TInt /*aError*/) |
|
140 { |
|
141 } |