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 |
// This file contains an example Test step implementation
|
|
15 |
// This demonstrates the various functions provided
|
|
16 |
// by the CTestStep base class which are available within
|
|
17 |
// a test step
|
|
18 |
//
|
|
19 |
//
|
|
20 |
|
|
21 |
// EPOC includes
|
|
22 |
#include <e32base.h>
|
|
23 |
#include <e32test.h>
|
|
24 |
#include <e32keys.h>
|
|
25 |
#include <c32comm.h>
|
|
26 |
#include <f32file.h>
|
|
27 |
#include <etel.h>
|
|
28 |
#include <etelmm.h>
|
|
29 |
#include <testframework.h>
|
|
30 |
|
|
31 |
//#include <MdaAudioSamplePlayer.h>
|
|
32 |
#include <mdaaudiosampleeditor.h>
|
|
33 |
//#include <MdaAudioTonePlayer.h>
|
|
34 |
|
|
35 |
// Test system includes
|
|
36 |
#include <testframework.h>
|
|
37 |
|
|
38 |
// Specific includes for this test suite
|
|
39 |
#include "TestStepUnitMMFAudClient.h"
|
|
40 |
#include "TestSuiteUnitMMFAudClient.h"
|
|
41 |
|
|
42 |
// Specific includes for these test steps
|
|
43 |
#include "TestStepRecorder.h"
|
|
44 |
|
|
45 |
|
|
46 |
#include "MmfAudioController.h"
|
|
47 |
#include "mmfclientaudiorecorder.h"
|
|
48 |
//#include "MmfClientAudioPlayer.h"
|
|
49 |
//#include <mmffourcc.h>
|
|
50 |
//#include <mmfpaniccodes.h>
|
|
51 |
//#include <mmfFormatImplementationUIDs.hrh>
|
|
52 |
// --------------------------------------------
|
|
53 |
|
|
54 |
/**
|
|
55 |
*
|
|
56 |
* Static constructor for CTestStepRecorderSetPriority.
|
|
57 |
*
|
|
58 |
*
|
|
59 |
* @return "CTestStepRecorderSetPriority*"
|
|
60 |
* The constructed CTestStepRecorderSetPriority
|
|
61 |
*
|
|
62 |
* @xxxx
|
|
63 |
*
|
|
64 |
*/
|
|
65 |
CTestStepRecorderSetPriority* CTestStepRecorderSetPriority::NewL()
|
|
66 |
{
|
|
67 |
CTestStepRecorderSetPriority* self = new(ELeave) CTestStepRecorderSetPriority;
|
|
68 |
return self;
|
|
69 |
}
|
|
70 |
|
|
71 |
/**
|
|
72 |
*
|
|
73 |
* Test step constructor.
|
|
74 |
* Each test step initialises its own name.
|
|
75 |
*
|
|
76 |
* @xxxx
|
|
77 |
*
|
|
78 |
*/
|
|
79 |
CTestStepRecorderSetPriority::CTestStepRecorderSetPriority()
|
|
80 |
{
|
|
81 |
// store the name of this test case
|
|
82 |
// this is the name that is used by the script file
|
|
83 |
iTestStepName = _L("MM-MMF-ACLNT-U-0259-HP");
|
|
84 |
}
|
|
85 |
|
|
86 |
/**
|
|
87 |
*
|
|
88 |
* Test step destructor.
|
|
89 |
*
|
|
90 |
* @xxxx
|
|
91 |
*
|
|
92 |
*/
|
|
93 |
CTestStepRecorderSetPriority::~CTestStepRecorderSetPriority()
|
|
94 |
{
|
|
95 |
}
|
|
96 |
|
|
97 |
void CTestStepRecorderSetPriority::MoscoStateChangeEvent(CBase* /*aObject*/,
|
|
98 |
TInt /*aPreviousState*/,
|
|
99 |
TInt /*aCurrentState*/,
|
|
100 |
TInt aErrorcCode)
|
|
101 |
{
|
|
102 |
iError = aErrorcCode;
|
|
103 |
CActiveScheduler::Stop();
|
|
104 |
}
|
|
105 |
|
|
106 |
/**
|
|
107 |
*
|
|
108 |
* Do the test step.
|
|
109 |
* Each test step must supply an implementation for DoTestStepL.
|
|
110 |
*
|
|
111 |
* @return "TVerdict"
|
|
112 |
* The result of the test step
|
|
113 |
*
|
|
114 |
* @xxxx
|
|
115 |
*
|
|
116 |
*/
|
|
117 |
TVerdict CTestStepRecorderSetPriority::DoTestStepL()
|
|
118 |
{
|
|
119 |
iTestStepResult = EPass;
|
|
120 |
TInt err = KErrNone;
|
|
121 |
|
|
122 |
// Printing to the console and log file
|
|
123 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0259-HP"));
|
|
124 |
INFO_PRINTF1(_L("this is a test of CMdaAudioRecorderUtility::SetPriority() "));
|
|
125 |
|
|
126 |
__MM_HEAP_MARK;
|
|
127 |
TRAP( err, (iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this)) );
|
|
128 |
if (err != KErrNone)
|
|
129 |
return EInconclusive;
|
|
130 |
|
|
131 |
// test 1
|
|
132 |
iRecorder->SetPriority(EMdaPriorityMin, EMdaPriorityPreferenceTime);
|
|
133 |
|
|
134 |
TMMFPrioritySettings prior;
|
|
135 |
TInt err2 = GetAudRecorderPrioritySettings(iRecorder, prior);
|
|
136 |
if ( err != KErrNone ||
|
|
137 |
err2 != KErrNone ||
|
|
138 |
prior.iPriority != EMdaPriorityMin ||
|
|
139 |
prior.iPref != EMdaPriorityPreferenceTime)
|
|
140 |
return EFail;
|
|
141 |
else
|
|
142 |
iTestStepResult = EPass;
|
|
143 |
|
|
144 |
// try more values if there is some more time
|
|
145 |
|
|
146 |
delete iRecorder;
|
|
147 |
iRecorder = NULL;
|
|
148 |
__MM_HEAP_MARKEND;
|
|
149 |
|
|
150 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
151 |
// test steps return a result
|
|
152 |
return iTestStepResult;
|
|
153 |
}
|
|
154 |
|