servicediscoveryandcontrol/pnp/test/upnp/unittests/upnpmessagetest/inc/ccodecdecodetest.h
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     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 CCODECDECODETEST_H_
       
    17 #define CCODECDECODETEST_H_
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <stringpool.h>
       
    21 #include <inetprottextutils.h>
       
    22 #include <utf.h>
       
    23 #include <httpstringconstants.h>
       
    24 #include <http/thttptable.h>
       
    25 #include <http/framework/cheadercodec.h>
       
    26 
       
    27 #include "cupnpmessagetest.h"
       
    28 #include "mparserobserver.h"
       
    29 #include "cupnpresponseparser.h"
       
    30 #include "cupnprequestparser.h"
       
    31 #include "rhttpheaders.h"
       
    32 #include "CResponse.h"
       
    33 #include "CRequest.h"
       
    34 
       
    35 
       
    36 _LIT(KCodecDecodeTest, "CodecDecodeTest");
       
    37 
       
    38 class CCodecDecodeTest: public CTestStep,
       
    39 						public MParserObserver
       
    40 	{
       
    41 public:
       
    42 	static CCodecDecodeTest* NewL();
       
    43 	CCodecDecodeTest();
       
    44 	~CCodecDecodeTest();
       
    45 
       
    46 public:
       
    47 	TVerdict doTestStepPreambleL();
       
    48 	TVerdict doTestStepL();
       
    49 	TVerdict doTestStepPostambleL();
       
    50 
       
    51 private:
       
    52 	void ConstructHeadersL(const TInt aNoOfHdrValPairs);
       
    53 	void SetHeaderL(const TDesC8& aHeader, const TDesC8& aValue);
       
    54 	void GetFieldL();
       
    55 
       
    56 private:	// methods from MParserObserver
       
    57 	virtual void GotBodyData();
       
    58 	virtual void DataParsed();
       
    59 	virtual void GotHeaders();
       
    60 	virtual void ParsingComplete(RMemChunk& aExcessData);
       
    61 	virtual void ParserError(TInt aError);
       
    62 
       
    63 private:
       
    64 	CUpnpResponseParser*			iRespParser;
       
    65 	CUpnpRequestParser*				iReqParser;
       
    66 	CActiveScheduler*				iSched;
       
    67 	RStringPool						iPool;
       
    68 	RHTTPHeaders					iRHeaders;
       
    69 	CRequest*						iRequest;
       
    70 	CResponse*						iResponse;
       
    71 	CHeaderCodec*					iCodec;
       
    72 	};
       
    73 
       
    74 #endif /*CCODECDECODETEST_H_*/