// Copyright (c) 2005-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:
// Creation Date 14/October/2005
// MMF DevSound Integration Test Script
//

PRINT Run all the MMF DevSound Integration Tests
PRINT 
PRINT 
PRINT IMPORTANT NOTE: THIS SUITE SHOULD ONLY BE RUN IN WINSCW UDEB and ARM UREL MODE due to PREQ1509 submission (DEF123715).
PRINT 
PRINT 

//
MULTITHREAD 

//
LOAD_SUITE tsi_mmf_devsound.dll

//////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////// Positive Testing ///////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////

///////////////////////////////////// DevSound - PLAY ////////////////////////////////////


//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0001-HP
//!@SYMTestCaseDesc           Play an OggVorbis audio file. Specifying TRourCC Code
//!@SYMREQ                    REQ5439, REQ5416
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Play an Ogg vorbis audio file specifying input data type as OggVorbis (and output data type as PCM16) - at a bit rate
//! 128kbps. 2. Play the OggVorbis audio file, at a bit rate 256kbps.
//!@SYMTestExpectedResults    The audio file should be played at different bit rates.
RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0001-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0002-HP
//!@SYMTestCaseDesc           Configure and reconfigure the audio HwDevice and play an OggVorbis audio file.
//!@SYMREQ                    REQ5439, REQ5416
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Configure the audio HwDevice. 2. Play the OggVorbis audio file. 3. Reconfigure the audio HwDevice. 4. Play the OggVorbis
//! audio file again.
//!@SYMTestExpectedResults    Audio HwDevice should be configured without any errors. The audio file should be played.
RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0002-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0003-HP
//!@SYMTestCaseDesc           List of supported input data types.
//!@SYMREQ                    REQ5439, REQ5416
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Get the list of supported input data types. For each supported input data type, check DevSound can be initialized.
//!@SYMTestExpectedResults    Should return the list of supported input data types.
RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0003-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0004-HP
//!@SYMTestCaseDesc           Position in stream data required for variable bit rate audio codec.
//!@SYMREQ                    REQ5439, REQ5416
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Position in stream data required for variable bit rate audio codec by playing the OggVorbis audio file at a bit rate
//! of 128kbps. 2. Request the stream position. 3. Perform the above steps for a bit rate of 256kbps.
//!@SYMTestExpectedResults    ?
RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0004-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0006-HP
//!@SYMTestCaseDesc           Play/stop playing an OggVorbis audio file.
//!@SYMREQ                    REQ5439, REQ5416
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Play an Ogg vorbis audio file specifying input data type as OggVorbis (and output data type as PCM16). 2. Stop playing
//! after playing 2 buffers. 3. Play again (till end of file).
//!@SYMTestExpectedResults    The audio file should be played/stopped and played again.
RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0006-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0007-HP
//!@SYMTestCaseDesc           Play/pause playing an OggVorbis audio file.
//!@SYMREQ                    REQ5439, REQ5416
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Play an Ogg vorbis audio file specifying input data type as OggVorbis (and output data type as PCM16) - play 2 buffers.
//! 2. Pause playing for 2 seconds. 3. Resume playing (till end of file).
//!@SYMTestExpectedResults    The audio file should be played/paused and resumed playing.
//
//! 01/08/07 
//! Skip this test because of the undefined behaviour of Play-Pause
//! See DEF107345 and pending CR1037
//
//RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0007-HP c:\mm\tsi_mmf_devsound.ini
//TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0008-HP
//!@SYMTestCaseDesc           Play/record an OggVorbis audio file.
//!@SYMREQ                    REQ5439, REQ5416
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Play an Ogg vorbis audio file specifying input data type as OggVorbis (and output data type as PCM16). (Initialize DevSound
//! for Play.) 2. Stop  playing after playing 2 buffers. 3. Record 2 buffers. (Initialize DevSound for Record.) 4. Stop recording. 5. Play the recorded file
//! (till end of file). (Initialize DevSound for Play.)
//!@SYMTestExpectedResults    The audio file should be played, recorded and played again.
RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0008-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

//////////////////////////////////// DevSound - RECORD ///////////////////////////////////

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0101-HP
//!@SYMTestCaseDesc           Record an OggVorbis audio file.
//!@SYMREQ                    REQ5439, REQ5416
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Record an Ogg vorbis audio  specifying output data type as OggVorbis (and input data type as PCM16) - at a bit rate 128kbps.
//! 2. Play the recorded audio file. 3. Record the OggVorbis audio file, at a bit rate 256kbps. 4. Play the recorded audio file.
//!@SYMTestExpectedResults    The audio file should be recorded at different bit rates.
RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0101-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0104-HP
//!@SYMTestCaseDesc           Record/stop recording an OggVorbis audio file.
//!@SYMREQ                    REQ5439, REQ5416
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Record an Ogg vorbis audio file specifying output data type as OggVorbis (and input data type as PCM16). 2. Stop recording
//! after recording 2 buffers. 3. Record 3 buffers.
//!@SYMTestExpectedResults    The audio file should be recorded/stopped and recorded.
RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0104-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0105-HP
//!@SYMTestCaseDesc           Record/pause recording an OggVorbis audio file.
//!@SYMREQ                    REQ5439, REQ5416
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Record an Ogg vorbis audio file specifying data output type as OggVorbis (and input data type as PCM16). - record 2 buffers.
//! 2. Pause recording for 2 seconds. 3. Resume recording. 4. Stop recording after recording 3 buffers.
//!@SYMTestExpectedResults    The audio file should be recorded/paused and resumed recording.
RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0105-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0106-HP
//!@SYMTestCaseDesc           List of supported output data types.
//!@SYMREQ                    REQ5439, REQ5416
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Get the list of supported output data types. For each supported output data type, check DevSound can be initialized.
//!@SYMTestExpectedResults    Should return the list of supported  output data types.
RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0106-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

//////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////// Negative Testing ///////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////

///////////////////////////////////// DevSound - PLAY ////////////////////////////////////

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0501-HP
//!@SYMTestCaseDesc           Play an Ogg vorbis audio file specifying invalid input data type.
//!@SYMREQ                    REQ5439
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Attempt to play an Ogg vorbis audio file  specifying invalid input data type.
//!@SYMTestExpectedResults    The audio file should not be played. KErrNotSupported.
RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0501-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0502-HP
//!@SYMTestCaseDesc           Play an Ogg vorbis audio file specifying invalid Uid.
//!@SYMREQ                    REQ5439
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Attempt to play an Ogg vorbis audio file specifying invalid Uid.
//!@SYMTestExpectedResults    InitializeL() returns KErrNotFound
RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0502-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0503-HP
//!@SYMTestCaseDesc           Play an OggVorbis audio file specifying Uid of HwDevice.
//!@SYMREQ                    REQ5439, REQ5416
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Play an Ogg vorbis audio file specifying Uid of the HwDevice. 2. Play the OggVorbis audio file.
//!@SYMTestExpectedResults    InitializeL() returns KErrNotSupported
RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0503-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0504-HP
//!@SYMTestCaseDesc           Play an OggVorbis audio file at an invalid bit rate.
//!@SYMREQ                    REQ5439
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Load an audio HwDevice (codec). 2. Attempt to play the OggVorbis audio file at an invalid bit rate.
//!@SYMTestExpectedResults    KErrNotSupported.
RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0504-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0505-HP
//!@SYMTestCaseDesc           Play a corrupted OggVorbis audio file.
//!@SYMREQ                    REQ5439
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Load an audio HwDevice (codec) specifying input data type as OggVorbis. 2. Attempt to play a corrupted OggVorbis audio
//! file.
//!@SYMTestExpectedResults    The audio file should not be played at the corrupted stream of data.
RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0505-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

//////////////////////////////////// DevSound - RECORD ///////////////////////////////////

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0601-HP
//!@SYMTestCaseDesc           Record to an Ogg vorbis audio file specifying invalid output data type.
//!@SYMREQ                    REQ5439
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Attempt to record to an Ogg vorbis audio file  specifying input data type as OggVorbis and invalid output data type.
//!@SYMTestExpectedResults    The audio file should not be recorded. KErrNotSupported.
RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0601-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0602-HP
//!@SYMTestCaseDesc           Record to an Ogg vorbis audio file specifying invalid Uid.
//!@SYMREQ                    REQ5439
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Attempt to record to an Ogg vorbis audio file specifying invalid Uid.
//!@SYMTestExpectedResults    InitializeL() returns KErrNotFound
RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0602-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0603-HP
//!@SYMTestCaseDesc           Record an OggVorbis audio file specifying Uid of HwDevice.
//!@SYMREQ                    REQ5439, REQ5416
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Record an Ogg vorbis audio file specifying Uid of the HwDevice. 2. Play the recorde OggVorbis audio file.
//!@SYMTestExpectedResults    InitializeL() returns KErrNotSupported
RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0603-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0604-HP
//!@SYMTestCaseDesc           Record to an OggVorbis audio file at an invalid bit rate.
//!@SYMREQ                    REQ5439
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Load an audio HwDevice (codec). 2. Attempt to record to the OggVorbis audio file at an invalid bit rate.
//!@SYMTestExpectedResults    KErrNotSupported.
RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0604-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0605-HP
//!@SYMTestCaseDesc           Record to a corrupted OggVorbis audio file.
//!@SYMREQ                    REQ5439
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Load an audio HwDevice (codec) specifying output data type as OggVorbis. 2. Attempt to record to a corrupted OggVorbis
//! audio file.
//!@SYMTestExpectedResults    The audio file should not be recorded since the file is corrupted.
RUN_TEST_STEP 240000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0605-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

// MOVED TEST TO LAST IN THE FILE.

//!@SYMTestCaseID             MM-MMF-DEVSOUND-I-0102-HP
//!@SYMTestCaseDesc           Configure and reconfigure the audio HwDevice and record an OggVorbis audio file.
//!@SYMREQ                    REQ5439, REQ5416
//!@SYMPREQ                   PREQ1024
//!@SYMTestPriority           2
//!@SYMTestActions            1. Configure the audio HwDevice. 2. Record and play the OggVorbis audio file. 3. Reconfigure the audio HwDevice. 4. Record
//! and play the OggVorbis audio file again.
//!@SYMTestExpectedResults    Audio HwDevice should be configured without any errors. The audio file should be recorded and played.
RUN_TEST_STEP 440000 TSI_MMF_DEVSOUND MM-MMF-DEVSOUND-I-0102-HP c:\mm\tsi_mmf_devsound.ini
TEST_COMPLETE

