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