1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmfintegrationtest/vclnt/src/TS_MMFVCLNTsuite.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,265 @@
1.4 +
1.5 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// under the terms of "Eclipse Public License v1.0"
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +// This main DLL entry point for the TS_WP5.dll
1.19 +//
1.20 +//
1.21 +
1.22 +
1.23 +// EPOC includes
1.24 +#include <e32base.h>
1.25 +
1.26 +// Test system includes
1.27 +#include <testframework.h>
1.28 +
1.29 +#include "TSI_MMFVCLNT.h"
1.30 +#include "TS_MMFVCLNTSuite.h"
1.31 +#include "TestPlayer.h"
1.32 +#include "TestRecord.h"
1.33 +#include "DRMTestVidPlayer.h"
1.34 +#include "OpenFileByHandle0034.h"
1.35 +#include "OpenFileByHandle0036.h"
1.36 +#include "OpenFileByHandle0522.h"
1.37 +#include "OpenFileByHandle0523.h"
1.38 +#include "OpenFileByHandle0524.h"
1.39 +#include "OpenFileByHandle1011.h"
1.40 +#include "OpenFileByHandle_PlayText.h"
1.41 +#include "OpenFileByHandle1511.h"
1.42 +#include "OpenFileByHandle1512.h"
1.43 +#include "OpenFileByHandle1513.h"
1.44 +
1.45 +
1.46 +
1.47 +/**
1.48 + * NewTestSuite is exported at ordinal 1
1.49 + * this provides the interface to allow schedule test
1.50 + * to create instances of this test suite
1.51 + */
1.52 +EXPORT_C CTestSuite* NewTestSuiteL()
1.53 + {
1.54 + CTestMmfVclntSuite* result = new (ELeave) CTestMmfVclntSuite;
1.55 + CleanupStack::PushL(result);
1.56 + result->ConstructL();
1.57 + CleanupStack::Pop(); // result
1.58 + return result;
1.59 + }
1.60 +
1.61 +/**
1.62 + * destructor
1.63 + */
1.64 +CTestMmfVclntSuite::~CTestMmfVclntSuite()
1.65 + {
1.66 + }
1.67 +
1.68 +/**
1.69 + * make a version string available for test system
1.70 + * @return version string
1.71 + */
1.72 +TPtrC CTestMmfVclntSuite::GetVersion()
1.73 + {
1.74 + _LIT(KTxtVersion,"1.0");
1.75 + return KTxtVersion();
1.76 + }
1.77 +
1.78 +/**
1.79 + * Add a test step into the suite
1.80 + *
1.81 + * @param test step pointer to add
1.82 + */
1.83 +void CTestMmfVclntSuite::AddTestStepL( CTestMmfVclntStep* aPtrTestStep )
1.84 + {
1.85 + // test steps contain a pointer back to the suite which owns them
1.86 + aPtrTestStep->SetTestSuite(this);
1.87 + // add the step using tyhe base class method
1.88 + CTestSuite::AddTestStepL(aPtrTestStep);
1.89 + }
1.90 +
1.91 +/**
1.92 + * Constructor for test suite
1.93 + * this creates all the test steps and
1.94 + * stores them inside CTestMmfVclntSuite
1.95 + */
1.96 +void CTestMmfVclntSuite::InitialiseL()
1.97 + {
1.98 +#ifdef __WINS__
1.99 + // Check that the window server is ready for us
1.100 + // This is so that the call to CDirectScreenAccess::StartL does not leave with KErrNotReady
1.101 + if (!WaitUntilWindowServerReadyL())
1.102 + {
1.103 + INFO_PRINTF1(_L("TestSuite error: error receiving window server redraw event"));
1.104 + return;
1.105 + }
1.106 +#endif // __WINS__
1.107 +
1.108 + // store the name of this test suite
1.109 + iSuiteName = _L("MMF_VCLNT");
1.110 +
1.111 + TTimeIntervalMicroSeconds position = TInt64(0);
1.112 +
1.113 + //Play video file
1.114 + AddTestStepL( CTestVclntVideoFile::NewL( _L("MM-MMF-VCLNT-I-0001-CP"), _L("SectionOne"), _L("filename"), ETrue) );
1.115 +
1.116 + // Play video descriptor
1.117 + AddTestStepL( CTestVclntVideoDes::NewL( _L("MM-MMF-VCLNT-I-0002-CP"), _L("SectionOne"), _L("filename"), ETrue) );
1.118 +
1.119 + AddTestStepL( CTestVclntEnqFrameRate::NewL( _L("MM-MMF-VCLNT-I-0010-CP"), _L("SectionOne"), _L("filename"), 10) );
1.120 + AddTestStepL( CTestVclntPosition::NewL( _L("MM-MMF-VCLNT-I-0011-CP"), _L("SectionOne"), _L("filename"), position) );
1.121 + AddTestStepL( CTestVclntPriority::NewL( _L("MM-MMF-VCLNT-I-0012-CP"), _L("SectionOne"), _L("filename"), -1/*EPriorityMin*/) );
1.122 + AddTestStepL( CTestVclntDuration::NewL( _L("MM-MMF-VCLNT-I-0015-HP"), _L("SectionOne"), _L("filename"), position) );
1.123 + AddTestStepL( CTestVclntVolume::NewL( _L("MM-MMF-VCLNT-I-0016-HP"), _L("SectionOne"), _L("filename"), -1) );
1.124 + AddTestStepL( CTestVclntCloseOpen::NewL( _L("MM-MMF-VCLNT-I-0017-HP"), _L("SectionOne"), _L("filename")) );
1.125 + AddTestStepL( CTestVclntPause::NewL( _L("MM-MMF-VCLNT-I-0018-HP"), _L("SectionOne"), _L("filename")) );
1.126 + AddTestStepL( CTestVclntBalance::NewL( _L("MM-MMF-VCLNT-I-0019-HP"), _L("SectionOne"), _L("filename"),-10) );
1.127 + AddTestStepL( CTestVclntPlayWindow::NewL( _L("MM-MMF-VCLNT-I-0020-HP"), _L("SectionOne"), _L("filename"), position , position) );
1.128 + AddTestStepL( CTestVclntMeta::NewL( _L("MM-MMF-VCLNT-I-0021-HP"), _L("SectionOne"), _L("filename")) );
1.129 + AddTestStepL( CTestVclntFrameSize::NewL( _L("MM-MMF-VCLNT-I-0022-HP"), _L("SectionOne"), _L("filename"),12) );
1.130 + AddTestStepL( CTestVclntRepeat::NewL( _L("MM-MMF-VCLNT-I-0023-HP"), _L("SectionOne"), _L("filename"),3) );
1.131 + AddTestStepL( CTestVclntMimeType::NewL( _L("MM-MMF-VCLNT-I-0031-LP"), _L("SectionOne"), _L("filename")) );
1.132 + AddTestStepL( CTestVclntRebuffering::NewL( _L("MM-MMF-VCLNT-I-0032-LP"), _L("SectionOne"), _L("filename")) );
1.133 +
1.134 + // RecorderUtils
1.135 +
1.136 + AddTestStepL( CTestVclntRecordVideoFile::NewL( _L("MM-MMF-VCLNT-I-0502-CP"), _L("SectionTwo"), _L("filename"), ETrue) );
1.137 + AddTestStepL( CTestVclntRecorderVideoDes::NewL( _L("MM-MMF-VCLNT-I-0503-CP"), _L("SectionTwo"), _L("filename"), ETrue) );
1.138 + AddTestStepL( CTestVclntRecorderVideoUrl::NewL( _L("MM-MMF-VCLNT-I-0504-LP"), _L("SectionTwo"), _L("filename"), ETrue) );
1.139 + AddTestStepL( CTestVclntRecordCloseOpen::NewL( _L("MM-MMF-VCLNT-I-0505-HP"), _L("SectionTwo"), _L("filename")) );
1.140 + AddTestStepL( CTestVclntRecordConfig::NewL( _L("MM-MMF-VCLNT-I-0506-CP")) );
1.141 + AddTestStepL( CTestVclntRecordPause::NewL( _L("MM-MMF-VCLNT-I-0507-HP"), _L("SectionTwo"), _L("filename")) );
1.142 +
1.143 + AddTestStepL( CTestVclntRecordDuration::NewL( _L("MM-MMF-VCLNT-I-0509-HP"), _L("SectionTwo"), _L("filename"), position) );
1.144 + AddTestStepL( CTestVclntRecordTime::NewL( _L("MM-MMF-VCLNT-I-0510-HP"), _L("SectionTwo"), _L("filename"), 10) );
1.145 + AddTestStepL( CTestVclntRecordCrop::NewL( _L("MM-MMF-VCLNT-I-0511-HP"), _L("SectionTwo"), _L("filename"), ETrue) );
1.146 + AddTestStepL( CTestVclntRecordGain::NewL( _L("MM-MMF-VCLNT-I-0512-HP"), _L("SectionTwo"), _L("filename"), 10) );
1.147 + AddTestStepL( CTestVclntRecordMeta::NewL( _L("MM-MMF-VCLNT-I-0513-LP"), _L("SectionTwo"), _L("filename")) );
1.148 + AddTestStepL( CTestVclntRecordPriority::NewL( _L("MM-MMF-VCLNT-I-0514-LP"), _L("SectionOne"), _L("filename"), -1/*EPriorityMin*/) );
1.149 + AddTestStepL( CTestVclntRecordBalance::NewL( _L("MM-MMF-VCLNT-I-0515-HP"), _L("SectionTwo"), _L("filename"), -10) );
1.150 + AddTestStepL( CTestVclntRecordSize::NewL( _L("MM-MMF-VCLNT-I-0516-LP"), _L("SectionTwo"), _L("filename")) );
1.151 + AddTestStepL( CTestVclntRecordTypes::NewL( _L("MM-MMF-VCLNT-I-0521-LP"), _L("SectionTwo"), _L("filename")) );
1.152 +
1.153 +//
1.154 +// NEGATIVE TEST
1.155 +//
1.156 +
1.157 + AddTestStepL( CTestVclntDelete::NewL( _L("MM-MMF-VCLNT-I-1001-CP"), _L("SectionOne"), _L("filename")) );
1.158 + AddTestStepL( CTestVclntFrameSize::NewL( _L("MM-MMF-VCLNT-I-1002-CP"), _L("SectionOne"), _L("filename"),-12) );
1.159 + position = 103423423;
1.160 + AddTestStepL( CTestVclntPosition::NewL( _L("MM-MMF-VCLNT-I-1003-CP"), _L("SectionOne"), _L("filename"), position) );
1.161 + position = -12;
1.162 + AddTestStepL( CTestVclntPosition::NewL( _L("MM-MMF-VCLNT-I-1004-CP"), _L("SectionOne"), _L("filename"), position) );
1.163 + AddTestStepL( CTestVclntVolume::NewL( _L("MM-MMF-VCLNT-I-1005-HP"), _L("SectionOne"), _L("filename"), 1000400) );
1.164 + AddTestStepL( CTestVclntVolume::NewL( _L("MM-MMF-VCLNT-I-1010-HP"), _L("SectionOne"), _L("filename"), -100) );
1.165 + AddTestStepL( CTestVclntBalance::NewL( _L("MM-MMF-VCLNT-I-1006-HP"), _L("SectionOne"), _L("filename"),200) );
1.166 + AddTestStepL( CTestVclntBalance::NewL( _L("MM-MMF-VCLNT-I-1011-HP"), _L("SectionOne"), _L("filename"),-200) );
1.167 + position = 2000000;
1.168 + AddTestStepL( CTestVclntPlayWindow::NewL( _L("MM-MMF-VCLNT-I-1007-HP"), _L("SectionOne"), _L("filename"), position , position) );
1.169 + AddTestStepL( CTestVclntVideoFile::NewL( _L("MM-MMF-VCLNT-I-1008-HP"), _L("SectionOne"), _L("corruptFile"), ETrue) );
1.170 + AddTestStepL( CTestVclntVideoFile::NewL( _L("MM-MMF-VCLNT-I-1009-HP"), _L("SectionOne"), _L("NoCodecFile"), ETrue) );
1.171 +
1.172 + // RecorderUtils
1.173 +
1.174 + AddTestStepL( CTestVclntRecordVideoFile::NewL( _L("MM-MMF-VCLNT-I-1501-HP"), _L("SectionTwo"), _L("unsupported"), ETrue) );
1.175 + AddTestStepL( CTestVclntRecordDelete::NewL( _L("MM-MMF-VCLNT-I-1502-LP"), _L("SectionTwo"), _L("unsupported")) );
1.176 + AddTestStepL( CTestVclntRecordGain::NewL( _L("MM-MMF-VCLNT-I-1503-HP"), _L("SectionTwo"), _L("filename"), 1005670) );
1.177 + AddTestStepL( CTestVclntRecordGain::NewL( _L("MM-MMF-VCLNT-I-1504-HP"), _L("SectionTwo"), _L("filename"), -10) );
1.178 +
1.179 + AddTestStepL( CTestVclntRecordBalance::NewL( _L("MM-MMF-VCLNT-I-1507-HP"), _L("SectionTwo"), _L("filename"), -200) );
1.180 + AddTestStepL( CTestVclntRecordBalance::NewL( _L("MM-MMF-VCLNT-I-1508-HP"), _L("SectionTwo"), _L("filename"), 200) );
1.181 + AddTestStepL( CTestVclntRecordSize::NewL( _L("MM-MMF-VCLNT-I-1510-LP"), _L("SectionTwo"), _L("filename")) );
1.182 +
1.183 + //DRM
1.184 + //GetFrame unprotected file
1.185 + AddTestStepL( CTestStepVidPlayerDRMGetFrame::NewL( _L("MM-MMF-VCLNT-I-1600-LP"), _L("SectionDRM"), _L("filename")) );
1.186 +
1.187 + //Getframe from DRM protect file, with rights play count set to zero
1.188 + AddTestStepL( CTestStepVidPlayerDRMGetFrameProtected::NewL( _L("MM-MMF-VCLNT-I-1601-LP"), _L("SectionDRM"), _L("DRMFile")) );
1.189 +
1.190 + // Open unprotected file and play it no rights
1.191 + AddTestStepL( CTestStepVidPlayerDRMPlayNoRights::NewL( _L("MM-MMF-VCLNT-I-1602-LP"), _L("SectionDRM"), _L("DRMFile")) );
1.192 +
1.193 + //Open DRM protected video and play it with rights set and Agent providing MIME type
1.194 + AddTestStepL( CTestStepVidPlayerDRMPlayRights::NewL( _L("MM-MMF-VCLNT-I-1603-LP"), _L("SectionDRM"), _L("DRMFile")) );
1.195 +
1.196 + //Media Access by Handle
1.197 + AddTestStepL( CTestMmfVclntOpenFile0034::NewL( _L("MM-MMF-VCLNT-I-0034-CP"), _L("SectionOne"), _L("filename"), ETrue ) );
1.198 + AddTestStepL( CTestMmfVclntOpenFile0036::NewL( _L("MM-MMF-VCLNT-I-0036-CP"), _L("SectionOne"), _L("filename"), ETrue ) );
1.199 + AddTestStepL( CTestMmfVclntOpenFile0522::NewL( _L("MM-MMF-VCLNT-I-0522-CP"), _L("SectionTwo"), _L("filename"), ETrue ) );
1.200 + AddTestStepL( CTestMmfVclntOpenFile0523::NewL( _L("MM-MMF-VCLNT-I-0523-CP"), _L("SectionTwo"), _L("filename"), ETrue ) );
1.201 + AddTestStepL( CTestMmfVclntOpenFile0524::NewL( _L("MM-MMF-VCLNT-I-0524-CP"), _L("SectionTwo"), _L("filename"), ETrue ) );
1.202 + AddTestStepL( CTestMmfVclntOpenFile1011::NewL( _L("MM-MMF-VCLNT-I-1011-CP"), _L("SectionTwo"), _L("filename"), ETrue ) );
1.203 + AddTestStepL( CTestMmfVclntOpenFilePlayTextFile::NewL( _L("MM-MMF-VCLNT-I-1010-CP"), _L("SectionOne"), _L("textFile"), ETrue ) );
1.204 +
1.205 + AddTestStepL( CTestMmfVclntOpenFile1511::NewL( _L("MM-MMF-VCLNT-I-1511-CP"), _L("SectionTwo"), _L("filename"), ETrue ) );
1.206 + AddTestStepL( CTestMmfVclntOpenFile1512::NewL( _L("MM-MMF-VCLNT-I-1512-CP"), _L("SectionTwo"), _L("filename"), ETrue ) );
1.207 + AddTestStepL( CTestMmfVclntOpenFile1513::NewL( _L("MM-MMF-VCLNT-I-1513-CP"), _L("SectionTwo"), _L("textFile"), ETrue ) );
1.208 + }
1.209 +
1.210 +#ifdef __WINS__
1.211 +//
1.212 +// Wait synchronously for the first WS redraw event...
1.213 +//
1.214 +TBool CTestMmfVclntSuite::WaitUntilWindowServerReadyL()
1.215 + {
1.216 + InitWservL();
1.217 +
1.218 + TWsRedrawEvent event;
1.219 + TRequestStatus status;
1.220 + iWs.RedrawReady(&status);
1.221 + User::WaitForRequest(status);
1.222 + iWs.GetRedraw(event);
1.223 +
1.224 + DeInitWserv();
1.225 +
1.226 + return (status.Int() == KErrNone);
1.227 + }
1.228 +
1.229 +void CTestMmfVclntSuite::InitWservL()
1.230 + {
1.231 + TInt err = iWs.Connect();
1.232 + if (err != KErrNone)
1.233 + {
1.234 + // Access violation if ws is null
1.235 + INFO_PRINTF1(_L("TestSuite error: Cannot test, no window server available"));
1.236 + User::Leave(err);
1.237 + }
1.238 +
1.239 + iScreen = new (ELeave) CWsScreenDevice(iWs); // make device for this session
1.240 + User::LeaveIfError(iScreen->Construct()); // and complete its construction
1.241 +
1.242 + iRootWindow = RWindowGroup(iWs);
1.243 + User::LeaveIfError(iRootWindow.Construct((TUint32)this, ETrue));
1.244 +
1.245 + iWindow = new(ELeave) RWindow(iWs);
1.246 + User::LeaveIfError(((RWindow*)iWindow)->Construct(iRootWindow,((TUint32)(this)) + 1));
1.247 + iWindow->SetExtent(TPoint(0,0), TSize(400,200));
1.248 + iWindow->SetVisible(ETrue);
1.249 + iWindow->Activate();
1.250 + iWs.Flush();
1.251 + }
1.252 +
1.253 +void CTestMmfVclntSuite::DeInitWserv()
1.254 + {
1.255 + if (iWindow)
1.256 + {
1.257 + iWindow->Close();
1.258 + delete iWindow;
1.259 + iWindow = NULL;
1.260 + }
1.261 + iRootWindow.Close();
1.262 + delete iScreen;
1.263 + iScreen = NULL;
1.264 + iWs.Flush();
1.265 + iWs.Close();
1.266 + }
1.267 +#endif // __WINS__
1.268 +