|
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 __CPIPELININGTESTCASE_H__ |
|
17 #define __CPIPELININGTESTCASE_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <http.h> |
|
21 |
|
22 #include "MPipeliningTestCase.h" |
|
23 #include <chttpformencoder.h> |
|
24 |
|
25 |
|
26 |
|
27 enum THeaderPosition |
|
28 { |
|
29 ENoHeader = -1, |
|
30 EHttpHeader, |
|
31 EConnectionHeader, |
|
32 EBatchingHeader, |
|
33 ETransactionHeader |
|
34 }; |
|
35 |
|
36 //Forward declarations |
|
37 class CHTTPTestUtils; |
|
38 class CPipeliningTestParams; |
|
39 |
|
40 class CPipeliningTestCase : public CBase, public MPipeliningTestCase, public MHTTPDataSupplier |
|
41 |
|
42 |
|
43 { |
|
44 public: |
|
45 static CPipeliningTestCase* NewL(CHTTPTestUtils& aTestUtils, CPipeliningTestParams& aPipeliningTestParams); |
|
46 ~CPipeliningTestCase(); |
|
47 |
|
48 private: |
|
49 CPipeliningTestCase(CHTTPTestUtils& aTestUtils, CPipeliningTestParams& aPipeliningTestParams); |
|
50 |
|
51 // From MPipeliningTestCase |
|
52 const TDesC& TestCaseName() const; |
|
53 TInt TransactionCount(TInt aConnIndex) const; |
|
54 TInt TotalTransactionCount() const; |
|
55 RHTTPTransaction GetTransactionL(TInt aIndex, RHTTPSession aSession, MHTTPTransactionCallback& aClient); |
|
56 const TDesC8& GetRawRequest(TInt aConnectionIndex, TInt aTransIndex); |
|
57 const TDesC8& GetRawResponse(TInt aConnectionIndex, TInt aTransIndex); |
|
58 TInt ConnectionCount() const; |
|
59 void AddConnectionCloseHeaderL(RHTTPTransaction aTransaction); |
|
60 TInt RealExpectedConnectionCount() const; |
|
61 TInt ExpectedError(RHTTPTransaction aTrans); |
|
62 void ProcessHeadersL(RHTTPTransaction aTrans); |
|
63 TBool EnableBatching() const; |
|
64 TBool BatchTransactions() const; |
|
65 void FieldCompareL(TInt aStringPool, TInt aIniFile); |
|
66 void FieldValueCompareL(RHTTPHeaders headers, TInt xyz, TInt xx, RStringF headerStr); |
|
67 TInt ErrorVal() const; |
|
68 |
|
69 TBool GetNextDataPart(TPtrC8& aDataPart); |
|
70 void ReleaseData(); |
|
71 TInt OverallDataSize(); |
|
72 TInt Reset(); |
|
73 private: |
|
74 CHTTPTestUtils& iTestUtils; |
|
75 CPipeliningTestParams& iPipeliningTestParams; |
|
76 |
|
77 //for testcase 7 |
|
78 RHTTPTransaction iTransToCancel; |
|
79 TBool iIsTransCancelled; |
|
80 TBool iBatchingBufferSizeSet; |
|
81 CHTTPFormEncoder* iFormEncoder; |
|
82 |
|
83 }; |
|
84 |
|
85 #endif // __CPIPELININGTESTCASE_H__ |