|
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 CUPNPREQUESTPARSERTEST_H_ |
|
17 #define CUPNPREQUESTPARSERTEST_H_ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <http/mhttpdatasupplier.h> |
|
21 #include <http/framework/cheadercodec.h> |
|
22 //#include <es_mbuf.h> |
|
23 #include <comms-infras/rworkerlock.h> |
|
24 //#include <comms-infras/mbufmanager.h> |
|
25 #include <cflog.h> |
|
26 #include <rmemchunk.h> |
|
27 #include <cchunkmanager.h> |
|
28 |
|
29 #include "cupnpmessagetest.h" |
|
30 #include "mparserobserver.h" |
|
31 #include "cupnprequestparser.h" |
|
32 #include "CResponse.h" |
|
33 |
|
34 _LIT(KRequestParserTest, "RequestParserTest"); |
|
35 |
|
36 class CUpnpRequestParserTest: public CTestStep, |
|
37 public MParserObserver |
|
38 { |
|
39 public: // factory methods |
|
40 static CUpnpRequestParserTest* NewL(); |
|
41 CUpnpRequestParserTest(); |
|
42 ~CUpnpRequestParserTest(); |
|
43 |
|
44 private: // methods from MParserObserver |
|
45 virtual void GotBodyData(); |
|
46 virtual void DataParsed(); |
|
47 virtual void GotHeaders(); |
|
48 virtual void ParsingComplete(RMemChunk& aExcessData); |
|
49 virtual void ParserError(TInt aError); |
|
50 |
|
51 public: // methods from CTestStep |
|
52 TVerdict doTestStepPreambleL(); |
|
53 TVerdict doTestStepL(); |
|
54 TVerdict doTestStepPostambleL(); |
|
55 |
|
56 |
|
57 private: |
|
58 void NegateEscapeEncodeL(const TDesC& aDes); |
|
59 |
|
60 private: |
|
61 CUpnpRequestParser* iRequestParser; |
|
62 MHTTPDataSupplier* iDataSupplier; |
|
63 HBufC8* iDataChunk; |
|
64 TBool iNeedToParseExcessData; |
|
65 TPtrC8 iDataChunkPtr; |
|
66 CActiveScheduler* iSched; |
|
67 TInt iExpectedRequests; |
|
68 TInt iDataChunkCount; |
|
69 RPointerArray<HBufC8> iDataChunkArray; |
|
70 CRequest* iRequest; |
|
71 CHeaderCodec* iCodec; |
|
72 RStringPool iStringPool; |
|
73 CChunkManager* iMBufMgr; |
|
74 //MMBufSizeAllocator* iMBufSzAllctr; |
|
75 //RMBufChain iDataChunkChain; |
|
76 RMemChunk iDataChunkChain; |
|
77 TBuf8<KMaxMsgLen> iExcessData8; |
|
78 TBool iIsStarted; |
|
79 TInt iError; |
|
80 |
|
81 #ifdef __CFLOG_ACTIVE |
|
82 __CFLOG_DECLARATION_MEMBER; |
|
83 #endif |
|
84 }; |
|
85 |
|
86 #endif /*CUPNPREQUESTPARSERTEST_H_*/ |