os/mm/mmlibs/mmfw/tsrc/mmfintegrationtest/Ctlfrm/TSI_MmfCtlfrmStep.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2002-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 __TSI_MMFCTLFRMSTEP_H__
    17 #define __TSI_MMFCTLFRMSTEP_H__
    18 
    19 #include <testframework.h>
    20 #include <mmf/common/mmfcontroller.h>
    21 #include <mmf/server/mmffile.h>
    22 
    23 // Test controller/data plugin UIDs.
    24 // These are custom controllers provided by Integration Testing
    25 
    26 // dummy controller
    27 #define KTSIMmfControllerUid                   0x101f7bfa
    28 #define KTSIMmfController2Uid                  0x101f7bfc
    29 #define KTSIMmfDataSinkUid					   0x101f7bfe
    30 #define KTSIMmfDataSourceUid                   0x101f7c00
    31 
    32 #define KTextBufLen	64
    33 
    34 // priorities for controllers
    35 enum TTSIMmfPriority
    36 	{
    37 	ETSIMmfPriorityLow = 1,
    38 	ETSIMmfPriorityHigh = 11
    39 	};
    40 
    41 // -----------------------------------
    42 // RTestStepMmfCtlfrm, which is the base class for all 
    43 // the MMF CTLFRM suite test steps.
    44 class RTestStepMmfCtlfrm : public RTestStep
    45 	{
    46 public:
    47 	RTestStepMmfCtlfrm();
    48 	};
    49 
    50 // RTestStepMmfCtlfrmTest1
    51 // base class with preamble / postamble to open and close a test controller
    52 class RTestStepMmfCtlfrmTest1 : public RTestStepMmfCtlfrm
    53 	{
    54 public:
    55 	TVerdict OpenL();
    56 	void Close();
    57 protected:
    58 	RMMFController iController;
    59 	TMMFPrioritySettings iSettings;
    60 	};
    61 
    62 // RTestStepMmfCtlfrmTest2
    63 // base class with preamble / postamble to open and close a test controller 2
    64 class RTestStepMmfCtlfrmTest2 : public RTestStepMmfCtlfrm
    65 	{
    66 public:
    67 	TVerdict OpenL();
    68 	void Close();
    69 protected:
    70 	RMMFController iController;
    71 	TMMFPrioritySettings iSettings;
    72 	};
    73 
    74 // RTestStepMmfCtlfrmAudio
    75 // base class with preamble / postamble to open and close the audio controller
    76 // configured to receive events from the controlled
    77 class RTestStepMmfCtlfrmAudio : public RTestStepMmfCtlfrm
    78 	{
    79 public:
    80 	TVerdict OpenL();
    81 	void Close();
    82 
    83 protected:
    84 	 //[ check if the event status is pending ]
    85 	 TBool IsTimeOut( TRequestStatus& aEventStatus );
    86 	 //[ cancel received events ]
    87 	 void  CancelReceivedEvents();
    88 	 //[ is event sought the one we received ] 
    89 	 TBool IsSoughtEvent( TMMFEvent& aExpectedEvent, TMMFEventPckg& receivedEvent );
    90 	 // [ search for expected event ]
    91 	 TVerdict SearchForEvent( TMMFEvent& aExpectedEvent );
    92 
    93 protected:
    94 	RMMFController		 iController;
    95 	TMMFPrioritySettings iSettings;
    96 	RTimer               iTimer     ; // escape timer for waiting on events  
    97 	TMMFFileConfig       iFileConfig; // audio file 
    98 	};
    99 	 
   100 // RTestStepMmfCtlfrmAudioPrimed
   101 // same as above, with source/sink handles, and is primed in the preamble
   102 class RTestStepMmfCtlfrmAudioPrimed : public RTestStepMmfCtlfrmAudio
   103 	{
   104 public:
   105 	TVerdict OpenL();
   106 	void Close();
   107 
   108 protected:
   109 	TMMFMessageDestination* iSourceHandlePtr;
   110 	TMMFMessageDestination* iSinkHandlePtr;
   111 	};
   112 	 
   113 // RTestStepMmfCtlfrmAudioNoSource
   114 // same as RTestStepMmfCtlfrmAudio, but has no source or sink loaded yet
   115 class RTestStepMmfCtlfrmAudioNoSource : public RTestStepMmfCtlfrmAudio
   116 	{
   117 public:
   118 	TVerdict OpenL();
   119 	};
   120 	 
   121 // RTestStepMmfCtlfrmDualAudio
   122 // same as RTestStepMmfCtlfrmAudio, with 2 identical controllers
   123 class RTestStepMmfCtlfrmDualAudio : public RTestStepMmfCtlfrm
   124 	{
   125 public:
   126 	TVerdict OpenL();
   127 	void Close();
   128 
   129 protected:
   130 	 //[ check if the event status is pending ]
   131 	 TBool IsTimeOut( TRequestStatus& aEventStatus );
   132 	 //[ cancel received events ]
   133 	 void  CancelReceivedEvents( TInt aWhichController );
   134 	 //[ is event sought the one we received ] 
   135 	 TBool IsSoughtEvent( TMMFEvent& aExpectedEvent, TMMFEventPckg& receivedEvent );
   136 	 // [ search for expected event ]
   137 	 TVerdict SearchForEvent( TMMFEvent& aExpectedEvent, TInt aWhichController );
   138 
   139 protected:
   140 	RMMFController		 iController1;
   141 	RMMFController		 iController2;
   142 	TMMFPrioritySettings iSettings;
   143 	RTimer               iTimer     ; // escape timer for waiting on events  
   144 	TMMFFileConfig       iFileConfig1; // audio file 
   145 	TMMFFileConfig       iFileConfig2; // audio file 
   146 	};
   147 
   148 // RTestStepMmfCtlfrmVideo
   149 // base class with preamble / postamble to open and close the video controller
   150 class RTestStepMmfCtlfrmVideo : public RTestStepMmfCtlfrm
   151 	{
   152 public:
   153 	TVerdict OpenL();
   154 	void Close();
   155 
   156 protected:
   157 	RMMFController		 iController;
   158 	TMMFPrioritySettings iSettings;
   159 	TMMFFileConfig       iFileConfig; // video file 
   160 	};
   161 	 
   162 
   163 #endif	// __TSI_MMFCTLFRMSTEP_H__