os/mm/mmlibs/mmfw/tsrc/mmfunittest/VCLNT/TSU_MMF_VCLNT_01/src/TestStepVidPlayerOpen.cpp
Update contrib.
1 // Copyright (c) 2002-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.
24 #include <testframework.h>
26 // Test system includes
27 #include <testframework.h>
29 #include <mmf/common/mmfstandardcustomcommands.h>
30 #include <mmf/common/mmfvideo.h>
31 #include <mmf/server/mmfdes.h>
32 #include <mmf/server/mmffile.h>
33 #include <mmf/common/mmfdurationinfocustomcommands.h>
34 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
35 #include <mmf/common/mmfdurationinfocustomcommandsimpl.h>
36 #include <mmf/common/mmfdurationinfocustomcommandsenums.h>
39 #include <mmf/common/mmfcontroller.h>
40 #include <videoplayer.h>
41 #include <videorecorder.h>
43 #ifdef SYMBIAN_BUILD_GCE
44 #include <videoplayer2.h>
47 // Specific includes for this test suite
48 #include "TestStepUnitMMFVidClient.h"
49 #include "TestSuiteUnitMMFVidClient.h"
50 #include "TestStepVidPlayer.h"
55 _LIT(KClockFileName,"C:\\mm\\mmf\\testfiles\\vclnt\\clock.dummy");
58 // --------------------------------------------
62 * Static constructor for CTestStepVidPlayerOpenFile.
65 * @return "CTestStepVidPlayerOpenFile*"
66 * The constructed CTestStepVidPlayerOpenFile
68 CTestStepVidPlayerOpenFile* CTestStepVidPlayerOpenFile::NewL(const TDesC& aTestName, const TTest aTest)
70 CTestStepVidPlayerOpenFile* self = new(ELeave) CTestStepVidPlayerOpenFile(aTestName, aTest);
76 * Test step constructor.
77 * Each test step initialises its own name.
79 CTestStepVidPlayerOpenFile::CTestStepVidPlayerOpenFile(const TDesC& aTestName, const TTest aTest)
81 // This is the test case name that is used by the script file.
82 iTestStepName = aTestName;
84 iTestStepResult = EPass;
85 if (iTestStepName == _L("MM-MMF-VCLNT-U-0803-CP") ||
86 iTestStepName == _L("MM-MMF-VCLNT-U-0809-CP") ||
87 iTestStepName == _L("MM-MMF-VCLNT-U-0811-CP") )
92 if (iTestStepName == _L("MM-MMF-VCLNT-U-0850-CP") || iTestStepName == _L("MM-MMF-VCLNT-U-0853-CP"))
95 iSurfaceMode = EFalse;
101 * Test step destructor.
103 CTestStepVidPlayerOpenFile::~CTestStepVidPlayerOpenFile()
108 * Implementation of the MVideoRecorderUtilityObserver interface functions
110 void CTestStepVidPlayerOpenFile::MvpuoOpenComplete(TInt aError)
113 CActiveScheduler::Stop(); // check if asynchronous
116 void CTestStepVidPlayerOpenFile::MvpuoFrameReady(CFbsBitmap& /*aFrame*/, TInt /*aError*/)
120 void CTestStepVidPlayerOpenFile::MvpuoPlayComplete(TInt aError)
123 CActiveScheduler::Stop(); // check if asynchronous
126 void CTestStepVidPlayerOpenFile::MvpuoPrepareComplete(TInt aError)
129 CActiveScheduler::Stop(); // check if asynchronous
133 void CTestStepVidPlayerOpenFile::MvpuoEvent(const TMMFEvent& /*aEvent*/)
139 * Test step Preamble.
141 enum TVerdict CTestStepVidPlayerOpenFile::DoTestStepPreambleL(void)
143 enum TVerdict verdict;
144 // this installs the scheduler
145 verdict = CTestStepUnitMMFVidClient::DoTestStepPreambleL();
146 if (verdict != EPass)
151 iFileName.Set(KClockFileName);
153 // Printing to the console and log file
154 INFO_PRINTF2(_L("%S"), &iTestStepName);
155 if (iVpu2 && iSurfaceMode)
157 if (iTest == EFileName)
159 INFO_PRINTF1(_L("this test is opening a file name with a CVideoPlayerUtility2::OpenFileL()"));
161 if (iTest == EFileHandle)
163 INFO_PRINTF1(_L("this test is opening a file handle with a CVideoPlayerUtility2::OpenFileL()"));
165 if (iTest == EFileSource)
167 INFO_PRINTF1(_L("this test is opening a TMMFileSource with a CVideoPlayerUtility2::OpenFileL()"));
170 else if (iVpu2 && !iSurfaceMode)
172 if (iTest == EFileName)
174 INFO_PRINTF1(_L("this is a negative test for opening a file name with a CVideoPlayerUtility2::OpenFileL()"));
176 if (iTest == EFileHandle)
178 INFO_PRINTF1(_L("this is a negative test for opening a file handle with a CVideoPlayerUtility2::OpenFileL()"));
183 if (iTest == EFileName)
185 INFO_PRINTF1(_L("this test is opening a filename with a CVideoPlayerUtility::OpenFileL()"));
187 if (iTest == EFileHandle)
189 INFO_PRINTF1(_L("this test is opening a file handle with a CVideoPlayerUtility::OpenFileL()"));
191 if (iTest == EFileSource)
193 INFO_PRINTF1(_L("this test is opening a TMMFileSource with a CVideoPlayerUtility::OpenFileL()"));
195 if (iTest == EFileHandleSource)
197 INFO_PRINTF1(_L("this test is opening a TMMFileHandleSource with a CVideoPlayerUtility::OpenFileL()"));
208 * Test step Postamble.
210 enum TVerdict CTestStepVidPlayerOpenFile::DoTestStepPostambleL(void)
217 #ifdef SYMBIAN_BUILD_GCE
224 return CTestStepUnitMMFVidClient::DoTestStepPostambleL();
230 * Each test step must supply an implementation for DoTestStepL.
233 * The result of the test step
235 TVerdict CTestStepVidPlayerOpenFile::DoTestStepL()
244 TRect rect, clipRect;
245 iPlayer = CVideoPlayerUtility::NewL(*this, EMdaPriorityNormal, EMdaPriorityPreferenceTimeAndQuality,
246 iWs, *iScreen, *iWindow, rect, clipRect);
248 #ifdef SYMBIAN_BUILD_GCE
251 iPlayer2 = CVideoPlayerUtility2::NewL(*this, EMdaPriorityNormal, EMdaPriorityPreferenceTimeAndQuality);
255 if ( !PlayerStateStopped() )
257 return EInconclusive;
263 TRAP(err, OpenAndStartSchedulerL());
267 TRAP(err, OpenAndStartSchedulerL(ETrue));
272 TMMFileSource fileSource(iFileName);
273 TRAP(err, OpenAndStartSchedulerL(fileSource));
277 case EFileHandleSource:
279 User::LeaveIfError(iFs.Connect());
280 User::LeaveIfError(iFs.ShareProtected());
281 User::LeaveIfError(iFile.Open(iFs, iFileName, EFileRead));
282 TMMFileHandleSource fileSource(iFile);
283 TRAP(err, OpenAndStartSchedulerL(fileSource));
292 if (!iSurfaceMode && iVpu2 && err == KErrNone && iError == KErrNotSupported)
294 INFO_PRINTF2(_L("This test is when the controller doesn't support graphics surfaces. Expected: %d"), err);
298 if (err == KErrNotFound)
300 iTestStepResult = EInconclusive;
302 else if ( err == KErrNone && iError == KErrNone )
304 #ifdef SYMBIAN_BUILD_GCE
307 if (iSurfaceSupported)
311 iTestStepResult = ControllerCalled(_L8("MvpssUseSurfacesL Called"));
316 iTestStepResult = ControllerCalled(_L8("SetDisplayWindowL called"));
321 iTestStepResult = EFail;
329 #ifdef SYMBIAN_BUILD_GCE
336 INFO_PRINTF1(_L("finished with this test step"));
337 // test steps return a result
338 return iTestStepResult;
342 // --------------------------------------------
346 * Static constructor for CTestStepVidPlayerOpenDesc.
349 * @return "CTestStepVidPlayerOpenDesc*"
350 * The constructed CTestStepVidPlayerOpenDesc
352 CTestStepVidPlayerOpenDesc* CTestStepVidPlayerOpenDesc::NewL(TInt aUseSurface)
354 CTestStepVidPlayerOpenDesc* self = new(ELeave) CTestStepVidPlayerOpenDesc(aUseSurface);
360 * Test step constructor.
361 * Each test step initialises its own name.
363 CTestStepVidPlayerOpenDesc::CTestStepVidPlayerOpenDesc(TInt aUseSurface)
365 iTestStepResult = EPass;
366 // store the name of this test case
367 // this is the name that is used by the script file
369 if (aUseSurface == CTestStepUnitMMFVidClient::ENotSurfaceMode)
371 iTestStepName = _L("MM-MMF-VCLNT-U-0005-CP");
373 if (aUseSurface == CTestStepUnitMMFVidClient::ESurfaceMode)
376 iSurfaceMode = ETrue;
377 iTestStepName = _L("MM-MMF-VCLNT-U-0805-CP");
379 if (aUseSurface == CTestStepUnitMMFVidClient::ESurfaceModeNotSupported)
382 iSurfaceMode = EFalse;
383 iTestStepName = _L("MM-MMF-VCLNT-U-0851-CP");
391 * Test step destructor.
393 CTestStepVidPlayerOpenDesc::~CTestStepVidPlayerOpenDesc()
398 * Implementation of the MVideoRecorderUtilityObserver interface functions
400 void CTestStepVidPlayerOpenDesc::MvpuoOpenComplete(TInt aError)
403 CActiveScheduler::Stop(); // check if asynchronous
406 void CTestStepVidPlayerOpenDesc::MvpuoFrameReady(CFbsBitmap& /*aFrame*/, TInt /*aError*/)
410 void CTestStepVidPlayerOpenDesc::MvpuoPlayComplete(TInt aError)
413 CActiveScheduler::Stop(); // check if asynchronous
416 void CTestStepVidPlayerOpenDesc::MvpuoPrepareComplete(TInt aError)
419 CActiveScheduler::Stop(); // check if asynchronous
423 void CTestStepVidPlayerOpenDesc::MvpuoEvent(const TMMFEvent& /*aEvent*/)
430 * Test step Preamble.
432 enum TVerdict CTestStepVidPlayerOpenDesc::DoTestStepPreambleL(void)
434 enum TVerdict verdict;
435 // this installs the scheduler
436 verdict = CTestStepUnitMMFVidClient::DoTestStepPreambleL();
437 if (verdict != EPass)
442 iFileName.Set(KClockFileName);
446 if ( iFile.Open(iFs, iFileName, EFileRead) != KErrNone )
448 return EInconclusive;
452 // load the sound from the file to a Descriptor
453 iBuf = HBufC8::NewL( fSize );
454 TPtr8 des = iBuf->Des();
460 // Printing to the console and log file
461 INFO_PRINTF2(_L("%S"), &iTestStepName);
464 INFO_PRINTF1(_L("this test is opening a descriptor with a CVideoPlayerUtility::OpenDesL()"));
468 INFO_PRINTF1(_L("this test is opening a descriptor with a CVideoPlayerUtility2::OpenDesL()"));
476 * Test step Postamble.
478 enum TVerdict CTestStepVidPlayerOpenDesc::DoTestStepPostambleL(void)
485 #ifdef SYMBIAN_BUILD_GCE
492 return CTestStepUnitMMFVidClient::DoTestStepPostambleL();
495 void CTestStepVidPlayerOpenDesc::OpenDescAndStartSchedulerL()
499 iPlayer->OpenDesL(iBuf->Des());
501 #ifdef SYMBIAN_BUILD_GCE
504 iPlayer2->OpenDesL(iBuf->Des());
507 CActiveScheduler::Start();
512 * Each test step must supply an implementation for DoTestStepL.
515 * The result of the test step
517 TVerdict CTestStepVidPlayerOpenDesc::DoTestStepL()
526 TRect rect, clipRect;
527 iPlayer = CVideoPlayerUtility::NewL(*this, EMdaPriorityNormal, EMdaPriorityPreferenceTimeAndQuality,
528 iWs, *iScreen, *iWindow, rect, clipRect);
530 #ifdef SYMBIAN_BUILD_GCE
533 iPlayer2 = CVideoPlayerUtility2::NewL(*this, EMdaPriorityNormal, EMdaPriorityPreferenceTimeAndQuality);
537 if (!PlayerStateStopped() )
539 return EInconclusive;
542 TRAP(err, OpenDescAndStartSchedulerL() );
545 #ifdef _TYPHOON_TEST_
546 //Typhoon fix, video is not supported
547 if (err == KErrNotSupported)
553 if (!iSurfaceMode && iVpu2 && err == KErrNone && iError == KErrNotSupported)
555 INFO_PRINTF2(_L("This test is when the controller doesn't support graphics surfaces. Expected: %d"), err);
559 if (err == KErrNotFound)
561 iTestStepResult = EInconclusive;
563 else if ( err == KErrNone && iError == KErrNone )
565 #ifdef SYMBIAN_BUILD_GCE
568 if (iSurfaceSupported)
570 iTestStepResult = ControllerCalled(_L8("SetDisplayWindowL called"), EFalse);
574 iTestStepResult = ControllerCalled(_L8("SetDisplayWindowL called"));
579 INFO_PRINTF3(_L("OpenDescAndStartSchedulerL() left with %d. Error code iError is %d"), err, iError);
580 iTestStepResult = EFail;
588 #ifdef SYMBIAN_BUILD_GCE
596 INFO_PRINTF1(_L("finished with this test step"));
597 // test steps return a result
598 return iTestStepResult;
602 // --------------------------------------------
606 * Static constructor for CTestStepVidPlayerOpenUrl.
609 * @return "CTestStepVidPlayerOpenUrl*"
610 * The constructed CTestStepVidPlayerOpenUrl
612 CTestStepVidPlayerOpenUrl* CTestStepVidPlayerOpenUrl::NewL(TInt aUseSurface)
614 CTestStepVidPlayerOpenUrl* self = new(ELeave) CTestStepVidPlayerOpenUrl(aUseSurface);
620 * Test step constructor.
621 * Each test step initialises its own name.
623 CTestStepVidPlayerOpenUrl::CTestStepVidPlayerOpenUrl(TInt aUseSurface)
625 iTestStepResult = EPass;
626 // store the name of this test case
627 // this is the name that is used by the script file
629 if (aUseSurface == CTestStepUnitMMFVidClient::ENotSurfaceMode)
631 iTestStepName = _L("MM-MMF-VCLNT-U-0006-CP");
633 if (aUseSurface == CTestStepUnitMMFVidClient::ESurfaceMode)
636 iSurfaceMode = ETrue;
637 iTestStepName = _L("MM-MMF-VCLNT-U-0807-CP");
639 if (aUseSurface == CTestStepUnitMMFVidClient::ESurfaceModeNotSupported)
642 iSurfaceMode = EFalse;
643 iTestStepName = _L("MM-MMF-VCLNT-U-0852-CP");
649 * Test step destructor.
651 CTestStepVidPlayerOpenUrl::~CTestStepVidPlayerOpenUrl()
656 * Implementation of the MVideoRecorderUtilityObserver interface functions
658 void CTestStepVidPlayerOpenUrl::MvpuoOpenComplete(TInt aError)
661 CActiveScheduler::Stop(); // check if asynchronous
664 void CTestStepVidPlayerOpenUrl::MvpuoFrameReady(CFbsBitmap& /*aFrame*/, TInt /*aError*/)
668 void CTestStepVidPlayerOpenUrl::MvpuoPlayComplete(TInt aError)
671 CActiveScheduler::Stop(); // check if asynchronous
674 void CTestStepVidPlayerOpenUrl::MvpuoPrepareComplete(TInt aError)
677 CActiveScheduler::Stop(); // check if asynchronous
681 void CTestStepVidPlayerOpenUrl::MvpuoEvent(const TMMFEvent& /*aEvent*/)
688 * Test step Preamble.
690 enum TVerdict CTestStepVidPlayerOpenUrl::DoTestStepPreambleL(void)
692 enum TVerdict verdict;
693 // this installs the scheduler
694 verdict = CTestStepUnitMMFVidClient::DoTestStepPreambleL();
695 if (verdict != EPass)
700 _LIT8(KMimeType, "video/msvideo");
702 iFileName.Set(KTestURL);
703 iMimeType.Set(KMimeType);
705 // Printing to the console and log file
706 INFO_PRINTF2(_L("%S"), &iTestStepName);
709 INFO_PRINTF1(_L("this test is opening a file with a CVideoPlayerUtility::OpenUrlL()"));
713 INFO_PRINTF1(_L("this test is opening a file with a CVideoPlayerUtility2::OpenUrlL()"));
720 TRect rect, clipRect;
721 iPlayer = CVideoPlayerUtility::NewL(*this, EMdaPriorityNormal, EMdaPriorityPreferenceTimeAndQuality,
722 iWs, *iScreen, *iWindow, rect, clipRect);
724 #ifdef SYMBIAN_BUILD_GCE
727 iPlayer2 = CVideoPlayerUtility2::NewL(*this, EMdaPriorityNormal, EMdaPriorityPreferenceTimeAndQuality);
731 if (!PlayerStateStopped() )
733 return EInconclusive;
741 * Test step Postamble.
743 enum TVerdict CTestStepVidPlayerOpenUrl::DoTestStepPostambleL(void)
750 #ifdef SYMBIAN_BUILD_GCE
757 return CTestStepUnitMMFVidClient::DoTestStepPostambleL();
760 void CTestStepVidPlayerOpenUrl::OpenUrlAndStartSchedulerL()
764 iPlayer->OpenUrlL(iFileName,KTestIap,iMimeType);
766 #ifdef SYMBIAN_BUILD_GCE
769 iPlayer2->OpenUrlL(iFileName,KTestIap,iMimeType);
772 CActiveScheduler::Start();
777 * Each test step must supply an implementation for DoTestStepL.
780 * The result of the test step
782 TVerdict CTestStepVidPlayerOpenUrl::DoTestStepL()
787 TRAP(err, OpenUrlAndStartSchedulerL() );
789 if (!iSurfaceMode && iVpu2 && iError == KErrNotSupported && err == KErrNone)
791 INFO_PRINTF2(_L("This test is when the controller doesn't support graphics surfaces. Expected: %d"), err);
795 if (err == KErrNotFound)
797 iTestStepResult = EInconclusive;
799 else if ( (err == KErrNone) && (iError == KErrNone))
802 // now use a special custom command to check the sending of these parameters
803 TUid uid = TUid::Uid(0x101f72B4);
804 TMMFMessageDestinationPckg destPckg(uid);
808 err = iPlayer->CustomCommandSync(destPckg,
809 EMMFTestCustomCommandCheckUrl,
813 #ifdef SYMBIAN_BUILD_GCE
816 err = iPlayer2->CustomCommandSync(destPckg,
817 EMMFTestCustomCommandCheckUrl,
824 #ifdef SYMBIAN_BUILD_GCE
827 if (iSurfaceSupported)
829 iTestStepResult = ControllerCalled(_L8("SetDisplayWindowL called"), EFalse);
833 iTestStepResult = ControllerCalled(_L8("SetDisplayWindowL called"));
838 iTestStepResult = EFail;
843 iTestStepResult = EFail;
851 #ifdef SYMBIAN_BUILD_GCE
858 INFO_PRINTF1(_L("finished with this test step"));
859 // test steps return a result
860 return iTestStepResult;
864 // --------------------------------------------
868 * Static constructor for CTestStepVidPlayerOpenviaUriTag.
871 * @return "CTestStepVidPlayerOpenviaUriTag*"
872 * The constructed CTestStepVidPlayerOpenviaUriTag
874 CTestStepVidPlayerOpenviaUriTag* CTestStepVidPlayerOpenviaUriTag::NewL()
876 CTestStepVidPlayerOpenviaUriTag* self = new(ELeave) CTestStepVidPlayerOpenviaUriTag;
882 * Test step constructor.
883 * Each test step initialises its own name.
885 CTestStepVidPlayerOpenviaUriTag::CTestStepVidPlayerOpenviaUriTag()
887 iTestStepResult = EPass;
888 // store the name of this test case
889 // this is the name that is used by the script file
890 iTestStepName = _L("MM-MMF-VCLNT-U-0313-CP");
895 * Test step destructor.
897 CTestStepVidPlayerOpenviaUriTag::~CTestStepVidPlayerOpenviaUriTag()
902 * Implementation of the MVideoRecorderUtilityObserver interface functions
904 void CTestStepVidPlayerOpenviaUriTag::MvpuoOpenComplete(TInt aError)
907 CActiveScheduler::Stop(); // check if asynchronous
910 void CTestStepVidPlayerOpenviaUriTag::MvpuoFrameReady(CFbsBitmap& /*aFrame*/, TInt /*aError*/)
914 void CTestStepVidPlayerOpenviaUriTag::MvpuoPlayComplete(TInt aError)
917 CActiveScheduler::Stop(); // check if asynchronous
920 void CTestStepVidPlayerOpenviaUriTag::MvpuoPrepareComplete(TInt aError)
923 CActiveScheduler::Stop(); // check if asynchronous
926 void CTestStepVidPlayerOpenviaUriTag::MvpuoEvent(const TMMFEvent& /*aEvent*/)
933 * Test step Preamble.
935 enum TVerdict CTestStepVidPlayerOpenviaUriTag::DoTestStepPreambleL(void)
937 enum TVerdict verdict;
938 // this installs the scheduler
939 verdict = CTestStepUnitMMFVidClient::DoTestStepPreambleL();
940 if (verdict != EPass)
945 _LIT8(KMimeType, "");
946 _LIT(KTestURiTag, "rttp://www.symbian.com/test");
948 iFileName.Set(KTestURiTag);
949 iMimeType.Set(KMimeType);
951 // Printing to the console and log file
952 INFO_PRINTF1(_L("MM-MMF-VCLNT-U-0313-CP"));
953 INFO_PRINTF1(_L("this test is opening a file with a CVideoPlayerUtility::OpenUrlL()"));
957 TRect rect, clipRect;
958 iPlayer = CVideoPlayerUtility::NewL(*this, EMdaPriorityNormal, EMdaPriorityPreferenceTimeAndQuality,
959 iWs, *iScreen, *iWindow, rect, clipRect);
961 if (iPlayer == NULL || !PlayerStateStopped() )
963 return EInconclusive;
971 * Test step Postamble.
973 enum TVerdict CTestStepVidPlayerOpenviaUriTag::DoTestStepPostambleL(void)
977 return CTestStepUnitMMFVidClient::DoTestStepPostambleL();
980 void CTestStepVidPlayerOpenviaUriTag::OpenUrlAndStartSchedulerL()
982 iPlayer->OpenUrlL(iFileName,KTestIap,iMimeType);
983 CActiveScheduler::Start();
988 * Each test step must supply an implementation for DoTestStepL.
991 * The result of the test step
993 TVerdict CTestStepVidPlayerOpenviaUriTag::DoTestStepL()
998 TRAP(err, OpenUrlAndStartSchedulerL() );
1000 if (err == KErrNotFound)
1002 return EInconclusive;
1005 if(iError != KErrExtensionNotSupported)
1007 iTestStepResult = EFail;
1011 iTestStepResult = EPass;
1017 INFO_PRINTF1(_L("finished with this test step"));
1018 // test steps return a result
1019 return iTestStepResult;
1024 // --------------------------------------------
1028 * Static constructor for CTestStepVidPlayerOpenTryNextCtrl.
1031 * @return "CTestStepVidPlayerOpenTryNextCtrl*"
1032 * The constructed CTestStepVidPlayerOpenTryNextCtrl
1034 CTestStepVidPlayerOpenTryNextCtrl* CTestStepVidPlayerOpenTryNextCtrl::NewL()
1036 CTestStepVidPlayerOpenTryNextCtrl* self = new(ELeave) CTestStepVidPlayerOpenTryNextCtrl;
1042 * Test step constructor.
1043 * Each test step initialises its own name.
1045 CTestStepVidPlayerOpenTryNextCtrl::CTestStepVidPlayerOpenTryNextCtrl()
1047 iTestStepResult = EPass;
1048 // store the name of this test case
1049 // this is the name that is used by the script file
1050 iTestStepName = _L("MM-MMF-VCLNT-U-0314-CP");
1055 * Test step destructor.
1057 CTestStepVidPlayerOpenTryNextCtrl::~CTestStepVidPlayerOpenTryNextCtrl()
1062 * Implementation of the MVideoRecorderUtilityObserver interface functions
1064 void CTestStepVidPlayerOpenTryNextCtrl::MvpuoOpenComplete(TInt aError)
1067 CActiveScheduler::Stop(); // check if asynchronous
1070 void CTestStepVidPlayerOpenTryNextCtrl::MvpuoFrameReady(CFbsBitmap& /*aFrame*/, TInt /*aError*/)
1074 void CTestStepVidPlayerOpenTryNextCtrl::MvpuoPlayComplete(TInt aError)
1077 CActiveScheduler::Stop(); // check if asynchronous
1080 void CTestStepVidPlayerOpenTryNextCtrl::MvpuoPrepareComplete(TInt aError)
1083 CActiveScheduler::Stop(); // check if asynchronous
1086 void CTestStepVidPlayerOpenTryNextCtrl::MvpuoEvent(const TMMFEvent& /*aEvent*/)
1093 * Test step Preamble.
1095 enum TVerdict CTestStepVidPlayerOpenTryNextCtrl::DoTestStepPreambleL(void)
1097 enum TVerdict verdict;
1098 // this installs the scheduler
1099 verdict = CTestStepUnitMMFVidClient::DoTestStepPreambleL();
1100 if (verdict != EPass)
1105 _LIT8(KMimeType, "");
1106 _LIT(KTestURL1, "rttp://www.symbian.com/clock.dummy");
1107 iFileName.Set(KTestURL1);
1108 iMimeType.Set(KMimeType);
1110 // Printing to the console and log file
1111 INFO_PRINTF1(_L("MM-MMF-VCLNT-U-0314-CP"));
1112 INFO_PRINTF1(_L("this test is opening a file with a CVideoPlayerUtility::OpenUrlL()"));
1116 TRect rect, clipRect;
1117 iPlayer = CVideoPlayerUtility::NewL(*this, EMdaPriorityNormal, EMdaPriorityPreferenceTimeAndQuality,
1118 iWs, *iScreen, *iWindow, rect, clipRect);
1120 if (iPlayer == NULL || !PlayerStateStopped() )
1122 return EInconclusive;
1130 * Test step Postamble.
1132 enum TVerdict CTestStepVidPlayerOpenTryNextCtrl::DoTestStepPostambleL(void)
1136 return CTestStepUnitMMFVidClient::DoTestStepPostambleL();
1139 void CTestStepVidPlayerOpenTryNextCtrl::OpenUrlAndStartSchedulerL()
1141 iPlayer->OpenUrlL(iFileName,KTestIap,iMimeType);
1142 CActiveScheduler::Start();
1147 * Each test step must supply an implementation for DoTestStepL.
1149 * @return "TVerdict"
1150 * The result of the test step
1152 TVerdict CTestStepVidPlayerOpenTryNextCtrl::DoTestStepL()
1154 TInt err = KErrNone;
1157 TRAP(err, OpenUrlAndStartSchedulerL() );
1159 if (err == KErrNotFound)
1161 return EInconclusive;
1164 //need to remove <n>yes tag from 101f7D2D.RSS to really check for Trying Next Ctrl.
1165 //in that case, KErrNone returned
1166 if(iError != KErrExtensionNotSupported)
1168 iTestStepResult = EFail;
1172 iTestStepResult = EPass;
1178 INFO_PRINTF1(_L("finished with this test step"));
1179 // test steps return a result
1180 return iTestStepResult;
1184 // --------------------------------------------
1188 * Static constructor for CTestStepVidPlayerClose.
1191 * @return "CTestStepVidPlayerClose*"
1192 * The constructed CTestStepVidPlayerClose
1194 CTestStepVidPlayerClose* CTestStepVidPlayerClose::NewL()
1196 CTestStepVidPlayerClose* self = new(ELeave) CTestStepVidPlayerClose;
1202 * Test step constructor.
1203 * Each test step initialises its own name.
1205 CTestStepVidPlayerClose::CTestStepVidPlayerClose()
1207 iTestStepResult = EPass;
1208 // store the name of this test case
1209 // this is the name that is used by the script file
1210 iTestStepName = _L("MM-MMF-VCLNT-U-0010-CP");
1215 * Test step destructor.
1217 CTestStepVidPlayerClose::~CTestStepVidPlayerClose()
1222 * Implementation of the MVideoRecorderUtilityObserver interface functions
1224 void CTestStepVidPlayerClose::MvpuoOpenComplete(TInt aError)
1227 CActiveScheduler::Stop(); // check if asynchronous
1230 void CTestStepVidPlayerClose::MvpuoFrameReady(CFbsBitmap& /*aFrame*/, TInt /*aError*/)
1234 void CTestStepVidPlayerClose::MvpuoPlayComplete(TInt aError)
1237 CActiveScheduler::Stop(); // check if asynchronous
1240 void CTestStepVidPlayerClose::MvpuoPrepareComplete(TInt aError)
1243 CActiveScheduler::Stop(); // check if asynchronous
1247 void CTestStepVidPlayerClose::MvpuoEvent(const TMMFEvent& /*aEvent*/)
1254 * Test step Preamble.
1256 enum TVerdict CTestStepVidPlayerClose::DoTestStepPreambleL(void)
1258 enum TVerdict verdict;
1259 // this installs the scheduler
1260 verdict = CTestStepUnitMMFVidClient::DoTestStepPreambleL();
1261 if (verdict != KErrNone)
1263 return EInconclusive;
1266 iFileName.Set(KClockFileName);
1268 // Printing to the console and log file
1269 INFO_PRINTF1(_L("MM-MMF-VCLNT-U-0010-CP"));
1270 INFO_PRINTF1(_L("this test is closing a source with CVideoPlayerUtility::Close()"));
1272 iError = KErrNone; //KErrTimedOut;
1281 * Test step Postamble.
1283 enum TVerdict CTestStepVidPlayerClose::DoTestStepPostambleL(void)
1287 return CTestStepUnitMMFVidClient::DoTestStepPostambleL();
1293 * Each test step must supply an implementation for DoTestStepL.
1295 * @return "TVerdict"
1296 * The result of the test step
1298 TVerdict CTestStepVidPlayerClose::DoTestStepL()
1302 TRect rect, clipRect;
1303 iPlayer = CVideoPlayerUtility::NewL(*this, EMdaPriorityNormal, EMdaPriorityPreferenceTimeAndQuality,
1304 iWs, *iScreen, *iWindow, rect, clipRect);
1306 if (!iPlayer || !PlayerStateStopped())
1308 return EInconclusive;
1311 TInt err = KErrNone;
1312 TRAP(err, OpenAndStartSchedulerL() );
1314 #ifdef _TYPHOON_TEST_
1315 //Typhoon fix, video is not supported
1316 if (err == KErrNotSupported)
1322 if (err != KErrNone)
1324 return EInconclusive;
1330 #ifdef _TYPHOON_TEST_
1331 //Typhoon fix, video is not supported
1332 if (err == KErrNotSupported)
1338 if (err != KErrNone) // we can check the duration if it's 0, or the file handle if we could access it....
1347 INFO_PRINTF1(_L("finished with this test step"));
1348 // test steps return a result
1349 return iTestStepResult;
1354 * Static constructor for CTestStepVidPlayerOpenDurationCustomCommand.
1357 * @return "CTestStepVidPlayerOpenDurationCustomCommand*"
1358 * The constructed CTestStepVidPlayerOpenDurationCustomCommand
1360 CTestStepVidPlayerOpenDurationCustomCommand* CTestStepVidPlayerOpenDurationCustomCommand::NewL()
1362 CTestStepVidPlayerOpenDurationCustomCommand* self = new(ELeave) CTestStepVidPlayerOpenDurationCustomCommand;
1368 * Test step constructor.
1369 * Each test step initialises its own name.
1371 CTestStepVidPlayerOpenDurationCustomCommand::CTestStepVidPlayerOpenDurationCustomCommand()
1373 iTestStepResult = EPass;
1374 // store the name of this test case
1375 // this is the name that is used by the script file
1376 iTestStepName = _L("MM-MMF-VCLNT-U-0256-HP");
1381 * Test step destructor.
1383 CTestStepVidPlayerOpenDurationCustomCommand::~CTestStepVidPlayerOpenDurationCustomCommand()
1390 * Test step Preamble.
1392 TVerdict CTestStepVidPlayerOpenDurationCustomCommand::DoTestStepPreambleL(void)
1394 enum TVerdict verdict;
1395 // this installs the scheduler
1396 verdict = CTestStepUnitMMFVidClient::DoTestStepPreambleL();
1397 if (verdict != EPass)
1402 _LIT8(KMimeType, "video/msvideo");
1403 iFileName.Set(KTestURL);
1404 iMimeType.Set(KMimeType);
1406 // Printing to the console and log file
1407 INFO_PRINTF1(_L("MM-MMF-VCLNT-U-0256-HP"));
1408 INFO_PRINTF1(_L("This test opens a file with a CVideoPlayerUtility::OpenUrlL() and then tests"));
1409 INFO_PRINTF1(_L("the custom command: EMMFGetDurationInfo. The custom command parser for this test case"));
1410 INFO_PRINTF1(_L("is implemented in the video test controller: TInt CMMFTestController::GetDurationInfo(TMMFDurationInfo& aDurationInfo)"));
1413 TRect rect, clipRect;
1414 iPlayer = CVideoPlayerUtility::NewL(*this, EMdaPriorityNormal, EMdaPriorityPreferenceTimeAndQuality,
1415 iWs, *iScreen, *iWindow, rect, clipRect);
1416 if (iPlayer == NULL ||!PlayerStateStopped())
1418 return EInconclusive;
1423 void CTestStepVidPlayerOpenDurationCustomCommand::OpenUrlAndStartSchedulerL()
1425 iPlayer->OpenUrlL(iFileName,KTestIap,iMimeType);
1426 CActiveScheduler::Start();
1432 * Each test step must supply an implementation for DoTestStepL.
1434 * @return "TVerdict"
1435 * The result of the test step
1437 TVerdict CTestStepVidPlayerOpenDurationCustomCommand::DoTestStepL()
1439 TInt err = KErrNone;
1441 TRAP(err,OpenUrlAndStartSchedulerL());
1442 if(err == KErrNotFound)
1444 return EInconclusive;
1447 // Now the player is open we can check that the duration custom command parser is working correctly
1448 // The test controller is hard coded to always return TMMFDurationInfo::EMMFDurationInfoInfinite
1449 TUid uid = TUid::Uid(0x10273812);
1450 TMMFMessageDestinationPckg destPckg(uid);
1451 TPckgBuf<TMMFDurationInfo> enumPckg;
1452 iPlayer->CustomCommandSync(destPckg, EMMFGetDurationInfo, KNullDesC8, KNullDesC8, enumPckg);
1454 if(enumPckg()!=EMMFDurationInfoInfinite)
1456 iTestStepResult=EFail;
1459 INFO_PRINTF1(_L("Finished with this test step"));
1460 return iTestStepResult;
1465 * Test step Postamble.
1467 TVerdict CTestStepVidPlayerOpenDurationCustomCommand::DoTestStepPostambleL(void)
1471 return CTestStepUnitMMFVidClient::DoTestStepPostambleL();
1474 // from MVideoPlayerUtilityObserver
1475 void CTestStepVidPlayerOpenDurationCustomCommand::MvpuoOpenComplete(TInt aError)
1478 CActiveScheduler::Stop();
1481 void CTestStepVidPlayerOpenDurationCustomCommand::MvpuoFrameReady(CFbsBitmap& /*aFrame*/, TInt /*aError*/)
1485 void CTestStepVidPlayerOpenDurationCustomCommand::MvpuoPlayComplete(TInt aError)
1488 CActiveScheduler::Stop();
1491 void CTestStepVidPlayerOpenDurationCustomCommand::MvpuoPrepareComplete(TInt aError)
1494 CActiveScheduler::Stop();
1497 void CTestStepVidPlayerOpenDurationCustomCommand::MvpuoEvent(const TMMFEvent& /*aEvent*/)