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 |
// TestStepPlayerPlay.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 <c32comm.h>
|
|
26 |
#include <f32file.h>
|
|
27 |
#include <testframework.h>
|
|
28 |
|
|
29 |
#include <mdaaudiosampleplayer.h>
|
|
30 |
|
|
31 |
|
|
32 |
// Test system includes
|
|
33 |
#include <testframework.h>
|
|
34 |
|
|
35 |
// Specific includes for this test suite
|
|
36 |
#include "TestStepUnitMMFAudClient.h"
|
|
37 |
#include "TestSuiteUnitMMFAudClient.h"
|
|
38 |
|
|
39 |
// Specific includes for these test steps
|
|
40 |
#include "TestStepPlayerNew.h"
|
|
41 |
|
|
42 |
#include "mmfclientaudioplayer.h"
|
|
43 |
|
|
44 |
// --------------------------------------------
|
|
45 |
|
|
46 |
/**
|
|
47 |
*
|
|
48 |
* Static constructor for CTestStepCheckHeaderTag.
|
|
49 |
*
|
|
50 |
*
|
|
51 |
* @return "CTestStepCheckHeaderTag*"
|
|
52 |
* The constructed CTestStepCheckHeaderTag
|
|
53 |
*
|
|
54 |
* @xxxx
|
|
55 |
*
|
|
56 |
*/
|
|
57 |
CTestStepCheckHeaderTag* CTestStepCheckHeaderTag::NewL()
|
|
58 |
{
|
|
59 |
CTestStepCheckHeaderTag* self = new(ELeave) CTestStepCheckHeaderTag;
|
|
60 |
return self;
|
|
61 |
}
|
|
62 |
|
|
63 |
/**
|
|
64 |
*
|
|
65 |
* Test step constructor.
|
|
66 |
* Each test step initialises its own name.
|
|
67 |
*
|
|
68 |
* @xxxx
|
|
69 |
*
|
|
70 |
*/
|
|
71 |
CTestStepCheckHeaderTag::CTestStepCheckHeaderTag()
|
|
72 |
{
|
|
73 |
iTestStepResult = EPass;
|
|
74 |
// store the name of this test case
|
|
75 |
// this is the name that is used by the script file
|
|
76 |
iTestStepName = _L("MM-MMF-ACLNT-U-0955-CP");
|
|
77 |
}
|
|
78 |
|
|
79 |
/**
|
|
80 |
*
|
|
81 |
* Test step destructor.
|
|
82 |
*
|
|
83 |
* @xxxx
|
|
84 |
*
|
|
85 |
*/
|
|
86 |
CTestStepCheckHeaderTag::~CTestStepCheckHeaderTag()
|
|
87 |
{
|
|
88 |
}
|
|
89 |
/**
|
|
90 |
* Implementation of the MMdaAudioPlayerCallback interface functions
|
|
91 |
**/
|
|
92 |
void CTestStepCheckHeaderTag::MapcInitComplete(TInt aError,
|
|
93 |
const TTimeIntervalMicroSeconds &/*aDuration*/)
|
|
94 |
{
|
|
95 |
iError = aError;
|
|
96 |
CActiveScheduler::Stop();
|
|
97 |
}
|
|
98 |
|
|
99 |
void CTestStepCheckHeaderTag::MapcPlayComplete(TInt aError)
|
|
100 |
{
|
|
101 |
iError = aError;
|
|
102 |
CActiveScheduler::Stop();
|
|
103 |
}
|
|
104 |
|
|
105 |
/**
|
|
106 |
*
|
|
107 |
* Test step Preamble.
|
|
108 |
*
|
|
109 |
* @xxxx
|
|
110 |
*
|
|
111 |
*/
|
|
112 |
enum TVerdict CTestStepCheckHeaderTag::DoTestStepPreambleL(void)
|
|
113 |
{
|
|
114 |
enum TVerdict verdict;
|
|
115 |
// this installs the scheduler
|
|
116 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
117 |
|
|
118 |
// Printing to the console and log file
|
|
119 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0955-CP"));
|
|
120 |
INFO_PRINTF1(_L("This test opens a file and checks for supported headertags at the start of the header"));
|
|
121 |
|
|
122 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioPlayFName11"), iFileName))
|
|
123 |
{
|
|
124 |
INFO_PRINTF1(_L("File name not found in INI file."));
|
|
125 |
return EInconclusive;
|
|
126 |
}
|
|
127 |
return verdict;
|
|
128 |
}
|
|
129 |
|
|
130 |
/**
|
|
131 |
*
|
|
132 |
* Do the test step.
|
|
133 |
* Each test step must supply an implementation for DoTestStepL.
|
|
134 |
*
|
|
135 |
* @return "TVerdict"
|
|
136 |
* The result of the test step
|
|
137 |
*
|
|
138 |
* @xxxx
|
|
139 |
*
|
|
140 |
*/
|
|
141 |
TVerdict CTestStepCheckHeaderTag::DoTestStepL()
|
|
142 |
{
|
|
143 |
iError = KErrNone;
|
|
144 |
iPlayer = CMMFMdaAudioPlayerUtility::NewFilePlayerL(iFileName, *this);
|
|
145 |
CActiveScheduler::Start();
|
|
146 |
User::After(1000000);
|
|
147 |
|
|
148 |
if (iPlayer == NULL)
|
|
149 |
{
|
|
150 |
INFO_PRINTF1(_L("Error initializing the player"));
|
|
151 |
return EInconclusive;
|
|
152 |
}
|
|
153 |
else if(iError != KErrNotSupported)
|
|
154 |
{
|
|
155 |
INFO_PRINTF2(_L("Returned with error %d which is unexpected"),iError);
|
|
156 |
return EFail;
|
|
157 |
}
|
|
158 |
|
|
159 |
INFO_PRINTF1(_L("The test checks for the headertag at the start of the header,hence fix for DEF056298"));
|
|
160 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
161 |
// test steps return a result
|
|
162 |
return iTestStepResult;
|
|
163 |
}
|
|
164 |
|
|
165 |
/**
|
|
166 |
*
|
|
167 |
* Test step Postamble.
|
|
168 |
*
|
|
169 |
* @xxxx
|
|
170 |
*
|
|
171 |
*/
|
|
172 |
enum TVerdict CTestStepCheckHeaderTag::DoTestStepPostambleL(void)
|
|
173 |
{
|
|
174 |
delete iPlayer;
|
|
175 |
iPlayer = NULL;
|
|
176 |
//[ Destroy the scheduler ]
|
|
177 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
178 |
}
|
|
179 |
|
|
180 |
|
|
181 |
|
|
182 |
|