|
1 /* |
|
2 * Copyright (c) 2005-2006 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 "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: Tests cancellation of GetSuplInfoL() in different scenarios |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_COMASUPLGETSUPLINFOCANCELTEST_H |
|
19 #define C_COMASUPLGETSUPLINFOCANCELTEST_H |
|
20 |
|
21 #include <epos_comasuplinforequestlist.h> |
|
22 #include "epos_comasuplgetsuplinfomanager.h" |
|
23 //#include "epos_comasuplpostestercategory.h" |
|
24 //epos_comasuplgetsuplinfocanceltest.h |
|
25 class COMASuplPosHandlerBase; |
|
26 class COMASuplPosSessionBase; |
|
27 |
|
28 /** Constant used for logging name of test*/ |
|
29 _LIT8(KGetSuplInfoCancelTest, "---------------GetSuplInfoL Cancel Test---------------"); |
|
30 |
|
31 /** Constant used for logging information about test*/ |
|
32 _LIT8(KGetSuplInfoCancelTestComplete, "Info: GetSuplInfoL Cancel Test Complete."); |
|
33 |
|
34 /** Constant used for logging information about test*/ |
|
35 _LIT8(KGetSuplInfoCancelTestCancel, "Info: GetSuplInfoL Cancel Test Canceled."); |
|
36 |
|
37 /** Constant used for logging information about test*/ |
|
38 _LIT8(KGetSuplInfoCancelTestAborted, "Error: GetSuplInfoL Cancel Test Aborted"); |
|
39 |
|
40 /** |
|
41 * Tests GetSuplInfoL() function |
|
42 * |
|
43 * Tests GetSuplInfoL() function after Initializing the session and |
|
44 * after closing the session. Contents of request List can be controlled |
|
45 * through arguments in CreateRequestList(). |
|
46 * |
|
47 * @lib PosTesterModuleCfg.lib |
|
48 * @since S60 v3.1 |
|
49 */ |
|
50 class COMASuplGetSuplInfoCancelTest : public COMASuplGetSuplInfoManager |
|
51 { |
|
52 public: |
|
53 |
|
54 static COMASuplGetSuplInfoCancelTest* NewL( |
|
55 COMASuplPosHandlerBase& aPosHandler |
|
56 , COMASuplPosTesterCategory* aCallBack = NULL ); |
|
57 virtual ~COMASuplGetSuplInfoCancelTest(); |
|
58 |
|
59 private: |
|
60 void ConstructL(); |
|
61 COMASuplGetSuplInfoCancelTest( COMASuplPosHandlerBase& aPosHandler |
|
62 , COMASuplPosTesterCategory* aCallBack ); |
|
63 public: |
|
64 /** |
|
65 * Ends session specified by iSessionBase |
|
66 * |
|
67 * @since S60 v3.1 |
|
68 * @return void |
|
69 */ |
|
70 void EndSession(const TDesC8& aInfo); |
|
71 |
|
72 /** |
|
73 * Tests cancellation of GetSuplInfoL() after Ending the session. |
|
74 * GetSuplInfoL() is not requested before cancel request. |
|
75 * |
|
76 * @since S60 v3.1 |
|
77 * @return void |
|
78 */ |
|
79 void CancelWithoutRequest( TRequestStatus& aStatus |
|
80 , TExecutionSequence aNextinSeq ); |
|
81 |
|
82 /** |
|
83 * Cancels GetSuplInfoL() |
|
84 * |
|
85 * @since S60 v3.1 |
|
86 * @return void |
|
87 */ |
|
88 void CancelGetInfoRequest(const TDesC8& aInfo); |
|
89 |
|
90 /** |
|
91 * Writes log based on completion status of GetSuplInfoL(). |
|
92 * |
|
93 * @since S60 v3.1 |
|
94 * @return void |
|
95 */ |
|
96 void ProcessRequestComplete(); |
|
97 |
|
98 public: |
|
99 //derived form MOMASuplTestObserver through COMASuplPosTesterCategory |
|
100 /** |
|
101 * From COMASuplPosTesterCategory |
|
102 * Starts testing for the test class |
|
103 * |
|
104 * @since S60 v3.1 |
|
105 */ |
|
106 void StartTestingL(); |
|
107 public: |
|
108 //derived from CActive through COMASuplPosTesterCategory |
|
109 /** |
|
110 * From COMASuplPosTesterCategory |
|
111 * Handles completion of asynchronous request |
|
112 * |
|
113 * @since S60 v3.1 |
|
114 */ |
|
115 void RunL(); |
|
116 /** |
|
117 * From COMASuplPosTesterCategory |
|
118 * Handles cancellation of asynchronous request |
|
119 * |
|
120 * @since S60 v3.1 |
|
121 */ |
|
122 void DoCancel(); |
|
123 |
|
124 /** |
|
125 * From COMASuplPosTesterCategory |
|
126 * Handles leave from RunL |
|
127 * |
|
128 * @since S60 v3.1 |
|
129 * @param aError: Errorcode of leaving |
|
130 */ |
|
131 TInt RunError( TInt aError ); |
|
132 |
|
133 /** |
|
134 * If Session initialization completes with KErrNone, calls |
|
135 * CancelGetSuplInfo |
|
136 * |
|
137 * @since S60 v3.1 |
|
138 * @return void |
|
139 */ |
|
140 void ProcessInitComplete(); |
|
141 |
|
142 /** |
|
143 * Requests for GetSuplInfoL() and immediately cancels it. |
|
144 * |
|
145 * @since S60 v3.1 |
|
146 * @return void |
|
147 */ |
|
148 void ProcessGetSuplInfoAndCancelL(); |
|
149 |
|
150 /** |
|
151 * When GetSuplInfoL completes this function is executed. It provides |
|
152 * information about completion status of GetSuplInfoL. |
|
153 * |
|
154 * @since S60 v3.1 |
|
155 * @return void |
|
156 */ |
|
157 void ProcessGetSuplInfoRequestComplete(); |
|
158 |
|
159 /** |
|
160 * Ends session specified by iSessionBase and requests for CancelGetsuplInfo. |
|
161 * |
|
162 * @since S60 v3.1 |
|
163 * @return void |
|
164 */ |
|
165 void ProcessEndSessionAndCancel(); |
|
166 }; |
|
167 #endif |