|
1 // Copyright (c) 2005-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 "CINC077703.h" |
|
17 |
|
18 const TInt KTransactionCount = 1; |
|
19 const TInt KConnectionCount = 1; |
|
20 _LIT8(KTxtRawRequest, "GET / HTTP/1.1\r\nHost: 127.0.0.1\r\n\r\n"); |
|
21 _LIT8(KTxtRawResponse, "HTTP/1.0 302 Moved\nStatus: 302 Moved\nPragma: no-cache\nLocation: http://127.0.0.1\n"); |
|
22 _LIT8(KTxtRawResponse1, "HTTP/1.0 200 OK\nContent-Length: 12\n\nHello world!"); |
|
23 |
|
24 CINC077703* CINC077703::NewL(CHTTPTestUtils& aTestUtils) |
|
25 { |
|
26 CINC077703* self = new (ELeave) CINC077703(aTestUtils); |
|
27 return self; |
|
28 } |
|
29 |
|
30 CINC077703::~CINC077703() |
|
31 { |
|
32 |
|
33 } |
|
34 |
|
35 CINC077703::CINC077703(CHTTPTestUtils& aTestUtils) |
|
36 : CPipeliningTestCase(), iTestUtils(aTestUtils) |
|
37 { |
|
38 |
|
39 } |
|
40 |
|
41 |
|
42 |
|
43 const TDesC& CINC077703::TestCaseName() const |
|
44 { |
|
45 _LIT(KTxtTitle, "Defect Fix CINC077703"); |
|
46 return KTxtTitle(); |
|
47 } |
|
48 |
|
49 TInt CINC077703::TotalTransactionCount() const |
|
50 { |
|
51 return KTransactionCount; |
|
52 } |
|
53 |
|
54 TInt CINC077703::ConnectionCount() const |
|
55 { |
|
56 return KConnectionCount; |
|
57 } |
|
58 |
|
59 RHTTPTransaction CINC077703::GetTransactionL(TInt aIndex, RHTTPSession aSession, MHTTPTransactionCallback& aClient) |
|
60 { |
|
61 __ASSERT_ALWAYS(aIndex<KTransactionCount, User::Invariant()); |
|
62 |
|
63 RStringF method = aSession.StringPool().StringF(HTTP::EGET,RHTTPSession::GetTable()); |
|
64 _LIT8(KTxtUri, "http://127.0.0.1"); |
|
65 TUriParser8 uri; |
|
66 uri.Parse(KTxtUri()); |
|
67 return aSession.OpenTransactionL(uri, aClient, method); |
|
68 } |
|
69 |
|
70 const TDesC8& CINC077703::GetRawRequest( TInt aConnectionIndex, TInt aTransIndex ) |
|
71 { |
|
72 __ASSERT_ALWAYS( (aTransIndex<KTransactionCount) && (aConnectionIndex <= KConnectionCount), User::Invariant()); |
|
73 |
|
74 return KTxtRawRequest(); |
|
75 } |
|
76 |
|
77 const TDesC8& CINC077703::GetRawResponse(TInt aConnectionIndex, TInt aTransIndex) |
|
78 { |
|
79 __ASSERT_ALWAYS( (aTransIndex<KTransactionCount) && (aConnectionIndex <= KConnectionCount), User::Invariant()); |
|
80 if ( aConnectionIndex == 0 ) |
|
81 return KTxtRawResponse(); |
|
82 else |
|
83 return KTxtRawResponse1(); |
|
84 } |
|
85 |
|
86 |
|
87 |