First public contribution.
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef TESTSRTDECODER_H
17 #define TESTSRTDECODER_H
21 #include <testframework.h>
24 class CSrtSubtitleDecoder;
26 // Generic test step class with utilities
27 class RTestSrtDecoderStep : public RTestStep
30 static TBool CompareFilesL(RFs &aFs, const TDesC& aFilePath1, const TDesC& aFilePath2);
31 void InitializeTestStepL(TBool aCreateSrtReaderOnly, const TDesC& aSrtFilePath);
32 void UnInitializeTestStep();
33 TBool IsFontAvailableL(const TDesC& aTypefaceName);
34 TBool CompareBmpFilesL(TInt aStartIndex, TInt aEndIndex, const TDesC& aSrcFilePathSpec, const TDesC& aDestFilePathSpec);
35 void DeleteTempFiles(TInt aStartIndex, TInt aEndIndex, const TDesC& aFilePathSpec);
38 CSrtReader* iSrtReader;
39 CSrtSubtitleDecoder* iSrtDecoder;
40 RFbsSession iRbsSession;
43 TBool iCreateSrtReaderOnly;
47 Test decoding a valid srt file from various positions
48 MM-MMF-SUBTITLE-SRTDECODER-U-0002-HP
50 NONSHARABLE_CLASS (RTestSrtDecoderStep0002) : public RTestSrtDecoderStep
53 RTestSrtDecoderStep0002();
57 TVerdict DoTestStepL();
58 TVerdict DoTestStepPreambleL();
59 TVerdict DoTestStepPostambleL();
64 void TestGetNextFrameL();
65 void TestGetNextFrameByPositionsL(const TTimeIntervalMicroSeconds& aPosition, TInt aExpectedNumOfFrames, TBool aSaveBitmap);
68 void DrawBitmap(CFbsBitmap& aBitmap);
72 CWsScreenDevice* iScreen;
74 RWindowGroup iRootWindow;
76 CActiveScheduler* iActiveScheduler;
77 TBool iActiveSchedulerStarted;
81 Test decoding an invalid srt file from beginning
82 MM-MMF-SUBTITLE-SRTDECODER-U-0101-HP
85 NONSHARABLE_CLASS (RTestSrtDecoderStep0101) : public RTestSrtDecoderStep
88 RTestSrtDecoderStep0101();
92 TVerdict DoTestStepL();
93 TVerdict DoTestStepPreambleL();
94 TVerdict DoTestStepPostambleL();
97 void TestGetNextFrameL();
101 Out of memory test for srt decoder
102 MM-MMF-SUBTITLE-SRTDECODER-U-0103-HP
104 NONSHARABLE_CLASS(RTestSrtDecoderStep0103) : public RTestStep
107 RTestSrtDecoderStep0103();
111 TVerdict DoTestStepL();
112 TVerdict DoTestStepPreambleL();
113 TVerdict DoTestStepPostambleL();
116 void TestGetNextFrameL(CFbsBitmap& aBitmap);
120 Start called twice panic test
121 MM-MMF-SUBTITLE-SRTDECODER-U-0105-HP
123 NONSHARABLE_CLASS(RTestSrtDecoderStep0105) : public RTestSrtDecoderStep
126 RTestSrtDecoderStep0105();
130 TVerdict DoTestStepL();
131 TVerdict DoTestStepPreambleL();
132 TVerdict DoTestStepPostambleL();
135 #endif // TESTSRTDECODER_H