0
|
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 |
// TestStepToneAllocFailNewPriorPref.cpp
|
|
15 |
// This file contains an example Test step implementation
|
|
16 |
// This demonstrates the various functions provided
|
|
17 |
// by the CTestStep base class which are available within
|
|
18 |
// a test step
|
|
19 |
//
|
|
20 |
//
|
|
21 |
|
|
22 |
// EPOC includes
|
|
23 |
#include <e32base.h>
|
|
24 |
#include <e32test.h>
|
|
25 |
#include <e32keys.h>
|
|
26 |
#include <c32comm.h>
|
|
27 |
#include <f32file.h>
|
|
28 |
#include <etel.h>
|
|
29 |
#include <etelmm.h>
|
|
30 |
#include <testframework.h>
|
|
31 |
|
|
32 |
#include <mdaaudiotoneplayer.h>
|
|
33 |
|
|
34 |
// Test system includes
|
|
35 |
#include <testframework.h>
|
|
36 |
|
|
37 |
// Specific includes for this test suite
|
|
38 |
#include "TestStepUnitMMFAudClient.h"
|
|
39 |
#include "TestSuiteUnitMMFAudClient.h"
|
|
40 |
|
|
41 |
// Specific includes for these test steps
|
|
42 |
#include "TestStepTone.h"
|
|
43 |
|
|
44 |
|
|
45 |
//#include <mmfaudiocontroller.h>
|
|
46 |
#include "mmfclienttoneplayer.h"
|
|
47 |
//#include "MmfClientAudioPlayer.h"
|
|
48 |
//#include <mmffourcc.h>
|
|
49 |
//#include <mmfpaniccodes.h>
|
|
50 |
//#include <mmfFormatImplementationUIDs.hrh>
|
|
51 |
// --------------------------------------------
|
|
52 |
|
|
53 |
/**
|
|
54 |
*
|
|
55 |
* Static constructor for CTestStepToneNewPriorPref.
|
|
56 |
*
|
|
57 |
*
|
|
58 |
* @return "CTestStepToneNewPriorPref*"
|
|
59 |
* The constructed CTestStepToneNewPriorPref
|
|
60 |
*
|
|
61 |
* @xxxx
|
|
62 |
*
|
|
63 |
*/
|
|
64 |
CTestStepToneNewPriorPref* CTestStepToneNewPriorPref::NewL()
|
|
65 |
{
|
|
66 |
CTestStepToneNewPriorPref* self = new(ELeave) CTestStepToneNewPriorPref;
|
|
67 |
return self;
|
|
68 |
}
|
|
69 |
|
|
70 |
/**
|
|
71 |
*
|
|
72 |
* Test step constructor.
|
|
73 |
* Each test step initialises its own name.
|
|
74 |
*
|
|
75 |
* @xxxx
|
|
76 |
*
|
|
77 |
*/
|
|
78 |
CTestStepToneNewPriorPref::CTestStepToneNewPriorPref() : iError(KErrNone)
|
|
79 |
{
|
|
80 |
// store the name of this test case
|
|
81 |
// this is the name that is used by the script file
|
|
82 |
iTestStepName = _L("MM-MMF-ACLNT-U-0453-HP");
|
|
83 |
}
|
|
84 |
|
|
85 |
/**
|
|
86 |
*
|
|
87 |
* Test step destructor.
|
|
88 |
*
|
|
89 |
* @xxxx
|
|
90 |
*
|
|
91 |
*/
|
|
92 |
CTestStepToneNewPriorPref::~CTestStepToneNewPriorPref()
|
|
93 |
{
|
|
94 |
}
|
|
95 |
|
|
96 |
void CTestStepToneNewPriorPref::MatoPrepareComplete(TInt aError)
|
|
97 |
{
|
|
98 |
iError = aError;
|
|
99 |
CActiveScheduler::Stop();
|
|
100 |
}
|
|
101 |
|
|
102 |
void CTestStepToneNewPriorPref::MatoPlayComplete(TInt aError)
|
|
103 |
{
|
|
104 |
iError = aError;
|
|
105 |
CActiveScheduler::Stop();
|
|
106 |
}
|
|
107 |
|
|
108 |
/**
|
|
109 |
*
|
|
110 |
* Do the test step.
|
|
111 |
* Each test step must supply an implementation for DoTestStepL.
|
|
112 |
*
|
|
113 |
* @return "TVerdict"
|
|
114 |
* The result of the test step
|
|
115 |
*
|
|
116 |
* @xxxx
|
|
117 |
*
|
|
118 |
*/
|
|
119 |
TVerdict CTestStepToneNewPriorPref::DoTestStepL()
|
|
120 |
{
|
|
121 |
iTestStepResult = EPass;
|
|
122 |
TInt err = KErrNone;
|
|
123 |
|
|
124 |
// Printing to the console and log file
|
|
125 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0453-HP"));
|
|
126 |
INFO_PRINTF1(_L("this is a test of CMMFMdaAudioToneUtility::NewL(<Priority and Preference>)"));
|
|
127 |
|
|
128 |
__MM_HEAP_MARK;
|
|
129 |
// test 1 //
|
|
130 |
TRAP( err, (iTone = CMMFMdaAudioToneUtility::NewL(*this, NULL, EMdaPriorityMin)) );
|
|
131 |
// check for error
|
|
132 |
if (err != KErrNone ||
|
|
133 |
iError != KErrNone ||
|
|
134 |
iTone->State() != EMdaAudioToneUtilityNotReady)
|
|
135 |
iTestStepResult = EFail;
|
|
136 |
delete iTone;
|
|
137 |
iTone = NULL;
|
|
138 |
// test 2 //
|
|
139 |
TRAP( err, (iTone = CMMFMdaAudioToneUtility::NewL(*this, NULL, EMdaPriorityMax)) );
|
|
140 |
// check for error
|
|
141 |
if (err != KErrNone ||
|
|
142 |
iError != KErrNone ||
|
|
143 |
iTone->State() != EMdaAudioToneUtilityNotReady)
|
|
144 |
iTestStepResult = EFail;
|
|
145 |
delete iTone;
|
|
146 |
iTone = NULL;
|
|
147 |
// test 3 //
|
|
148 |
TRAP( err, (iTone = CMMFMdaAudioToneUtility::NewL(*this, NULL, EMdaPriorityMin,
|
|
149 |
EMdaPriorityPreferenceTime)) );
|
|
150 |
// check for error
|
|
151 |
if (err != KErrNone ||
|
|
152 |
iError != KErrNone ||
|
|
153 |
iTone->State() != EMdaAudioToneUtilityNotReady)
|
|
154 |
iTestStepResult = EFail;
|
|
155 |
delete iTone;
|
|
156 |
iTone = NULL;
|
|
157 |
// test 4 //
|
|
158 |
TRAP( err, (iTone = CMMFMdaAudioToneUtility::NewL(*this, NULL, EMdaPriorityMin,
|
|
159 |
EMdaPriorityPreferenceQuality)) );
|
|
160 |
// check for error
|
|
161 |
if (err != KErrNone ||
|
|
162 |
iError != KErrNone ||
|
|
163 |
iTone->State() != EMdaAudioToneUtilityNotReady)
|
|
164 |
iTestStepResult = EFail;
|
|
165 |
delete iTone;
|
|
166 |
iTone = NULL;
|
|
167 |
// test 5 //
|
|
168 |
TRAP( err, (iTone = CMMFMdaAudioToneUtility::NewL(*this, NULL, EMdaPriorityMax,
|
|
169 |
EMdaPriorityPreferenceTime)) );
|
|
170 |
// check for error
|
|
171 |
if (err != KErrNone ||
|
|
172 |
iError != KErrNone ||
|
|
173 |
iTone->State() != EMdaAudioToneUtilityNotReady)
|
|
174 |
iTestStepResult = EFail;
|
|
175 |
delete iTone;
|
|
176 |
iTone = NULL;
|
|
177 |
// test 6 //
|
|
178 |
TRAP( err, (iTone = CMMFMdaAudioToneUtility::NewL(*this, NULL, EMdaPriorityMax,
|
|
179 |
EMdaPriorityPreferenceQuality)) );
|
|
180 |
// check for error
|
|
181 |
if (err != KErrNone ||
|
|
182 |
iError != KErrNone ||
|
|
183 |
iTone->State() != EMdaAudioToneUtilityNotReady)
|
|
184 |
iTestStepResult = EFail;
|
|
185 |
delete iTone;
|
|
186 |
iTone = NULL;
|
|
187 |
__MM_HEAP_MARKEND;
|
|
188 |
|
|
189 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
190 |
// test steps return a result
|
|
191 |
return iTestStepResult;
|
|
192 |
}
|
|
193 |
|