|
1 /* |
|
2 * Copyright (c) 2007 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: Class definition for CTestAppConsole |
|
15 ** |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __TESTAPPCONSOLE_H |
|
21 #define __TESTAPPCONSOLE_H |
|
22 |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <e32keys.h> |
|
26 #include "natfwconnectivityapidefs.h" |
|
27 #include "natcomtestobserver.h" |
|
28 #include "natcomtest.h" |
|
29 |
|
30 class CNATFWConnectivityApi; |
|
31 class CNATConnFWTestConsoleStubs; |
|
32 class CMediaTestStubs; |
|
33 class CICETestStubs; |
|
34 class CStunUdpMediaTest; |
|
35 class CSettings; |
|
36 class CNATSettingsTest; |
|
37 class CConsoleBase; |
|
38 class TIap; |
|
39 |
|
40 class CTestAppConsole : public CActive, public MNatComTestObserver |
|
41 { |
|
42 public: |
|
43 static CTestAppConsole* NewLC(); |
|
44 virtual ~CTestAppConsole(); |
|
45 |
|
46 void StartTesting(); |
|
47 void DisplayMsg( const TDesC& aMsg ); |
|
48 |
|
49 // From MNatComTestObserver |
|
50 void Notify( TNatComTestEvent aEvent, TInt aError ); |
|
51 |
|
52 TInt LocalCandidates( const RPointerArray<CNATFWCandidate>& aLocalCandidates ); |
|
53 |
|
54 TInt RemoteCandidates( RPointerArray<CNATFWCandidate>& aRemoteCandidates ); |
|
55 |
|
56 void DoPause( TRequestStatus& aStatus ); |
|
57 |
|
58 TInt CandidatePairs( const RPointerArray<CNATFWCandidatePair>& iCandidatePairs ); |
|
59 |
|
60 private: |
|
61 |
|
62 CTestAppConsole( ); |
|
63 |
|
64 void ConstructL(); |
|
65 |
|
66 void RunL(); |
|
67 |
|
68 void DoCancel(); |
|
69 |
|
70 void ProcessMainInput(); |
|
71 |
|
72 void ProcessDomainSetupInputL(); |
|
73 |
|
74 void ProcessMediaTestInputL(); |
|
75 |
|
76 void ProcessIapInputL(); |
|
77 |
|
78 void IapSelectionL(); |
|
79 |
|
80 // create console menus |
|
81 void DisplayConsoleMenuL( const TDesC& aInstructions ); |
|
82 |
|
83 TKeyCode GetStringFromConsole( TDes& aAddr ); |
|
84 |
|
85 void DoRead(); |
|
86 |
|
87 // Starting point functions for testing |
|
88 |
|
89 TInt RunNatSTUNUdpTests(); |
|
90 |
|
91 TInt RunNatSTUNTcpTests(); |
|
92 |
|
93 TInt RunTurnUdpTests(); |
|
94 |
|
95 TInt RunTurnTcpTests(); |
|
96 |
|
97 void NATTurnUdpPreambleL(); |
|
98 |
|
99 void NATTurnTcpPreambleL(); |
|
100 |
|
101 void SetupSTUNUDPTestL(); |
|
102 |
|
103 void SetupSTUNTCPTestL(); |
|
104 |
|
105 void TeardownSTUNTestL(); |
|
106 |
|
107 TInt RunIceUdpTestsL(); |
|
108 |
|
109 TInt RunIceTcpTestsL(); |
|
110 |
|
111 void SetupICEUDPTestL(); |
|
112 |
|
113 void SetupICETCPTestL(); |
|
114 |
|
115 void TeardownICETestL(); |
|
116 |
|
117 TInt RunStunUdpMediaTestL(); |
|
118 |
|
119 void StopStunUdpMediaTestL(); |
|
120 |
|
121 TInt FetchCandidates( TUint aProtocol, TBool aUseRtcp = EFalse ); |
|
122 |
|
123 TInt StartIceComTest( TUint aProtocol, |
|
124 TNATFWIceRole aRole, TBool aUseRtcp = EFalse ); |
|
125 |
|
126 TInt FetchCandidate( TUint aProtocol, TComTestType aType, TBool aUseRtcp = EFalse ); |
|
127 |
|
128 TInt StartComTest( TUint aProtocol, TComTestType aType, |
|
129 TBool aUseRtcp = EFalse ); |
|
130 |
|
131 void StopIceComTest(); |
|
132 |
|
133 void SetupStunUdpMediaTestL(); |
|
134 |
|
135 TInt RunNatSettingsTest(); |
|
136 |
|
137 void SetupSettingsTestL(); |
|
138 |
|
139 void TeardownSettingsTestL(); |
|
140 |
|
141 TInt PrintLocalAddress(); |
|
142 |
|
143 TInt SetLocalToDestinationAddrL(); |
|
144 |
|
145 TInt PrintStoredCandidates(); |
|
146 |
|
147 void CloseMediaStreamL(); |
|
148 |
|
149 private: |
|
150 |
|
151 enum EInputProcess |
|
152 { |
|
153 KMainInput, |
|
154 KDomainNameInput, |
|
155 KMediaTestInput, |
|
156 KIapInput |
|
157 }; |
|
158 |
|
159 TUint iInputProcess; |
|
160 TUint32 iDestAddress; |
|
161 TUint iDestPort; |
|
162 TBool iAudioTestStun; |
|
163 TBool iAudioTestICE; |
|
164 CConsoleBase* iConsole; |
|
165 HBufC* iInstruct; |
|
166 CNATFWConnectivityApi* iNat; |
|
167 CStunUdpMediaTest* iIntTest; |
|
168 CNATConnFWTestConsoleStubs* iNatStub; |
|
169 CMediaTestStubs* iNatMediaStub; |
|
170 CICETestStubs* iNatICEStubs; |
|
171 CSettings* iSettings; |
|
172 CNatComTest* iIceComTest; |
|
173 CNATSettingsTest* iSettingsTest; |
|
174 TRequestStatus* iListenerStatus; |
|
175 TBool iPause; |
|
176 HBufC8* iDomainName; |
|
177 TUint32 iIapId; |
|
178 }; |
|
179 |
|
180 #endif __TESTAPPCONSOLE_H |