1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmfintegrationtest/ACLNT/OpenFileByHandle7804.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,85 @@
1.4 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#include "TestPlayerUtils.h"
1.20 +#include "OpenFileByHandle7804.h"
1.21 +
1.22 +#include <caf/caf.h>
1.23 +
1.24 +CTestMmfAclntOpenFile7804::CTestMmfAclntOpenFile7804(const TDesC& aTestName, const TDesC& aSectName)
1.25 + : CTestMmfAclntAudioPlayerUtil(aTestName, aSectName)
1.26 + {}
1.27 +
1.28 +CTestMmfAclntOpenFile7804* CTestMmfAclntOpenFile7804::NewL(const TDesC& aTestName, const TDesC& aSectName)
1.29 + {
1.30 + CTestMmfAclntOpenFile7804* self = new (ELeave) CTestMmfAclntOpenFile7804(aTestName, aSectName);
1.31 + return self;
1.32 + }
1.33 +
1.34 +/**
1.35 + * Open new file.
1.36 + */
1.37 +TVerdict CTestMmfAclntOpenFile7804::DoTestL(CMdaAudioPlayerUtility* aPlayer)
1.38 + {
1.39 + return( PerformTestL( aPlayer ) );
1.40 + }
1.41 +
1.42 +TVerdict CTestMmfAclntOpenFile7804::PerformTestL(CMdaAudioPlayerUtility* aPlayer)
1.43 + {
1.44 + INFO_PRINTF1( _L("TestPlayerUtils : OpenFileL(RFile&)/Play"));
1.45 +
1.46 + TVerdict ret = EFail;
1.47 + iError = KErrNone;
1.48 +
1.49 + RFs fs;
1.50 +
1.51 + User::LeaveIfError(fs.Connect());
1.52 + CleanupClosePushL(fs);
1.53 + User::LeaveIfError(fs.ShareProtected());
1.54 +
1.55 + TBuf<KSizeBuf> filename;
1.56 + TPtrC filename1;
1.57 + RFile file;
1.58 +
1.59 + if(!GetStringFromConfig(_L("SectionOne"), _L("PCMU16BE"), filename1))
1.60 + {
1.61 + return EInconclusive;
1.62 + }
1.63 +
1.64 + GetDriveName(filename);
1.65 + filename.Append(filename1);
1.66 +
1.67 + User::LeaveIfError( file.Open( fs, filename, EFileRead ) );
1.68 + CleanupClosePushL(file);
1.69 +
1.70 + aPlayer->OpenFileL(file);
1.71 + CActiveScheduler::Start();
1.72 +
1.73 + if (iError == KErrNone)
1.74 + {
1.75 + aPlayer->Play();
1.76 + CActiveScheduler::Start();
1.77 + }
1.78 +
1.79 + if (iError == KErrNone)
1.80 + {
1.81 + ret = EPass;
1.82 + }
1.83 +
1.84 + aPlayer->Close();
1.85 + CleanupStack::PopAndDestroy(2, &fs);
1.86 +
1.87 + return ret;
1.88 + }