|
1 // Copyright (c) 2004-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 #if !defined (__CTEXTMODETESTPOSTBODYCHUNKS_H__) |
|
17 #define __CTEXTMODETESTPOSTBODYCHUNKS_H__ |
|
18 |
|
19 #include <http.h> |
|
20 #if !defined(__HTTPTESTCORE_H__) |
|
21 #include "HttpTestCore.h" |
|
22 #endif |
|
23 |
|
24 #include "TestScripts.h" |
|
25 |
|
26 /** |
|
27 Derived test case class : POST body sent in separate chunks |
|
28 |
|
29 @param aIniSettingsFile This holds the instance of the settings.ini |
|
30 file. |
|
31 */ |
|
32 class CTextModeTestPostBodyChunks: public CHttpTestTransBase, public MHTTPTransactionCallback |
|
33 { |
|
34 public: |
|
35 static CTextModeTestPostBodyChunks* NewL(CScriptFile* aIniSettingsFile); |
|
36 virtual ~CTextModeTestPostBodyChunks(); |
|
37 public: |
|
38 // methods inherited from MHTTPTransactionCallback |
|
39 virtual void MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent); |
|
40 virtual TInt MHFRunError(TInt aError, RHTTPTransaction aTransaction, const THTTPEvent& aEvent); |
|
41 // methods inherited from MHTTPDataSupplier |
|
42 virtual TBool GetNextDataPart(TPtrC8& aDataChunk); |
|
43 void ReleaseData(); |
|
44 TInt OverallDataSize(); |
|
45 protected: |
|
46 const TDesC& TestName(); |
|
47 // methods used to run the tests. |
|
48 virtual void DoRunL(); |
|
49 virtual TInt RunError(TInt aErr); |
|
50 virtual void DoCancel(); |
|
51 private: |
|
52 class CDelayedBodyDataNotifier : public CTimer |
|
53 { |
|
54 public: |
|
55 static CDelayedBodyDataNotifier* NewL(RHTTPTransaction aTrans); |
|
56 virtual void RunL(); |
|
57 protected: |
|
58 CDelayedBodyDataNotifier(RHTTPTransaction aTrans); |
|
59 private: |
|
60 RHTTPTransaction iTrans; |
|
61 }; |
|
62 private: |
|
63 CTextModeTestPostBodyChunks(CScriptFile* aIniSettingsFile); |
|
64 void ConstructL(); |
|
65 private: |
|
66 TInt iReqBodyChunkCount; |
|
67 CDelayedBodyDataNotifier* iReleaseTimer; |
|
68 TInt iFailureError; |
|
69 |
|
70 /** This has the instance of the settings.ini file. This instance is passed |
|
71 to ReplaceHostNameL() function which uses this instance to retrieve the |
|
72 data from settings.ini file. |
|
73 */ |
|
74 CScriptFile* iIniSettingsFile; |
|
75 }; |
|
76 |
|
77 |
|
78 #endif // !defined __CTEXTMODETESTPOSTBODYCHUNKS_H__ |