|
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 #include "CINC036384.h" |
|
17 #include "httptestutils.h" |
|
18 |
|
19 const TInt KTransactionCount = 1; |
|
20 const TInt KConnectionCount = 1; |
|
21 _LIT8(KTxtRawRequest, "GET / HTTP/1.1\r\nHost: 127.0.0.1\r\n\r\n"); |
|
22 _LIT8(KTxtRawResponse, "HTTP/1.1 200 OK \r\nTransfer-Encoding: chunked\r\n\r\n4\r\ntest\r\n4\r\ntest chunk that is bigger than the chunk size\r\n0\r\n\r\n"); |
|
23 |
|
24 CINC036384* CINC036384::NewL(CHTTPTestUtils& aTestUtils) |
|
25 { |
|
26 CINC036384* self = new (ELeave) CINC036384(aTestUtils); |
|
27 CleanupStack::PushL(self); |
|
28 self->ConstructL(); |
|
29 CleanupStack::Pop(self); |
|
30 return self; |
|
31 } |
|
32 |
|
33 CINC036384::CINC036384(CHTTPTestUtils& aTestUtils) |
|
34 : CPipeliningTestCase(), iTestUtils(aTestUtils) |
|
35 { |
|
36 } |
|
37 |
|
38 void CINC036384::ConstructL() |
|
39 { |
|
40 } |
|
41 |
|
42 CINC036384::~CINC036384() |
|
43 { |
|
44 } |
|
45 |
|
46 const TDesC& CINC036384::TestCaseName() const |
|
47 { |
|
48 _LIT(KTxtTitle, "Defect Fix INC036384"); |
|
49 return KTxtTitle(); |
|
50 } |
|
51 |
|
52 TInt CINC036384::TotalTransactionCount() const |
|
53 { |
|
54 return KTransactionCount; |
|
55 //return 100; |
|
56 } |
|
57 |
|
58 TInt CINC036384::ConnectionCount() const |
|
59 { |
|
60 return KConnectionCount; |
|
61 //return 0; |
|
62 } |
|
63 |
|
64 RHTTPTransaction CINC036384::GetTransactionL(TInt aIndex, RHTTPSession aSession, MHTTPTransactionCallback& aClient) |
|
65 { |
|
66 __ASSERT_ALWAYS(aIndex<KTransactionCount, User::Invariant()); |
|
67 |
|
68 RStringF method = aSession.StringPool().StringF(HTTP::EGET,RHTTPSession::GetTable()); |
|
69 _LIT8(KTxtUri, "http://127.0.0.1"); |
|
70 //_LIT8(KTxtUri, "http://www.cnn.com"); |
|
71 TUriParser8 uri; |
|
72 uri.Parse(KTxtUri()); |
|
73 return aSession.OpenTransactionL(uri, aClient, method); |
|
74 } |
|
75 |
|
76 const TDesC8& CINC036384::GetRawRequest(TInt aConnectionIndex, TInt aTransIndex) |
|
77 { |
|
78 __ASSERT_ALWAYS( (aTransIndex<KTransactionCount) && (aConnectionIndex < KConnectionCount), User::Invariant()); |
|
79 |
|
80 return KTxtRawRequest(); |
|
81 } |
|
82 |
|
83 const TDesC8& CINC036384::GetRawResponse(TInt aConnectionIndex, TInt aTransIndex) |
|
84 { |
|
85 __ASSERT_ALWAYS( (aTransIndex<KTransactionCount) && (aConnectionIndex < KConnectionCount), User::Invariant()); |
|
86 |
|
87 return KTxtRawResponse(); |
|
88 } |