applayerprotocols/httptransportfw/Test/T_HttpOnline/cinc120672.h
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 // Copyright (c) 2008-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 #ifndef __CINC120672_H__
       
    17 #define __CINC120672_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <http.h>
       
    21 #include <http/mhttpauthenticationcallback.h>
       
    22 #include "HttpTestCore.h"
       
    23 
       
    24 
       
    25 class CHTTPTestUtils;
       
    26 class CScriptFile;
       
    27 class CHttpTimer1;
       
    28 
       
    29 class MTestClient1
       
    30    {
       
    31 public:     
       
    32    virtual void Timedout()=0;	   
       
    33    };
       
    34 
       
    35 /*	
       
    36 Test case for defect fix INC120672. 
       
    37 */
       
    38 
       
    39 class CINC120672_1 :public CHttpTestTransBase, public MHTTPTransactionCallback,
       
    40                     public MHTTPAuthenticationCallback,public MTestClient1
       
    41 	{
       
    42 public:
       
    43 	static CINC120672_1* NewL(TInt aTestNumber, CScriptFile* aIniSettingsFile);
       
    44 	virtual ~CINC120672_1();
       
    45 	void MHFRunL(RHTTPTransaction aTransaction,const THTTPEvent& aEvent) ;
       
    46 	virtual void Timedout();
       
    47 	TInt MHFRunError(TInt aError, RHTTPTransaction aTransaction,
       
    48 							 const THTTPEvent& aEvent) ;
       
    49 	// method inherited from MHTTPAuthenticationCallback
       
    50 	virtual TBool GetCredentialsL(const TUriC8& aURI, RString aRealm, 
       
    51 								 RStringF aAuthenticationType,
       
    52 								 RString& aUsername, 
       
    53 								 RString& aPassword);							 
       
    54 
       
    55 private:
       
    56 	CINC120672_1(TInt aTestNumber, CScriptFile* aIniSettingsFile);
       
    57 	const TDesC& TestName();
       
    58 	virtual void DoRunL();
       
    59 	virtual TInt RunError(TInt aErr);	
       
    60 	virtual void DoCancel();
       
    61 		
       
    62 private:
       
    63 	/** This has the instance of the settings.ini file.  This instance is passed
       
    64 	 to ReplaceHostNameL() function which uses this instance to retrieve the
       
    65 	 data from settings.ini file.
       
    66 	 */
       
    67 	CScriptFile* iIniSettingsFile;
       
    68 		
       
    69 protected:
       
    70 
       
    71     TInt iOpenTransactionCount;
       
    72     TInt iFailureError;
       
    73     TInt iTestNumber;
       
    74  
       
    75 	};
       
    76 	
       
    77 	
       
    78 class CINC120672_2 : public CHttpTestTransBase,public MHTTPTransactionCallback,
       
    79                      public MHTTPAuthenticationCallback,public MTestClient1
       
    80      {
       
    81 public:
       
    82      static CINC120672_2* NewL(TInt aTestNumber, CScriptFile* aIniSettingsFile);
       
    83      virtual ~CINC120672_2();
       
    84      void MHFRunL(RHTTPTransaction aTransaction,const THTTPEvent& aEvent) ;
       
    85      virtual void Timedout();
       
    86      TInt MHFRunError(TInt aError, RHTTPTransaction aTransaction,const THTTPEvent& aEvent) ;
       
    87      // method inherited from MHTTPAuthenticationCallback
       
    88      virtual TBool GetCredentialsL(const TUriC8& aURI, RString aRealm, 
       
    89 			                       RStringF aAuthenticationType,
       
    90 			                       RString& aUsername, 
       
    91 			                       RString& aPassword);							 
       
    92 
       
    93 private:	 
       
    94       CINC120672_2(TInt aTestNumber, CScriptFile* aIniSettingsFile);
       
    95 	  const TDesC& TestName();
       
    96 	  virtual void DoRunL();
       
    97 	  virtual TInt RunError(TInt aErr);	
       
    98 	  virtual void DoCancel();
       
    99 	 
       
   100 private:
       
   101 	   /**This has the instance of the settings.ini file.  This instance is passed
       
   102 	    to ReplaceHostNameL() function which uses this instance to retrieve the
       
   103 		data from settings.ini file.
       
   104 	    */			
       
   105 	 CScriptFile* iIniSettingsFile;
       
   106 
       
   107 
       
   108 protected:
       
   109 
       
   110 			TInt iOpenTransactionCount;
       
   111 			TInt iFailureError;
       
   112 			TInt iTestNumber;
       
   113 
       
   114 };	
       
   115 
       
   116 class CHttpTimer1: public CActive
       
   117 	{
       
   118 public:
       
   119 	    CHttpTimer1(MTestClient1& aClient);
       
   120 		~CHttpTimer1();
       
   121 		void After(TTimeIntervalMicroSeconds32 anInterval);
       
   122 		void DoCancel();
       
   123 		void RunL();
       
   124 		
       
   125 private:
       
   126 	    RTimer iTimer;
       
   127 		MTestClient1& iClient;	
       
   128 	};
       
   129 
       
   130 	
       
   131 #endif // __CINC120672_H__