sl@0
|
1 |
// Copyright (c) 2004-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 |
#include "TestPlayerUtils.h"
|
sl@0
|
17 |
#include "OpenFileByHandle7804.h"
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <caf/caf.h>
|
sl@0
|
20 |
|
sl@0
|
21 |
CTestMmfAclntOpenFile7804::CTestMmfAclntOpenFile7804(const TDesC& aTestName, const TDesC& aSectName)
|
sl@0
|
22 |
: CTestMmfAclntAudioPlayerUtil(aTestName, aSectName)
|
sl@0
|
23 |
{}
|
sl@0
|
24 |
|
sl@0
|
25 |
CTestMmfAclntOpenFile7804* CTestMmfAclntOpenFile7804::NewL(const TDesC& aTestName, const TDesC& aSectName)
|
sl@0
|
26 |
{
|
sl@0
|
27 |
CTestMmfAclntOpenFile7804* self = new (ELeave) CTestMmfAclntOpenFile7804(aTestName, aSectName);
|
sl@0
|
28 |
return self;
|
sl@0
|
29 |
}
|
sl@0
|
30 |
|
sl@0
|
31 |
/**
|
sl@0
|
32 |
* Open new file.
|
sl@0
|
33 |
*/
|
sl@0
|
34 |
TVerdict CTestMmfAclntOpenFile7804::DoTestL(CMdaAudioPlayerUtility* aPlayer)
|
sl@0
|
35 |
{
|
sl@0
|
36 |
return( PerformTestL( aPlayer ) );
|
sl@0
|
37 |
}
|
sl@0
|
38 |
|
sl@0
|
39 |
TVerdict CTestMmfAclntOpenFile7804::PerformTestL(CMdaAudioPlayerUtility* aPlayer)
|
sl@0
|
40 |
{
|
sl@0
|
41 |
INFO_PRINTF1( _L("TestPlayerUtils : OpenFileL(RFile&)/Play"));
|
sl@0
|
42 |
|
sl@0
|
43 |
TVerdict ret = EFail;
|
sl@0
|
44 |
iError = KErrNone;
|
sl@0
|
45 |
|
sl@0
|
46 |
RFs fs;
|
sl@0
|
47 |
|
sl@0
|
48 |
User::LeaveIfError(fs.Connect());
|
sl@0
|
49 |
CleanupClosePushL(fs);
|
sl@0
|
50 |
User::LeaveIfError(fs.ShareProtected());
|
sl@0
|
51 |
|
sl@0
|
52 |
TBuf<KSizeBuf> filename;
|
sl@0
|
53 |
TPtrC filename1;
|
sl@0
|
54 |
RFile file;
|
sl@0
|
55 |
|
sl@0
|
56 |
if(!GetStringFromConfig(_L("SectionOne"), _L("PCMU16BE"), filename1))
|
sl@0
|
57 |
{
|
sl@0
|
58 |
return EInconclusive;
|
sl@0
|
59 |
}
|
sl@0
|
60 |
|
sl@0
|
61 |
GetDriveName(filename);
|
sl@0
|
62 |
filename.Append(filename1);
|
sl@0
|
63 |
|
sl@0
|
64 |
User::LeaveIfError( file.Open( fs, filename, EFileRead ) );
|
sl@0
|
65 |
CleanupClosePushL(file);
|
sl@0
|
66 |
|
sl@0
|
67 |
aPlayer->OpenFileL(file);
|
sl@0
|
68 |
CActiveScheduler::Start();
|
sl@0
|
69 |
|
sl@0
|
70 |
if (iError == KErrNone)
|
sl@0
|
71 |
{
|
sl@0
|
72 |
aPlayer->Play();
|
sl@0
|
73 |
CActiveScheduler::Start();
|
sl@0
|
74 |
}
|
sl@0
|
75 |
|
sl@0
|
76 |
if (iError == KErrNone)
|
sl@0
|
77 |
{
|
sl@0
|
78 |
ret = EPass;
|
sl@0
|
79 |
}
|
sl@0
|
80 |
|
sl@0
|
81 |
aPlayer->Close();
|
sl@0
|
82 |
CleanupStack::PopAndDestroy(2, &fs);
|
sl@0
|
83 |
|
sl@0
|
84 |
return ret;
|
sl@0
|
85 |
}
|