|
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 // Author: Franco.Bellu@symbian.com |
|
15 // |
|
16 // |
|
17 |
|
18 |
|
19 #ifndef __TC11_H__ |
|
20 #define __TC11_H__ |
|
21 |
|
22 #include "HttpTestCore.h" |
|
23 #include <http.h> |
|
24 #include "csrvaddrval.h" |
|
25 |
|
26 /** |
|
27 * BEHAVIOR TO TEST: The VF to generate an error Event(with negative iStatus). |
|
28 * This can happen as a consequence of either |
|
29 * 1)response headers present in the request or |
|
30 * 2)entity headers present in the request when no body is present. |
|
31 * The DoRunL() function simulates this 2 situation in sequence(each one |
|
32 * opening and closing a Session). |
|
33 * ADDITIONAL BEHAVIOR TO TEST : Fix the problem removing the erroneous |
|
34 * headers and send then a ESuceeded |
|
35 * message (the problem has been fixed and the transaction can complete |
|
36 * normally ) |
|
37 * 1) TRANSACTION: POST with erroneous response header 'Server: 11.111.1.1'. |
|
38 * The MHFRunL() should log the KErrHttpWrongRespHeaderInReqServer error |
|
39 * status message issued by the VF |
|
40 * just after the submission, and log the fact that the Server header has been |
|
41 * removed after |
|
42 * the removal of the Server header.Then ESuceeded is logged. |
|
43 * 2) TRANSACTION: GET with no body(as it should be) but with an entity |
|
44 * header:'Content-Length:6'. |
|
45 * The MHFRunL() should log the KErrHttpEntityHeaderWithoutBodyContentLength |
|
46 * error status message issued by the VF |
|
47 * just after the submission, and log the fact that the Content_Length header |
|
48 * has been removed. |
|
49 * Then ESuceeded is logged. |
|
50 * NB: For the purpose of this test case the content of the headers and the |
|
51 * body won't be showed. |
|
52 * |
|
53 * Also, Tests Multiple HTTP connections over default bearer |
|
54 */ |
|
55 |
|
56 class CHttpTestCase11: public CHttpTestTransBase, public MHTTPTransactionCallback |
|
57 { |
|
58 //to implement in this class' member functs definitions |
|
59 public: |
|
60 CHttpTestCase11(CScriptFile* aIniSettingsFile); |
|
61 virtual ~CHttpTestCase11(); |
|
62 |
|
63 virtual void MHFRunL(RHTTPTransaction aTransaction, |
|
64 const THTTPEvent& aEvent) ; |
|
65 virtual TInt MHFRunError(TInt aError,RHTTPTransaction aTransaction, |
|
66 const THTTPEvent& aEvent); |
|
67 private: |
|
68 const TDesC& TestName(); |
|
69 virtual void DoRunL(); |
|
70 virtual TInt RunError(TInt aErr); |
|
71 virtual void DoCancel(); |
|
72 void OpenTestSession1L(); |
|
73 void CloseTestSession1(); |
|
74 void OpenTestSession2L(); |
|
75 void CloseTestSession2(); |
|
76 // virtual const TDesC& TestName(); |
|
77 protected: |
|
78 void CompleteOwnRequest(); |
|
79 private: |
|
80 RHTTPSession iSession1; |
|
81 RHTTPSession iSession2; |
|
82 RHTTPTransaction iTransaction1; |
|
83 RHTTPTransaction iTransaction2; |
|
84 RStringF iIpAddr; |
|
85 RStringF iServer; |
|
86 /** This has the instance of the settings.ini file. This instance is passed |
|
87 to ReplaceHostNameL() function which uses this instance to retrieve the |
|
88 data from settings.ini file. |
|
89 */ |
|
90 CScriptFile* iIniSettingsFile; |
|
91 }; |
|
92 |
|
93 |
|
94 #endif |