1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmfintegrationtest/Ctlfrm/TSI_MmfCtlfrmStep.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,163 @@
1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef __TSI_MMFCTLFRMSTEP_H__
1.20 +#define __TSI_MMFCTLFRMSTEP_H__
1.21 +
1.22 +#include <testframework.h>
1.23 +#include <mmf/common/mmfcontroller.h>
1.24 +#include <mmf/server/mmffile.h>
1.25 +
1.26 +// Test controller/data plugin UIDs.
1.27 +// These are custom controllers provided by Integration Testing
1.28 +
1.29 +// dummy controller
1.30 +#define KTSIMmfControllerUid 0x101f7bfa
1.31 +#define KTSIMmfController2Uid 0x101f7bfc
1.32 +#define KTSIMmfDataSinkUid 0x101f7bfe
1.33 +#define KTSIMmfDataSourceUid 0x101f7c00
1.34 +
1.35 +#define KTextBufLen 64
1.36 +
1.37 +// priorities for controllers
1.38 +enum TTSIMmfPriority
1.39 + {
1.40 + ETSIMmfPriorityLow = 1,
1.41 + ETSIMmfPriorityHigh = 11
1.42 + };
1.43 +
1.44 +// -----------------------------------
1.45 +// RTestStepMmfCtlfrm, which is the base class for all
1.46 +// the MMF CTLFRM suite test steps.
1.47 +class RTestStepMmfCtlfrm : public RTestStep
1.48 + {
1.49 +public:
1.50 + RTestStepMmfCtlfrm();
1.51 + };
1.52 +
1.53 +// RTestStepMmfCtlfrmTest1
1.54 +// base class with preamble / postamble to open and close a test controller
1.55 +class RTestStepMmfCtlfrmTest1 : public RTestStepMmfCtlfrm
1.56 + {
1.57 +public:
1.58 + TVerdict OpenL();
1.59 + void Close();
1.60 +protected:
1.61 + RMMFController iController;
1.62 + TMMFPrioritySettings iSettings;
1.63 + };
1.64 +
1.65 +// RTestStepMmfCtlfrmTest2
1.66 +// base class with preamble / postamble to open and close a test controller 2
1.67 +class RTestStepMmfCtlfrmTest2 : public RTestStepMmfCtlfrm
1.68 + {
1.69 +public:
1.70 + TVerdict OpenL();
1.71 + void Close();
1.72 +protected:
1.73 + RMMFController iController;
1.74 + TMMFPrioritySettings iSettings;
1.75 + };
1.76 +
1.77 +// RTestStepMmfCtlfrmAudio
1.78 +// base class with preamble / postamble to open and close the audio controller
1.79 +// configured to receive events from the controlled
1.80 +class RTestStepMmfCtlfrmAudio : public RTestStepMmfCtlfrm
1.81 + {
1.82 +public:
1.83 + TVerdict OpenL();
1.84 + void Close();
1.85 +
1.86 +protected:
1.87 + //[ check if the event status is pending ]
1.88 + TBool IsTimeOut( TRequestStatus& aEventStatus );
1.89 + //[ cancel received events ]
1.90 + void CancelReceivedEvents();
1.91 + //[ is event sought the one we received ]
1.92 + TBool IsSoughtEvent( TMMFEvent& aExpectedEvent, TMMFEventPckg& receivedEvent );
1.93 + // [ search for expected event ]
1.94 + TVerdict SearchForEvent( TMMFEvent& aExpectedEvent );
1.95 +
1.96 +protected:
1.97 + RMMFController iController;
1.98 + TMMFPrioritySettings iSettings;
1.99 + RTimer iTimer ; // escape timer for waiting on events
1.100 + TMMFFileConfig iFileConfig; // audio file
1.101 + };
1.102 +
1.103 +// RTestStepMmfCtlfrmAudioPrimed
1.104 +// same as above, with source/sink handles, and is primed in the preamble
1.105 +class RTestStepMmfCtlfrmAudioPrimed : public RTestStepMmfCtlfrmAudio
1.106 + {
1.107 +public:
1.108 + TVerdict OpenL();
1.109 + void Close();
1.110 +
1.111 +protected:
1.112 + TMMFMessageDestination* iSourceHandlePtr;
1.113 + TMMFMessageDestination* iSinkHandlePtr;
1.114 + };
1.115 +
1.116 +// RTestStepMmfCtlfrmAudioNoSource
1.117 +// same as RTestStepMmfCtlfrmAudio, but has no source or sink loaded yet
1.118 +class RTestStepMmfCtlfrmAudioNoSource : public RTestStepMmfCtlfrmAudio
1.119 + {
1.120 +public:
1.121 + TVerdict OpenL();
1.122 + };
1.123 +
1.124 +// RTestStepMmfCtlfrmDualAudio
1.125 +// same as RTestStepMmfCtlfrmAudio, with 2 identical controllers
1.126 +class RTestStepMmfCtlfrmDualAudio : public RTestStepMmfCtlfrm
1.127 + {
1.128 +public:
1.129 + TVerdict OpenL();
1.130 + void Close();
1.131 +
1.132 +protected:
1.133 + //[ check if the event status is pending ]
1.134 + TBool IsTimeOut( TRequestStatus& aEventStatus );
1.135 + //[ cancel received events ]
1.136 + void CancelReceivedEvents( TInt aWhichController );
1.137 + //[ is event sought the one we received ]
1.138 + TBool IsSoughtEvent( TMMFEvent& aExpectedEvent, TMMFEventPckg& receivedEvent );
1.139 + // [ search for expected event ]
1.140 + TVerdict SearchForEvent( TMMFEvent& aExpectedEvent, TInt aWhichController );
1.141 +
1.142 +protected:
1.143 + RMMFController iController1;
1.144 + RMMFController iController2;
1.145 + TMMFPrioritySettings iSettings;
1.146 + RTimer iTimer ; // escape timer for waiting on events
1.147 + TMMFFileConfig iFileConfig1; // audio file
1.148 + TMMFFileConfig iFileConfig2; // audio file
1.149 + };
1.150 +
1.151 +// RTestStepMmfCtlfrmVideo
1.152 +// base class with preamble / postamble to open and close the video controller
1.153 +class RTestStepMmfCtlfrmVideo : public RTestStepMmfCtlfrm
1.154 + {
1.155 +public:
1.156 + TVerdict OpenL();
1.157 + void Close();
1.158 +
1.159 +protected:
1.160 + RMMFController iController;
1.161 + TMMFPrioritySettings iSettings;
1.162 + TMMFFileConfig iFileConfig; // video file
1.163 + };
1.164 +
1.165 +
1.166 +#endif // __TSI_MMFCTLFRMSTEP_H__