sl@0: // Copyright (c) 2005-2010 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: // sl@0: sl@0: /** sl@0: @file sl@0: @test sl@0: @internalComponent - Internal Symbian test code sl@0: */ sl@0: sl@0: #include "TFbsServer.h" sl@0: #include "TALLOC.H" sl@0: #include "TBitmap.h" sl@0: #include "TCLEAN.H" sl@0: #include "TFBS.H" sl@0: #include "tcompressed.h" sl@0: #include "TRalc.h" sl@0: #include "TFBSDefect.h" sl@0: #include "TStreamIdCache.h" sl@0: #include "TSecureFBS.h" sl@0: #include "trfile.h" sl@0: #include "TGetAllBitmapsCapability.h" sl@0: #include "tipctest.h" sl@0: #include "textendedbitmap.h" sl@0: #include "textendedbitmapnegative.h" sl@0: #include "textendedbitmaplegacy.h" sl@0: #include "textendedbitmappanic.h" sl@0: #include "twdp.h" sl@0: #include "tfonttableandglyph.h" sl@0: #include "tfbsglyphdata.h" sl@0: #include "tfbsglyphdatapanic.h" sl@0: #include "tfbsglyphdataoutlineshadow.h" sl@0: #include "tglyphatlas.h" sl@0: #include "tfbsoogm.h" sl@0: sl@0: /* Path to the script sl@0: sl@0: z:\GraphicsTest\fbstest.script sl@0: sl@0: */ sl@0: sl@0: CTFbsServer* CTFbsServer::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: CTFbsServer * server = new (ELeave) CTFbsServer(); sl@0: CleanupStack::PushL(server); sl@0: sl@0: // Get server name from process so we can use SetCap to change the capabilites and use this server with a different filename sl@0: RProcess handle = RProcess(); sl@0: TParsePtrC serverName(handle.FileName()); sl@0: sl@0: // CServer base class call sl@0: server->StartL(serverName.Name()); 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: RProcess().DataCaging(RProcess::EDataCagingOn); sl@0: RProcess().SecureApi(RProcess::ESecureApiOn); sl@0: sl@0: CActiveScheduler* sched=NULL; sl@0: sched=new(ELeave) CActiveScheduler; sl@0: CActiveScheduler::Install(sched); sl@0: CTFbsServer* server = NULL; sl@0: // Create the CTestServer derived server sl@0: TRAPD(err,server = CTFbsServer::NewL()); sl@0: if(!err) 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: delete server; sl@0: delete sched; sl@0: } 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: GLDEF_C TInt E32Main() sl@0: { sl@0: __UHEAP_MARK; sl@0: CTrapCleanup* cleanup = CTrapCleanup::New(); sl@0: if(cleanup == NULL) sl@0: { sl@0: return KErrNoMemory; sl@0: } sl@0: TRAPD(err,MainL()); sl@0: if (err) sl@0: { sl@0: RProcess handle = RProcess(); sl@0: TParsePtrC serverName(handle.FileName()); sl@0: RDebug::Print(_L("CTFbsServer::MainL - Error: %d"), err); sl@0: User::Panic(serverName.Name(),err); sl@0: } sl@0: delete cleanup; sl@0: __UHEAP_MARKEND; sl@0: return KErrNone; sl@0: } sl@0: sl@0: CTestStep* CTFbsServer::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: CTestStep* testStep = NULL; sl@0: sl@0: if(aStepName == KTAllocStep) sl@0: { sl@0: testStep = new CTAllocStep(); sl@0: } sl@0: else if(aStepName == KTBitmapStep) sl@0: { sl@0: testStep = new CTBitmapStep(); sl@0: } sl@0: else if(aStepName == KTCleanStep) sl@0: { sl@0: testStep = new CTCleanStep(); sl@0: } sl@0: else if(aStepName == KTFbsStep) sl@0: { sl@0: testStep = new CTFbsStep(); sl@0: } sl@0: else if(aStepName == KTCompressedStep) sl@0: { sl@0: testStep = new CTCompressedStep(); sl@0: } sl@0: else if(aStepName == KTRalcStep) sl@0: { sl@0: testStep = new CTRalcStep(); sl@0: } sl@0: else if(aStepName == KTFbsDefectStep) sl@0: { sl@0: testStep = new CTFbsDefectStep(); sl@0: } sl@0: else if(aStepName == KTStreamIdCacheStep) sl@0: { sl@0: testStep = new CTStreamIdCacheStep(); sl@0: } sl@0: else if(aStepName == KTFbsSecureStep) sl@0: { sl@0: testStep = new CTFbsSecureStep(); sl@0: } sl@0: else if(aStepName == KTFileStep) sl@0: { sl@0: testStep = new CTFileStep(); sl@0: } sl@0: else if(aStepName == KTGetAllBitmapsCapabilityStep) sl@0: { sl@0: testStep = new CTGetAllBitmapsCapabilityStep(); sl@0: } sl@0: else if(aStepName == KTIPCTestStep) sl@0: { sl@0: testStep = new CTIPCTestStep(); sl@0: } sl@0: else if(aStepName == KTExtendedBitmapStep) sl@0: { sl@0: testStep = new CTExtendedBitmapStep(); sl@0: } sl@0: else if(aStepName == KTExtendedBitmapNegativeStep) sl@0: { sl@0: testStep = new CTExtendedBitmapNegativeStep(); sl@0: } sl@0: else if(aStepName == KTExtendedBitmapLegacyStep) sl@0: { sl@0: testStep = new CTExtendedBitmapLegacyStep(); sl@0: } sl@0: else if(aStepName == KTExtendedBitmapPanicStep) sl@0: { sl@0: testStep = new CTExtendedBitmapPanicStep(); sl@0: } sl@0: else if(aStepName == KTWDPStep) sl@0: { sl@0: testStep = new CTWDPStep(); sl@0: } sl@0: else if(aStepName == KTFontTableAndGlyphStep) sl@0: { sl@0: testStep = new CTFontAndGlyphStep(); sl@0: } sl@0: else if(aStepName == KTFbsGlyphDataStep) sl@0: { sl@0: testStep = new CTFbsGlyphDataStep(); sl@0: } sl@0: else if(aStepName == KTFbsGlyphDataPanicStep) sl@0: { sl@0: testStep = new CTFbsGlyphDataPanicStep(); sl@0: } sl@0: else if(aStepName == KTFbsGlyphDataOutlineAndShadowStep) sl@0: { sl@0: testStep = new CTFbsGlyphDataOutlineAndShadowStep(); sl@0: } sl@0: else if(aStepName == KTGlyphAtlasStep) sl@0: { sl@0: testStep = new CTGlyphAtlasStep(); sl@0: } sl@0: else if(aStepName == KTFbsOogmStep) sl@0: { sl@0: testStep = new CTFbsOogmStep(); sl@0: } sl@0: sl@0: return testStep; sl@0: }