Update contrib.
1 // Copyright (c) 2007-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 the License "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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Defines the basic test step for the Streaming CAF test harness
27 #include <test/testexecutestepbase.h>
28 #include <caf/streaming/keystreamdecoder.h>
29 #include "testagentkeystreamdecoder.h"
30 #include "testsingleprocesskeystreamdecoder.h"
31 #include "testkeystreamsink.h"
32 #include "srarightsobject.h"
33 #include "tscafserver.h"
34 #include "tscafdefs.h"
38 using namespace StreamAccess;
44 * Data storage class containing the information about a single SDP Attribute
52 TPtrC iAttributeValue;
56 class CTestDecoderConfiguration : public CBase
58 * Container class storing the parameters and attributes retreived from the configuration file
59 * that are required to construct a key stream decoder object
63 static CTestDecoderConfiguration* NewLC();
64 ~CTestDecoderConfiguration();
66 TBool iSingleProcessAgent;
67 TPtrC iPrivateFolderPath;
72 TPtrC iConnAddr; ///< SDP connection field's IP address
74 // Array of sdp meta data attributes
75 RArray<TSdpAttribute> iAttributeArray;
78 CTestDecoderConfiguration();
82 class TExpectedKeyStreamDecoderAttributes
85 * Data storage class containing expected values for the attributes associated to a particular
89 TExpectedKeyStreamDecoderAttributes();
91 TBool IsProgramProtected;
92 TBool IsServiceProtected;
94 TBool MustProtectIfRecording;
98 TPtrC RightsIssuerUri;
102 class CScafStep : public CTestStep
104 Base class used to provide handy functions available to test step classes.
108 virtual ~CScafStep();
110 TVerdict doTestStepPreambleL();
111 TVerdict doTestStepL();
112 TVerdict doTestStepPostambleL();
113 void CleanAgentsPrivateFolderL(const TDesC& aPrivatePath);
114 CSdpDocument* CreateSdpDocumentLC();
115 CSdpMediaField* CreateSdpLC(TInt aSdpNum);
116 void AddMediaFieldL(CSdpDocument& aSdpDoc, const CSdpMediaField* aSdpKeyStream);
117 CKeyStreamSink* CreateKeyStreamSinkLC(const TDesC& aFilePath, const TDesC& aPrivPath);
118 void CopyFile2AgentsPrivateFolderL(RFs& aFs, const TDesC& aFileName, const TDesC& aPrivPath);
119 HBufC* GetFullPathLC(const TDesC& aPath, const TDesC& aFileName);
120 CSraRightsObject* GetRightsObjectLC(const TDesC& aName, const TDesC& aPrivPath);
121 void ReadTestConfigurationL();
122 TBool CheckKeyStreamDecoderAttributesL(const CKeyStreamDecoder& aDecoder,
123 const TExpectedKeyStreamDecoderAttributes& aExpectedData);
126 CScafStep(CScafServer& aParent);
127 TPtr8 Convert16To8LC(TDesC& aDes);
128 TVerdict doOOMTestL();
129 virtual TVerdict doTestL();
130 TBool CompareBooleanAttributeL(const CKeyStreamDecoder& aDecoder,
131 const TAttribute& aAttributeEnum,
132 const TDesC& aAttributeDescription,
133 const TBool aExpectedValue);
134 TBool CompareStringAttributeL(const CKeyStreamDecoder& aDecoder,
135 const TStringAttribute& aAttributeEnum,
136 const TDesC& aAttributeDescription,
137 const TDesC& aExpectedValue);
140 void AddAttributes2SdpL(CSdpMediaField& aSdp, TInt aSdpNum);
141 void PrintErrorAndLeaveL(TDesC& aKey);
142 static void DeleteSdpDocAndCloseCodecPool(TAny* aSdpDoc);
145 CScafServer& iParent;
148 RPointerArray<CTestDecoderConfiguration> iDecoderConfigurationArray;
149 RArray<TExpectedKeyStreamDecoderAttributes> iExpectedKeyStreamDecoderData;
152 CActiveScheduler *iActiveScheduler;
154 #endif /*TSCAFSTEP_H_*/