|
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 __CTESTCLIENTHTTPGET_H__ |
|
17 #define __CTESTCLIENTHTTPGET_H__ |
|
18 |
|
19 #include "chttpservice.h" |
|
20 #include "chttpclienttransaction.h" |
|
21 #include "httptestutils.h" |
|
22 |
|
23 class MLocalTestServerObserver; |
|
24 class CHttpClientTestParams; |
|
25 |
|
26 class CTestClientHttpSimpleGet : public CHttpClientTransaction, public MHttpContentSink |
|
27 { |
|
28 public: |
|
29 static CTestClientHttpSimpleGet* NewL(CHttpClientTestParams& aParams, MLocalTestServerObserver& aObserver, CHttpService& aClient, const TDesC8& aUri, CHTTPTestUtils* iUtils); |
|
30 ~CTestClientHttpSimpleGet(); |
|
31 |
|
32 protected: |
|
33 CTestClientHttpSimpleGet(CHttpClientTestParams& aParams, MLocalTestServerObserver& aObserver, CHTTPTestUtils* iUtils); |
|
34 void ConstructL(CHttpService& aClient, const TDesC8& aUri); |
|
35 // From CHTTPClientTransaction |
|
36 virtual void OnResponseHeaders(); |
|
37 virtual void OnCompletion(); |
|
38 virtual void OnError(TInt aError); |
|
39 virtual void OnTransferProgress(TInt aTotal, TInt aTransffered); |
|
40 virtual TBool OnRedirection(); |
|
41 // From MHTTPContentSink |
|
42 void OnData(THttpContentSinkOp& aData); |
|
43 protected: |
|
44 MLocalTestServerObserver& iObserver; |
|
45 CHttpClientTestParams& iParams; |
|
46 CHTTPTestUtils& iTestUtils; |
|
47 }; |
|
48 |
|
49 class CTestClientHttpOnlineGet : public CTestClientHttpSimpleGet |
|
50 { |
|
51 public: |
|
52 static CTestClientHttpOnlineGet* NewL(CHttpClientTestParams& aParams, MLocalTestServerObserver& aObserver, CHttpService& aClient, const TDesC8& aUri, CHTTPTestUtils* iUtils); |
|
53 ~CTestClientHttpOnlineGet(); |
|
54 private: |
|
55 void ConstructL(CHttpService& aClient, const TDesC8& aUri); |
|
56 |
|
57 CTestClientHttpOnlineGet(CHttpClientTestParams& aParams, MLocalTestServerObserver& aObserver, CHTTPTestUtils* iUtils); |
|
58 virtual void OnResponseHeaders(); |
|
59 virtual void OnCompletion(); |
|
60 // From MHTTPContentSink |
|
61 void OnData(THttpContentSinkOp& aData); |
|
62 }; |
|
63 #endif // __CHTTPCLIENTHTTPGET_H__ |