@file TSI_MMF_SDEVSOUND_01_PREEMPTION.script
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//


LOAD_SUITE TSI_MMF_SDEVSOUND.dll

delay 5000

//!@SYMTestCaseID             MM-MMF-SDEVSOUND-I-0002-HP
//!@SYMTestCaseDesc           SecureDevSound - PlaySimpleTone (DevSound[0] with no cap and HP, DevSound[1] with cap and LP)
//!@SYMPREQ                   PREQ277
//!@SYMTestPriority           2
//!@SYMTestActions            There are two processes of DevSound instances, iMMFDevSound[0] and iMMFDevSound[1]. They both play simple tone. iMMFDevSound[0]
//! has no MultimediaDD capability. It is set as HIGH priority and played first.  iMMFDevSound[1] has MultimediaDD capability. It is set as LOW priority
//! and played next.
//!@SYMTestExpectedResults    iMMFDevSound[0] stops and returns KErrInUse. iMMFDevSound[1] starts to play and returns KErrNone. Check that the callback
//! was called correctly and with no errors.
RUN_TEST_STEP -1 TSI_MMF_SDEVSOUND MM-MMF-SDEVSOUND-I-0002-HP
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-SDEVSOUND-I-0004-HP
//!@SYMTestCaseDesc           SecureDevSound - DTMFTones (DevSound[0] with no cap and HP, DevSound[1] with cap and LP)
//!@SYMPREQ                   PREQ277
//!@SYMTestPriority           2
//!@SYMTestActions            There are two processes of DevSound instances, iMMFDevSound[0] and iMMFDevSound[1]. They both play DTMF tone. iMMFDevSound[0]
//! has no MultimediaDD capability. It is set as HIGH priority and played first.  iMMFDevSound[1] has MultimediaDD capability. It is set as LOW priority
//! and played next.
//!@SYMTestExpectedResults    iMMFDevSound[0] stops and returns KErrInUse. iMMFDevSound[1] starts to play and returns KErrNone. Check that the callback
//! was called correctly and with no errors.
RUN_TEST_STEP -1 TSI_MMF_SDEVSOUND MM-MMF-SDEVSOUND-I-0004-HP
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-SDEVSOUND-I-0006-HP
//!@SYMTestCaseDesc           SecureDevSound - PlayDualTone (DevSound[0] with no cap and HP, DevSound[1] with cap and LP)
//!@SYMPREQ                   PREQ277
//!@SYMTestPriority           2
//!@SYMTestActions            There are two processes of DevSound instances, iMMFDevSound[0] and iMMFDevSound[1]. They both play Dual Tone. iMMFDevSound[0]
//! has no MultimediaDD capability. It is set as HIGH priority and played first.  iMMFDevSound[1] has MultimediaDD capability. It is set as LOW priority
//! and played next.
//!@SYMTestExpectedResults    iMMFDevSound[0] stops and returns KErrInUse. iMMFDevSound[1] starts to play and returns KErrNone. Check that the callback
//! was called correctly and with no errors.
RUN_TEST_STEP -1 TSI_MMF_SDEVSOUND MM-MMF-SDEVSOUND-I-0006-HP
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-SDEVSOUND-I-0008-HP
//!@SYMTestCaseDesc           SecureDevSound - PlayEOFPCM16 (DevSound[0] with no cap and HP, DevSound[1] with cap and LP)
//!@SYMPREQ                   PREQ277
//!@SYMTestPriority           2
//!@SYMTestActions            There are two processes of DevSound instances, iMMFDevSound[0] and iMMFDevSound[1]. They both call PlayData() to play buffers
//! till end of file. iMMFDevSound[0] has no MultimediaDD capability. It is set as HIGH priority and played first.  iMMFDevSound[1] has MultimediaDD capability.
//! It is set as LOW priority and played next.
//!@SYMTestExpectedResults    iMMFDevSound[0] stops and returns KErrInUse. iMMFDevSound[1] starts to play and returns KErrNone. The 'playing file' keeps
//! playing while the callback error is KErrNone. When the buffer read from the test file is less than the read buffer length then the test sets last buffer
//! to true. Also DevSound called PlayError with KErrUnderFlow.
RUN_TEST_STEP -1 TSI_MMF_SDEVSOUND MM-MMF-SDEVSOUND-I-0008-HP
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-SDEVSOUND-I-0010-HP
//!@SYMTestCaseDesc           SecureDevSound - Record10BuffersPCM16 (DevSound[0] with UserEnvironment cap and HP, DevSound[1] with all cap and LP)
//!@SYMPREQ                   PREQ277
//!@SYMTestPriority           2
//!@SYMTestActions            There are two processes of DevSound instances, iMMFDevSound[0] and iMMFDevSound[1]. They both call RecordData() to record
//! 10 buffers of pcm16 data. iMMFDevSound[0] has UserEnvironment capability. It is set as HIGH priority and played first.  iMMFDevSound[1] has All capability.
//! It is set as LOW priority and played next.
//!@SYMTestExpectedResults    iMMFDevSound[0] stops and returns KErrInUse. iMMFDevSound[1] starts to play and returns KErrNone. The 'recording file' keeps
//! recording while the callback error is KErrNone. Also every buffer has been recorded with one BufferToBeEmptied() callback. It finally produces C:\TSU
//!_MMF_DEVSOUND_SUITE\Output\Rec10BufferPCM.raw
RUN_TEST_STEP -1 TSI_MMF_SDEVSOUND MM-MMF-SDEVSOUND-I-0010-HP
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-SDEVSOUND-I-0036-HP
//!@SYMTestCaseDesc           SecureDevSound - PlaySimpleTone (DevSound[0] with cap and LP, DevSound[1] without cap and HP)
//!@SYMPREQ                   CR1058
//!@SYMTestPriority           2
//!@SYMTestActions            iMMFDevSound[0] has MMDD cap while iMMFDevSound[1] doesn't. Before they start playing their own tone in their own process, 
//! they exchange thread ID and reset their thread ID with SetClientThreadInfo()
//!@SYMTestExpectedResults    iMMFDevSound[0] stops and tone finishes with KErrInUse. iMMFDevSound[1] starts to play and tones finishes with KErrUnderflow.
RUN_TEST_STEP 440000 TSI_MMF_SDEVSOUND MM-MMF-SDEVSOUND-I-0036-HP
TEST_COMPLETE

