|
1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __CPIPELININGTESTCLIENT_H__ |
|
17 #define __CPIPELININGTESTCLIENT_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <http.h> |
|
21 #include <in_sock.h> |
|
22 |
|
23 class CHTTPTestUtils; |
|
24 class MPipeliningTestCase; |
|
25 class MPipeliningTestObserver; |
|
26 |
|
27 class CHttpTestTimer : public CActive |
|
28 { |
|
29 public: |
|
30 static CHttpTestTimer* NewL(); |
|
31 |
|
32 void RunL(); |
|
33 void DoCancel(); |
|
34 void StartTimerAndWait(); |
|
35 private: |
|
36 CHttpTestTimer(); |
|
37 void ConstructL(); |
|
38 |
|
39 private: |
|
40 RTimer iTimer; |
|
41 }; |
|
42 |
|
43 class CPipeliningTestClient : public CBase, |
|
44 public MHTTPTransactionCallback |
|
45 { |
|
46 public: |
|
47 static CPipeliningTestClient* NewL(CHTTPTestUtils& aTestUtils, MPipeliningTestObserver& aObserver); |
|
48 ~CPipeliningTestClient(); |
|
49 |
|
50 RHTTPSession& GetSession(); |
|
51 void AddTransactionL(RHTTPTransaction aTransaction); |
|
52 void StartClientL(); |
|
53 void SetTestCase(MPipeliningTestCase* aTestCase); |
|
54 TInt LastError(); |
|
55 |
|
56 protected: |
|
57 CPipeliningTestClient(CHTTPTestUtils& aTestUtils, MPipeliningTestObserver& aObserver); |
|
58 void ConstructL(); |
|
59 void EndTestL(TInt aErrorCode); |
|
60 |
|
61 // From MHTTPTransactionCallback |
|
62 void MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent); |
|
63 TInt MHFRunError(TInt aError, RHTTPTransaction aTransaction, const THTTPEvent& aEvent); |
|
64 void StartAndSetNetworkToHttp(); |
|
65 protected: |
|
66 CHTTPTestUtils& iTestUtils; |
|
67 MPipeliningTestObserver& iObserver; |
|
68 RHTTPSession iSession; |
|
69 RArray<RHTTPTransaction> iTransArray; |
|
70 MPipeliningTestCase* iTestCase; // Not owned |
|
71 TInt iCurrentTrans; |
|
72 TInt iLastError; |
|
73 RSocketServ iSocketServ; |
|
74 RConnection iNetworkConnection; |
|
75 }; |
|
76 |
|
77 #endif // __CPIPELININGTESTCLIENT_H__ |