// Copyright (c) 2008-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 tsu_mmf_subtitledecoder.dll

//! @SYMTestCaseID          MM-MMF-SUBTITLE-SRTREADER-U-0001-HP
//! @SYMREQ                 REQ9903
//! @SYMTestCaseDesc        Test GetBuffer with a valid source
//! @SYMTestActions         The test application reads a SRT file by using buffers with different sizes. 
//                          For each buffer with a certain size, the buffer is concatenated and saved as 
//                          a result file. Then the test application compare the SRT file and the result 
//                          file, and ensure their contents are the same.
//! @SYMTestPriority        High
RUN_TEST_STEP 30000, tsu_mmf_subtitledecoder, MM-MMF-SUBTITLE-SRTREADER-U-0001-HP
TEST_COMPLETE

//! @SYMTestCaseID          MM-MMF-SUBTITLE-SRTREADER-U-0100-HP
//! @SYMREQ                 REQ9903
//! @SYMTestCaseDesc        Test constructor without source
//! @SYMTestActions         The test application tries to instantiating a srt reader object with using a 
//                          non-existing source.
//! @SYMTestPriority        High
RUN_TEST_STEP 30000, tsu_mmf_subtitledecoder, MM-MMF-SUBTITLE-SRTREADER-U-0100-HP
TEST_COMPLETE

//! @SYMTestCaseID          MM-MMF-SUBTITLE-SRTDECODER-U-0001-HP
//! @SYMREQ                 REQ9903
//! @SYMTestCaseDesc        Test functions of calculating region, setting video position, starting and 
//                          stopping decoding.
//! @SYMTestActions         Call functions of calculating region with various valid values, setting video 
//                          position with various valid values, starting and stopping decoding multiple times.
//! @SYMTestPriority        High
RUN_TEST_STEP 30000, tsu_mmf_subtitledecoder, MM-MMF-SUBTITLE-SRTDECODER-U-0001-HP
TEST_COMPLETE

//! @SYMTestCaseID          MM-MMF-SUBTITLE-SRTDECODER-U-0002-HP
//! @SYMREQ                 REQ9903
//! @SYMTestCaseDesc        Test decoding a valid srt file from various positions
//! @SYMTestActions         Call SetVideoPosition() and GetNextFrameL to parse valid srt files with various 
//                          content length in each frame. The video positions are ranged from 0, a time value 
//                          between the start time and the end time of a frame, a timevalue between the end 
//                          time of a frame and the start time of the next frame, the start time of a frame, 
//                          the end time of a frame,  a time value exceeding the end time of the last frame. 
//                          The tests with the various video positions are finished in one loop in one test 
//                          step. When the video position is set to 0, full frames shall be decoded and the 
//                          result bitmaps shall be verified. Also, srt frame contents with various length 
//                          are also tested.
//! @SYMTestPriority        High
RUN_TEST_STEP 30000, tsu_mmf_subtitledecoder, MM-MMF-SUBTITLE-SRTDECODER-U-0002-HP
TEST_COMPLETE

//! @SYMTestCaseID          MM-MMF-SUBTITLE-SRTDECODER-U-0100-HP
//! @SYMREQ                 REQ9903
//! @SYMTestCaseDesc        Test language functions
//! @SYMTestActions         Call language functions and expects KErrNotSupported errors.
//! @SYMTestPriority        High
RUN_TEST_STEP 30000, tsu_mmf_subtitledecoder, MM-MMF-SUBTITLE-SRTDECODER-U-0100-HP
TEST_COMPLETE

//! @SYMTestCaseID          MM-MMF-SUBTITLE-SRTDECODER-U-0101-HP
//! @SYMREQ                 REQ9903
//! @SYMTestCaseDesc        Test decoding an invalid srt file from beginning
//! @SYMTestActions         Call SetVideoPosition(0) and GetNextFrameL to parse an invalid srt file with 
//                          various content lengths in each frame. The corrupt frames shall be skipped. 
//! @SYMTestPriority        High
RUN_TEST_STEP 30000, tsu_mmf_subtitledecoder, MM-MMF-SUBTITLE-SRTDECODER-U-0101-HP
TEST_COMPLETE

//! @SYMTestCaseID          MM-MMF-SUBTITLE-SRTDECODER-U-0102-HP
//! @SYMREQ                 REQ9903
//! @SYMTestCaseDesc        Test functions of calculating invalid regions
//! @SYMTestActions         Call functions of calculating region with various invalid values.
//! @SYMTestPriority        High
RUN_TEST_STEP 30000, tsu_mmf_subtitledecoder, MM-MMF-SUBTITLE-SRTDECODER-U-0102-HP
TEST_COMPLETE

//! @SYMTestCaseID          MM-MMF-SUBTITLE-SRTDECODER-U-0103-HP
//! @SYMREQ                 REQ9903
//! @SYMTestCaseDesc        Out-of-memory test for GetNextFrameL
//! @SYMTestActions         Call GetNextFrameL to parse a valid srt file and use __UHEAP_SETFAIL to 
//                          simulate out-of-memory status
//! @SYMTestPriority        High
RUN_TEST_STEP 600000, tsu_mmf_subtitledecoder, MM-MMF-SUBTITLE-SRTDECODER-U-0103-HP
TEST_COMPLETE

//! @SYMTestCaseID          MM-MMF-SUBTITLE-SRTDECODER-U-0104-HP
//! @SYMREQ                 REQ9903
//! @SYMTestCaseDesc        Setting invalid video position with minus value
//! @SYMTestActions         Call functions of calculating region with minus value and expect a panic
//! @SYMTestPriority        High
RUN_PANIC_STEP 30000, tsu_mmf_subtitledecoder, MM-MMF-SUBTITLE-SRTDECODER-U-0104-HP, SrtSubDec, 1
TEST_COMPLETE

//! @SYMTestCaseID          MM-MMF-SUBTITLE-SRTDECODER-U-0105-HP
//! @SYMREQ                 REQ9903
//! @SYMTestCaseDesc        Start decoder twice
//! @SYMTestActions         Start the SRT subtitle decoder twice.  Expect a panic.
//! @SYMTestPriority        High
RUN_PANIC_STEP 30000, tsu_mmf_subtitledecoder, MM-MMF-SUBTITLE-SRTDECODER-U-0105-HP, SrtSubDec, 4
TEST_COMPLETE
