|
1 // Copyright (c) 2001-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 |
|
17 #ifndef __CHTTPACCEPTTESTBASE_H__ |
|
18 #define __CHTTPACCEPTTESTBASE_H__ |
|
19 |
|
20 #include "HttpTestCore.h" |
|
21 #include <http.h> |
|
22 #include "testservers.h" |
|
23 #include "TestScripts.h" |
|
24 |
|
25 /** CHttpAcceptTestBase includes common code for all acceptance tests which usdes |
|
26 a .ini file to set the test parameters |
|
27 Its abstract as TestName, OpenTestSessionL,CloseTestSession must be overloaded in |
|
28 the derived test class |
|
29 */ |
|
30 class CHttpAcceptTestBase: public CHttpTestTransBase, public MHTTPTransactionCallback |
|
31 { |
|
32 //to implement in this class' member functs definitions |
|
33 public: |
|
34 CHttpAcceptTestBase(); |
|
35 virtual void MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent); |
|
36 virtual TInt MHFRunError(TInt aError,RHTTPTransaction aTransaction, const THTTPEvent& aEvent); |
|
37 |
|
38 virtual ~CHttpAcceptTestBase(); |
|
39 static void Cleanup ( TAny* aPtr ); |
|
40 protected: |
|
41 virtual void DoRunL(); |
|
42 virtual TInt RunError(TInt aErr); |
|
43 virtual void DoCancel(); |
|
44 virtual const TDesC& TestName() =0; |
|
45 virtual void OpenTestSessionL()=0; |
|
46 virtual void CloseTestSession() =0; |
|
47 void CompleteOwnRequest(); |
|
48 |
|
49 private: |
|
50 void Validate(RHTTPTransaction aTransaction); |
|
51 |
|
52 protected: |
|
53 TBuf<80> iTestName; |
|
54 CScriptFile* iIniFile; |
|
55 TInt iSectionNumber; |
|
56 TInt iOpenTransactionCount; |
|
57 TInt iExpectedError; |
|
58 TInt iExpectedNumberRedirects; |
|
59 TBool iExpectError; |
|
60 }; |
|
61 |
|
62 #endif |
|
63 |