sl@0: // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Internal Symbian test code sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @internalComponent sl@0: */ sl@0: sl@0: #include "TAutoServer.h" sl@0: sl@0: // Convereted tests sl@0: #include "TEVENT.H" sl@0: #include "TSPRITE.H" sl@0: #include "TBLANK.H" sl@0: #include "TMDISPLAY.H" sl@0: #include "TPROCPRI.H" sl@0: #include "TWINDOW.H" sl@0: #include "TRECTLIST.H" sl@0: #include "TDERIVED.H" sl@0: #include "TSCRDEV.H" sl@0: #include "TSCRDEVRESSWITCH.H" sl@0: #include "TMESSAGE.H" sl@0: #include "TOOMDRAW.H" sl@0: #include "TREDRSTR.H" sl@0: #include "TPNTKEY.H" sl@0: #include "TScreenModeScaling.h" sl@0: #include "TSCREENMODEPOSITIONING.H" sl@0: #include "TKRepeat.H" sl@0: #include "TBITMAP.H" sl@0: #include "TBACKUPW.H" sl@0: #include "TFADE.H" sl@0: #include "TGETPIXEL.H" sl@0: #include "TORDINAL.H" sl@0: #include "TGWHANDLE.H" sl@0: #include "TTransptAnim.h" sl@0: #include "TKEY.H" sl@0: #include "TMODCHG.H" sl@0: #include "TTEXTCURS.H" sl@0: #include "TSCROLL.H" sl@0: #include "TAlphaChannel.H" sl@0: #include "TPANIC.H" sl@0: #include "TGDI.H" sl@0: #include "TRegion.H" sl@0: #include "TREDRAW.H" sl@0: #include "TMulTran.H" sl@0: #include "TALPHAWIN.H" sl@0: #include "TMULTCON.H" sl@0: #include "TPNTCAP.H" sl@0: #include "TSCRMODE.H" sl@0: #include "TAUTODLL.H" sl@0: #include "TWSGRAPHS.H" sl@0: #include "TCAPABILITY.H" sl@0: #include "TPointer.H" sl@0: #include "tdirecta.h" sl@0: #include "tdirecta2.h" sl@0: #include "TOOM.H" sl@0: #include "TCapKey.H" sl@0: #include "TMULSCREENS.h" sl@0: #include "TBUFFERSECURITY.H" sl@0: #include "TFLICKERFREE.H" sl@0: #include "tdevicerotation.h" sl@0: #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA sl@0: #include "TFADINGBITMAP.H" sl@0: #endif sl@0: #include "tcrpanim.h" sl@0: #include "TMemLeakMode.h" sl@0: #include "tgc.h" sl@0: #include "THeartBeat.h" sl@0: #include "TGRAPHICSDRAWER.H" sl@0: #include "tw32cmdbuf.h" sl@0: #include "tadvancedpointerevent.h" sl@0: #include "tmultiptrevent.h" sl@0: #include "tdrawresource.h" sl@0: #include "twindowsizecache.h" sl@0: sl@0: sl@0: /* Path to the script sl@0: z:\GraphicsTest\gditest.script sl@0: */ sl@0: sl@0: #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA sl@0: _LIT(KServerName,"tautoserver_nonnga"); sl@0: #endif sl@0: sl@0: #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA sl@0: _LIT(KServerName,"tautoserver_nga"); sl@0: #endif sl@0: sl@0: //CTClient *client; sl@0: sl@0: CTAutoServer* CTAutoServer::NewL() sl@0: /** sl@0: @return - Instance of the test server sl@0: Same code for Secure and non-secure variants sl@0: Called inside the MainL() function to create and start the sl@0: CTestServer derived server. sl@0: */ sl@0: { sl@0: sl@0: CTAutoServer * server = new (ELeave) CTAutoServer(); sl@0: CleanupStack::PushL(server); sl@0: // CServer base class call sl@0: server->StartL(KServerName); sl@0: CleanupStack::Pop(server); sl@0: return server; sl@0: } sl@0: sl@0: sl@0: LOCAL_C void MainL() sl@0: // sl@0: // Secure variant sl@0: // Much simpler, uses the new Rendezvous() call to sync with the client sl@0: // sl@0: { sl@0: sl@0: #if (defined __DATA_CAGING__) sl@0: RProcess().DataCaging(RProcess::EDataCagingOn); sl@0: RProcess().SecureApi(RProcess::ESecureApiOn); sl@0: #endif sl@0: sl@0: CActiveScheduler* sched=NULL; sl@0: sched=new(ELeave) CActiveScheduler; sl@0: CActiveScheduler::Install(sched); sl@0: CTAutoServer* server = NULL; sl@0: // Create the CTestServer derived server sl@0: TRAPD(err,server = CTAutoServer::NewL()); sl@0: if(!err) sl@0: { sl@0: // client = CreateClientL(); sl@0: // client->SetScreenNumber(1); sl@0: // client->ConstructL(); sl@0: sl@0: // Sync with the client and enter the active scheduler sl@0: RProcess::Rendezvous(KErrNone); sl@0: sched->Start(); sl@0: sl@0: } sl@0: delete server; sl@0: delete sched; sl@0: // sl@0: } sl@0: sl@0: GLDEF_C TInt E32Main() sl@0: sl@0: /** @return - Standard Epoc error code on process exit sl@0: Secure variant only sl@0: Process entry point. Called by client using RProcess API sl@0: */ sl@0: { sl@0: sl@0: sl@0: __UHEAP_MARK; sl@0: sl@0: CTrapCleanup* cleanup = CTrapCleanup::New(); sl@0: if(cleanup == NULL) sl@0: { sl@0: return KErrNoMemory; sl@0: } sl@0: sl@0: TWinCommand commandLine; sl@0: User::CommandLine(commandLine); sl@0: TInt ret=KErrNone; sl@0: if (commandLine.Length()>0) sl@0: { sl@0: ret=CProcess::Start(commandLine); sl@0: // pass test result to parent process (in multi display test) sl@0: RProcess().Terminate(ret); sl@0: return(ret); sl@0: } sl@0: sl@0: sl@0: TRAPD(err,MainL()); sl@0: // This if statement is here just to shut up RVCT, which would otherwise warn sl@0: // that err was set but never used sl@0: if (err) sl@0: { sl@0: err = KErrNone; sl@0: } sl@0: delete cleanup; sl@0: sl@0: __UHEAP_MARKEND; sl@0: sl@0: // if (client != NULL) sl@0: // delete client; sl@0: return KErrNone; sl@0: } sl@0: sl@0: CTestStep* CTAutoServer::CreateTestStep(const TDesC& aStepName) sl@0: /** sl@0: @return - A CTestStep derived instance sl@0: Secure and non-secure variants sl@0: Implementation of CTestServer pure virtual sl@0: */ sl@0: { sl@0: // Debug statements to indicate the progress of the wserv test suite sl@0: RDebug::Print(_L("**********************************************")); sl@0: RDebug::Print(_L("* WServ Test Step: %S"), &aStepName); sl@0: RDebug::Print(_L("**********************************************")); sl@0: sl@0: ++CTestDriver::iTestNum; sl@0: CTestStep* testStep = NULL; sl@0: if(aStepName == KTEventTestStep) sl@0: testStep = new CTEventTestStep(); sl@0: else if(aStepName == KTTSpriteStep) sl@0: testStep = new CTTSpriteStep(); sl@0: else if(aStepName == KTBlankStep) sl@0: testStep = new CTBlankStep(); sl@0: else if(aStepName == KTRectListStep) sl@0: testStep = new CTRectListStep(); sl@0: else if(aStepName == KTMultiDisplayStep) sl@0: testStep = new CTMultiDisplayStep(); sl@0: else if(aStepName == KTWindowTestStep) sl@0: testStep = new CTWindowTestStep(); sl@0: else if(aStepName == KTDerivedStep) sl@0: testStep = new CTDerivedStep(); sl@0: else if(aStepName == KTScreenDeviceStep) sl@0: testStep = new CTScreenDeviceStep(); sl@0: else if(aStepName == KTScreenDeviceResSwitchStep) sl@0: testStep = new CTScreenDeviceResSwitchStep(); sl@0: else if(aStepName == KTMessageStep) sl@0: testStep = new CTMessageStep(); sl@0: else if(aStepName == KToomDrawStep) sl@0: testStep = new CToomDrawStep(); sl@0: else if(aStepName == KTRedrawStoringStep) sl@0: testStep = new CTRedrawStoringStep(); sl@0: else if(aStepName == KTPntKeyStep) sl@0: testStep = new CTPntKeyStep(); sl@0: else if(aStepName == KTKRepeatStep) sl@0: testStep = new CTKRepeatStep(); sl@0: else if(aStepName == KTBitmapStep) sl@0: testStep = new CTBitmapStep(); sl@0: else if(aStepName == KTScreenModeScalingStep) sl@0: testStep = new CTScreenModeScalingStep(); sl@0: else if(aStepName == KTScreenModePositioningStep) sl@0: testStep = new CTScreenModePositioningStep(); sl@0: else if(aStepName == KTBackedUpWindowStep) sl@0: testStep = new CTBackedUpWindowStep(); sl@0: else if(aStepName == KTFadeStep) sl@0: testStep = new CTFadeStep(); sl@0: else if(aStepName == KTGetPixelStep) sl@0: testStep = new CTGetPixelStep(); sl@0: else if(aStepName == KTOrdinalStep) sl@0: testStep = new CTOrdinalStep(); sl@0: else if(aStepName == KTGwHandleStep) sl@0: testStep = new CTGwHandleStep(); sl@0: else if (aStepName == KTTransparentAnimStep) sl@0: testStep = new CTTransparentAnimStep(); sl@0: else if(aStepName == KTProcPriStep) sl@0: testStep = new CTProcPriStep(); sl@0: else if(aStepName == KTKeyStep) sl@0: testStep = new CTKeyStep(); sl@0: else if(aStepName == KTModifiersChangedStep) sl@0: testStep = new CTModifiersChangedStep(); sl@0: else if(aStepName == KTCursorTestStep) sl@0: testStep = new CTCursorTestStep(); sl@0: else if(aStepName == KTScrollStep) sl@0: testStep = new CTScrollStep(); sl@0: else if(aStepName == KTAlphaChannelStep) sl@0: testStep = new CTAlphaChannelStep(); sl@0: else if(aStepName == KTPanicStep) sl@0: testStep = new CTPanicStep(); sl@0: else if(aStepName == KTGdiStep) sl@0: testStep = new CTGdiStep(); sl@0: else if(aStepName == KTRegionStep) sl@0: testStep = new CTRegionStep(); sl@0: else if(aStepName == KTRedrawTestStep) sl@0: testStep = new CTRedrawTestStep(); sl@0: else if(aStepName == KTMultipleTransStep) sl@0: testStep = new CTMultipleTransStep(); sl@0: else if(aStepName == KTAlphaWinStep) sl@0: testStep = new CTAlphaWinStep(); sl@0: else if(aStepName == KTMultiConStep) sl@0: testStep = new CTMultiConStep(); sl@0: else if(aStepName == KTPointerCaptureStep) sl@0: testStep = new CTPointerCaptureStep(); sl@0: else if(aStepName == KTScrModeStep) sl@0: testStep = new CTScrModeStep(); sl@0: else if(aStepName == KTAnimDllStep) sl@0: testStep = new CTAnimDllStep(); sl@0: else if(aStepName == KTWsGraphsStep) sl@0: testStep = new CTWsGraphsStep(); sl@0: else if(aStepName == KTCapabilityStep) sl@0: testStep = new CTCapabilityStep(); sl@0: else if(aStepName == KTPointerStep) sl@0: testStep = new CTPointerStep(); sl@0: else if(aStepName == KTDirectStep) sl@0: testStep = new CTDirectStep(); sl@0: else if(aStepName == KTDirect2Step) sl@0: testStep = new CTDirect2Step(); sl@0: else if(aStepName == KTOomStep) sl@0: testStep = new CTOomStep(); sl@0: else if(aStepName == KTCaptureKeyStep) sl@0: testStep = new CTCaptureKeyStep(); sl@0: else if(aStepName == KTMulScreensStep) sl@0: testStep = new CTMulScreensStep(); sl@0: else if(aStepName == KTBufferSecurityStep) sl@0: testStep = new CTBufferSecurityStep(); sl@0: else if(aStepName == KTFlickerFreeStep) sl@0: testStep = new CTFlickerFreeStep(); sl@0: else if(aStepName == KTDeviceRotationStep) sl@0: testStep = new CTDeviceRotationStep(); sl@0: #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA sl@0: else if(aStepName == KTFadingBitmapStep) sl@0: testStep = new CTFadingBitmapStep(); sl@0: #endif sl@0: else if(aStepName == KTCrpAnimStep) sl@0: testStep = new CTCrpAnimStep(); sl@0: else if(aStepName == KTMemLeakCheckEnableStep) sl@0: testStep = new CTMemLeakCheckEnableStep(); sl@0: else if(aStepName == KTMemLeakCheckOneShotStep) sl@0: testStep = new CTMemLeakCheckOneShotStep(); sl@0: else if(aStepName == KTGcStep) sl@0: testStep = new CTGcStep(); sl@0: else if(aStepName == KTHeartBeatTestStep) sl@0: testStep = new CTHeartBeatTestStep(); sl@0: else if(aStepName == KTGraphicsDrawerStep) sl@0: testStep = new CTGraphicsDrawerStep(); sl@0: else if(aStepName == KTW32CmdBufStep) sl@0: testStep = new CTW32CmdBufStep(); sl@0: #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA sl@0: else if(aStepName == KTAdvancedPointerEventStep) sl@0: testStep = new CTAdvancedPointerEventStep(); sl@0: else if(aStepName == KTMultiPtrEventTestStep) sl@0: testStep = new CTMultiPtrEventTestStep(); sl@0: else if(aStepName == KTDrawResourceStep) sl@0: testStep = new CTDrawResourceStep(); sl@0: else if(aStepName == KTWindowSizeCacheTestStep) sl@0: testStep = new CTWindowSizeCacheTestStep(); sl@0: #endif sl@0: return testStep; sl@0: }