|
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 GetPositionL |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_COMASUPLPOSITIONCANCELTEST_H |
|
19 #define C_COMASUPLPOSITIONCANCELTEST_H |
|
20 |
|
21 #include "epos_comasuplpostestercategory.h" |
|
22 #include "epos_comasuplpositionvelocitymanager.h" |
|
23 |
|
24 class COMASuplPosHandlerBase; |
|
25 class COMASuplTestHandler; |
|
26 class COMASuplPosTesterLogger; |
|
27 class COMASuplInfoRequestList; |
|
28 class COMASuplInfoRequestList; |
|
29 class COMASuplMessageFileReader; |
|
30 |
|
31 /** Constant used for logging name of test*/ |
|
32 _LIT8(KPositionCancelTest,"---------------GetPosition Cancellation Test---------------"); |
|
33 |
|
34 /** Constant used for logging information about test*/ |
|
35 _LIT8(KPositionCancelTestComplete, "Info: GetPosition Cancellation Test Complete."); |
|
36 |
|
37 /** Constant used for logging information about test*/ |
|
38 _LIT8(KPositionCancelTestCancel, "Info: GetPosition Cancellation Test Canceled."); |
|
39 |
|
40 /** Constant used for logging information about test*/ |
|
41 _LIT8(KPositionCancelTestAborted, "Error: GetPosition Cancellation Test Aborted"); |
|
42 |
|
43 /** |
|
44 * Tests GetPositionL in different scenarios. |
|
45 * |
|
46 * It tests the process of reading messages from a message file and sending |
|
47 * the POS payload created from the message file, to the Message plugin. |
|
48 * When all the messages are sent, it asks the Message plugin for Position |
|
49 * and cancels the request. |
|
50 * |
|
51 * @lib epos_comasuplpostestermodulecfg |
|
52 * @since S60 v3.1u |
|
53 */ |
|
54 class COMASuplPositionCancelTest : public COMASuplPositionVelocityManager |
|
55 { |
|
56 public: |
|
57 static COMASuplPositionCancelTest* NewL( |
|
58 COMASuplPosHandlerBase* aPosHandler |
|
59 , TInt aGetPositionReqCount |
|
60 , TFileName& aFileName |
|
61 , COMASuplPosTesterCategory* aCallBack = NULL); |
|
62 |
|
63 virtual ~COMASuplPositionCancelTest(); |
|
64 |
|
65 private: |
|
66 COMASuplPositionCancelTest( |
|
67 COMASuplPosHandlerBase* aPosHandler |
|
68 , TInt aGetPositionReqCount |
|
69 , TFileName& aFileName |
|
70 , COMASuplPosTesterCategory* aCallBack); |
|
71 void ConstructL(); |
|
72 |
|
73 public: |
|
74 //derived form MOMASuplTestObserver through COMASuplPosTesterCategory |
|
75 /** |
|
76 * From COMASuplPosTesterCategory |
|
77 * Starts testing for the test class |
|
78 * |
|
79 * @since S60 v3.1u |
|
80 */ |
|
81 void StartTestingL(); |
|
82 |
|
83 /** |
|
84 * From COMASuplPosTesterCategory |
|
85 * Cancels testing for the test class |
|
86 * |
|
87 * @since S60 v3.1 |
|
88 */ |
|
89 void TestingCancelled(const TDesC8& aInfo); |
|
90 |
|
91 /** |
|
92 * From COMASuplPosTesterCategory |
|
93 * Completes testing for the test class |
|
94 * |
|
95 * @since S60 v3.1 |
|
96 */ |
|
97 void TestingComplete(const TDesC8& aInfo); |
|
98 |
|
99 /** |
|
100 * From COMASuplPosTesterCategory |
|
101 * Aborts testing for the test class |
|
102 * |
|
103 * @since S60 v3.1 |
|
104 */ |
|
105 void TestingAborted(const TDesC8& aError); |
|
106 public: |
|
107 //derived from CActive through COMASuplPosTesterCategory |
|
108 /** |
|
109 * From COMASuplPosTesterCategory |
|
110 * Handles completion of asynchronous request |
|
111 * |
|
112 * @since S60 v3.1 |
|
113 */ |
|
114 void RunL(); |
|
115 /** |
|
116 * From COMASuplPosTesterCategory |
|
117 * Handles cancellation of asynchronous request |
|
118 * |
|
119 * @since S60 v3.1 |
|
120 */ |
|
121 void DoCancel(); |
|
122 |
|
123 /** |
|
124 * From COMASuplPosTesterCategory |
|
125 * Handles leave from RunL |
|
126 * |
|
127 * @since S60 v3.1 |
|
128 * @param aError: Errorcode of leaving |
|
129 */ |
|
130 TInt RunError( TInt aError ); |
|
131 public: |
|
132 /** |
|
133 * Cancels GetPositionL. Calls CancelGetPosition() |
|
134 * |
|
135 * @since S60 v3.1 |
|
136 * @return void |
|
137 */ |
|
138 void CancelGetPositionRequest(); |
|
139 |
|
140 /** |
|
141 * Sets iCancelRequested to ETrue |
|
142 * |
|
143 * @since S60 v3.1 |
|
144 * @return void |
|
145 */ |
|
146 void CancellationRequested(); |
|
147 |
|
148 private: |
|
149 /** |
|
150 * Pointer to the PosHandler. |
|
151 * Not own. |
|
152 */ |
|
153 COMASuplPosHandlerBase* iPosHandler; |
|
154 |
|
155 /** |
|
156 * Unique request id for session |
|
157 */ |
|
158 TInt iRequestID; |
|
159 |
|
160 /* |
|
161 * ETrue if the Position request has been canceled. |
|
162 */ |
|
163 TBool iCancelRequested; |
|
164 }; |
|
165 #endif |