fbs/fontandbitmapserver/trasterizer/test/trasterizerserver.cpp
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @test
       
    19  @internalComponent - Internal Symbian test code 
       
    20 */
       
    21 
       
    22 #include "trasterizer.h"
       
    23 #include "trasterizerinvalid.h"
       
    24 #include "trasterizerserver.h"
       
    25 #include <e32cmn.h> 
       
    26 #include <fbs.h>
       
    27 #include <graphics/fbsdefs.h>
       
    28 
       
    29 
       
    30 _LIT(KServerName,"trastserver");
       
    31 
       
    32 
       
    33 CTRasterizerServer* CTRasterizerServer::NewL()
       
    34 	{
       
    35 	CTRasterizerServer* server = new (ELeave) CTRasterizerServer();
       
    36 	CleanupStack::PushL(server);
       
    37 	// CServer base class call
       
    38 	server->StartL(KServerName);
       
    39 	CleanupStack::Pop(server);
       
    40 	return server;
       
    41 	}
       
    42 
       
    43 LOCAL_C void MainL()
       
    44 	{ 	
       
    45 	CActiveScheduler* sched=NULL;
       
    46 	sched=new(ELeave) CActiveScheduler;
       
    47 	CActiveScheduler::Install(sched);
       
    48 	CTRasterizerServer* server = NULL;
       
    49 	
       
    50 	// Create the CTestServer derived server
       
    51 	server = CTRasterizerServer::NewL();
       
    52 	// startup fbs server
       
    53 	FbsStartup();
       
    54 	// Sync with the client and enter the active scheduler
       
    55 	RProcess::Rendezvous(KErrNone);
       
    56 	sched->Start();
       
    57 
       
    58 	delete server;
       
    59 	delete sched;
       
    60 	}
       
    61 
       
    62 
       
    63 GLDEF_C TInt E32Main()
       
    64 	{	
       
    65 	__UHEAP_MARK;
       
    66 	CTrapCleanup* cleanup = CTrapCleanup::New();
       
    67 	if(cleanup == NULL)
       
    68 		{
       
    69 		return KErrNoMemory;
       
    70 		}
       
    71 	TRAPD(err,MainL());
       
    72 	if (err)
       
    73 	    {
       
    74 		RDebug::Print(_L("TRasterizerServer::MainL - Error: %d"), err);
       
    75 	   	User::Panic(KServerName,err);
       
    76 	    }
       
    77 	delete cleanup;
       
    78 	__UHEAP_MARKEND;
       
    79 	return KErrNone;
       
    80     }
       
    81 
       
    82 
       
    83 CTestStep* CTRasterizerServer::CreateTestStep(const TDesC& aStepName)
       
    84 	{
       
    85 	CTestStep* testStep = NULL;
       
    86 	
       
    87 	if (aStepName == KTRasterizerStep)
       
    88 		{
       
    89 		testStep = new CTRasterizer();
       
    90 		}
       
    91 	else if (aStepName == KTRasterizerInvalidStep)
       
    92 		{
       
    93 		testStep = new CTRasterizerInvalid();
       
    94 		}		
       
    95 	
       
    96 	return testStep;
       
    97 	}
       
    98