60
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-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 "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 |
#ifndef LOCATIONMANAGERTESTSCRIPTER_H
|
|
20 |
#define LOCATIONMANAGERTESTSCRIPTER_H
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <StifLogger.h>
|
|
24 |
#include <TestScripterInternal.h>
|
|
25 |
#include <StifTestModule.h>
|
|
26 |
#include <locationeventdef.h>
|
|
27 |
#include <rlocationtrail.h>
|
|
28 |
#include <rtracklog.h>
|
|
29 |
#include "locationmanagerdefs.h"
|
|
30 |
#include "rlocationobjectmanipulator.h"
|
|
31 |
#include "mdccommon.h"
|
|
32 |
#include "mdesession.h"
|
|
33 |
|
|
34 |
#ifdef LOC_REVERSEGEOCODE
|
|
35 |
#include "rlocationgeotagger.h"
|
|
36 |
#endif //LOC_REVERSEGEOCODE
|
|
37 |
|
|
38 |
// CONSTANTS
|
|
39 |
// Logging path
|
|
40 |
_LIT( KLocationManagerTestScripterLogPath, "\\logs\\testframework\\LocationManagerTestScripter\\" );
|
|
41 |
// Log file
|
|
42 |
_LIT( KLocationManagerTestScripterLogFile, "LocationManagerTestScripter.txt" );
|
|
43 |
_LIT( KLocationManagerTestScripterLogFileWithTitle, "LocationManagerTestScripter_[%S].txt" );
|
|
44 |
|
|
45 |
|
|
46 |
// FORWARD DECLARATIONS
|
|
47 |
class CMdEObject;
|
|
48 |
class CLocationManagerTestScripter;
|
|
49 |
|
|
50 |
|
|
51 |
// CLASS DECLARATION
|
|
52 |
NONSHARABLE_CLASS(CLocationManagerTestScripter) : public CScriptBase,
|
|
53 |
public MTrackLogObserver,
|
|
54 |
public MMdESessionObserver
|
|
55 |
{
|
|
56 |
public: // Constructors and destructor
|
|
57 |
|
|
58 |
/**
|
|
59 |
* Two-phased constructor.
|
|
60 |
*/
|
|
61 |
static CLocationManagerTestScripter* NewL( CTestModuleIf& aTestModuleIf );
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Destructor.
|
|
65 |
*/
|
|
66 |
virtual ~CLocationManagerTestScripter();
|
|
67 |
|
|
68 |
public: // Functions from base classes
|
|
69 |
|
|
70 |
/**
|
|
71 |
* From CScriptBase Runs a script line.
|
|
72 |
* @since ?Series60_version
|
|
73 |
* @param aItem Script line containing method name and parameters
|
|
74 |
* @return Symbian OS error code
|
|
75 |
*/
|
|
76 |
virtual TInt RunMethodL( CStifItemParser& aItem );
|
|
77 |
|
|
78 |
public: // From MdESessionObserver
|
|
79 |
virtual void HandleSessionOpened(CMdESession& aSession, TInt aError);
|
|
80 |
virtual void HandleSessionError(CMdESession& aSession, TInt aError);
|
|
81 |
|
|
82 |
virtual void GPSFixQualityChanged(TPositionSatelliteInfo& aFixQuality,
|
|
83 |
TBool& aTrackingActive );
|
|
84 |
|
|
85 |
private:
|
|
86 |
|
|
87 |
/**
|
|
88 |
* C++ default constructor.
|
|
89 |
*/
|
|
90 |
CLocationManagerTestScripter( CTestModuleIf& aTestModuleIf );
|
|
91 |
|
|
92 |
/**
|
|
93 |
* By default Symbian 2nd phase constructor is private.
|
|
94 |
*/
|
|
95 |
void ConstructL();
|
|
96 |
|
|
97 |
/**
|
|
98 |
* Frees all resources allocated from test methods.
|
|
99 |
*/
|
|
100 |
void Delete();
|
|
101 |
|
|
102 |
CMdEObject* CreateMetadataObjectL();
|
|
103 |
void TestLocationData( TLocationData& aLocationData );
|
|
104 |
|
|
105 |
TInt PrepareSessionL( CStifItemParser& aItem );
|
|
106 |
TInt SetupOML( CStifItemParser& aItem );
|
|
107 |
TInt LocationSnapshotL( CStifItemParser& aItem );
|
|
108 |
TInt RemoveLocationObjectL( CStifItemParser& aItem );
|
|
109 |
TInt TearDownOML( CStifItemParser& aItem );
|
|
110 |
TInt CloseOML( CStifItemParser& aItem );
|
|
111 |
virtual TInt RLocationObjectManipulatorTest_CopyByIDL( CStifItemParser& aItem );
|
|
112 |
virtual TInt RLocationObjectManipulatorTest_CopyByURIL( CStifItemParser& aItem );
|
|
113 |
TInt RLocationObjectManipulatorTest_CopyByURI_DisconnectedL( CStifItemParser& aItem );
|
|
114 |
TInt RLocationObjectManipulatorTest_CopyByID_DisconnectedL( CStifItemParser& aItem );
|
|
115 |
|
|
116 |
virtual TInt ConnectL( CStifItemParser& aItem );
|
|
117 |
virtual TInt CloseL( CStifItemParser& aItem );
|
|
118 |
virtual TInt TrailConnectL( CStifItemParser& aItem );
|
|
119 |
virtual TInt TrailCloseL( CStifItemParser& aItem );
|
|
120 |
virtual TInt StartTrailL( CStifItemParser& aItem );
|
|
121 |
virtual TInt StopTrailL( CStifItemParser& aItem );
|
|
122 |
virtual TInt StartTrailTestsL( CStifItemParser& aItem );
|
|
123 |
virtual TInt GetTrailStateL( CStifItemParser& aItem );
|
|
124 |
virtual TInt LocationTrailNotifyTestL( CStifItemParser& aItem );
|
|
125 |
virtual TInt RetrieveLocationL( CStifItemParser& aItem );
|
|
126 |
virtual TInt CurrentLocationL( CStifItemParser& aItem );
|
|
127 |
|
|
128 |
TInt SetupTrackLogL( CStifItemParser& aItem );
|
|
129 |
TInt TearDownTrackLog( CStifItemParser& aItem );
|
|
130 |
TInt RTrackLogTest_AddObserverL( CStifItemParser& aItem );
|
|
131 |
TInt RTrackLogTest_RemoveObserverL( CStifItemParser& aItem );
|
|
132 |
virtual TInt RTrackLogTest_StartTrackLogL( CStifItemParser& aItem );
|
|
133 |
virtual TInt RTrackLogTest_RecordingL( CStifItemParser& aItem );
|
|
134 |
virtual TInt RTrackLogTest_StopTrackLogL( CStifItemParser& aItem );
|
|
135 |
virtual TInt RTrackLogTest_NotRecordingL( CStifItemParser& aItem );
|
|
136 |
TInt CrashLocationManagerL( CStifItemParser& aItem );
|
|
137 |
TInt GetFileL( CStifItemParser& aItem );
|
|
138 |
TInt DeleteFileL( CStifItemParser& aItem );
|
|
139 |
TInt GetStatusL( CStifItemParser& aItem );
|
|
140 |
TInt GetStatus2L( CStifItemParser& aItem );
|
|
141 |
//ADD NEW METHOD DEC HERE
|
|
142 |
//[TestMethods] - Do not remove
|
|
143 |
|
|
144 |
#ifdef LOC_REVERSEGEOCODE
|
|
145 |
TInt ConnectGeoTaggerL( CStifItemParser& /*aItem*/ );
|
|
146 |
TInt CloseGeoTaggerL( CStifItemParser& /*aItem*/ );
|
|
147 |
TInt StartGeoTaggingL( CStifItemParser& aItem );
|
|
148 |
|
|
149 |
TInt TestGeoTagCompleteStatusL( CStifItemParser& aItem );
|
|
150 |
TInt TestGeoTagPendingStatusL( CStifItemParser& aItem );
|
|
151 |
TInt TestGeoTagGoingOnStatusL( CStifItemParser& aItem );
|
|
152 |
|
|
153 |
TInt CancelGeoTaggingL( CStifItemParser& aItem ) ;
|
|
154 |
#endif //LOC_REVERSEGEOCODE
|
|
155 |
|
|
156 |
public: // From MTrackLogObserver
|
|
157 |
void TrackLogStarted(TInt aError);
|
|
158 |
void TrackLogStopped(TInt aError);
|
|
159 |
|
|
160 |
private: // Data
|
|
161 |
|
|
162 |
RLocationManager iLocationManager;
|
|
163 |
RLocationTrail iLocationTrail;
|
|
164 |
|
|
165 |
TBool iRunning;
|
|
166 |
RTrackLog iTrackLog;
|
|
167 |
RLocationObjectManipulator iOM;
|
|
168 |
|
|
169 |
CMdEObject* iSourceObject;
|
|
170 |
CMdEObject* iTargetObject;
|
|
171 |
CMdESession* iMdeSession;
|
|
172 |
|
|
173 |
CActiveSchedulerWait* iASW;
|
|
174 |
|
|
175 |
#ifdef LOC_REVERSEGEOCODE
|
|
176 |
RLocationGeoTagger iLocationGeoTagger;
|
|
177 |
TBool iLocGeoTaggerConnected;
|
|
178 |
#endif //LOC_REVERSEGEOCODE
|
|
179 |
};
|
|
180 |
|
|
181 |
#endif // LOCATIONMANAGERTESTSCRIPTER_H
|
|
182 |
|
|
183 |
// End of File
|