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