|
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 #include "Iter5Chunked2.h" |
|
17 #include <http.h> |
|
18 |
|
19 CHttpTestCaseIter5Chunked2::CHttpTestCaseIter5Chunked2(CScriptFile* aIniSettingsFile) : |
|
20 CHttpTestChunkedBase() |
|
21 { |
|
22 iIniSettingsFile = aIniSettingsFile; |
|
23 } |
|
24 |
|
25 const TDesC& CHttpTestCaseIter5Chunked2::TestName() |
|
26 { |
|
27 _LIT(KHeaderTestName,"Iteration 5 Chunked 2 "); |
|
28 return KHeaderTestName; |
|
29 } |
|
30 |
|
31 TInt CHttpTestCaseIter5Chunked2::OverallDataSize() |
|
32 { |
|
33 return 9; |
|
34 } |
|
35 |
|
36 TBool CHttpTestCaseIter5Chunked2::GetNextDataPart(TPtrC8& aDataChunk) |
|
37 { |
|
38 _LIT8(KHttpPostBodyChunk1,"ABC"); |
|
39 _LIT8(KHttpPostBodyChunk2,"DEF"); |
|
40 _LIT8(KHttpPostBodyChunk3,"GHJ"); |
|
41 |
|
42 TBool retVal = EFalse; |
|
43 switch (iReqBodyChunkCount) |
|
44 { |
|
45 case 0: |
|
46 { |
|
47 aDataChunk.Set(KHttpPostBodyChunk1()); |
|
48 } break; |
|
49 case 1: |
|
50 { |
|
51 aDataChunk.Set(KHttpPostBodyChunk2()); |
|
52 } break; |
|
53 case 2: |
|
54 { |
|
55 aDataChunk.Set(KNullDesC8); |
|
56 } break; |
|
57 case 3: |
|
58 { |
|
59 aDataChunk.Set(KHttpPostBodyChunk3()); |
|
60 } break; |
|
61 case 4: |
|
62 { |
|
63 aDataChunk.Set(KNullDesC8); |
|
64 iLastChunk = ETrue; |
|
65 retVal = ETrue; |
|
66 } break; |
|
67 } |
|
68 return retVal; |
|
69 } |