os/graphics/graphicscomposition/surfaceupdate/tsrc/tsurfaceupdatetestserver.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2006-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 "tsurfaceupdatetestserver.h"
    23 #include "tsurfaceupdate.h"
    24  
    25 _LIT(KServerName,"TSurfaceUpdateTestServer");
    26 
    27 CTSurfaceUpdateServer* CTSurfaceUpdateServer::NewL()
    28 	{
    29 	CTSurfaceUpdateServer * server = new (ELeave) CTSurfaceUpdateServer();
    30 	CleanupStack::PushL(server);
    31 	// CServer base class call
    32 	server->StartL(KServerName);
    33 	CleanupStack::Pop(server);
    34 	return server;
    35 	}
    36 
    37 LOCAL_C void MainL()
    38 	{
    39  	RProcess().DataCaging(RProcess::EDataCagingOn);
    40 	RProcess().SecureApi(RProcess::ESecureApiOn);
    41 	CActiveScheduler* sched=NULL;
    42 	sched=new(ELeave) CActiveScheduler;
    43 	CActiveScheduler::Install(sched);
    44 	CTSurfaceUpdateServer* server = NULL;
    45 	// Create the CTestServer derived server
    46 	TRAPD(err,server = CTSurfaceUpdateServer::NewL());
    47 	if(!err)
    48 		{
    49 		// Sync with the client and enter the active scheduler
    50 		RProcess::Rendezvous(KErrNone);
    51 		sched->Start();
    52 		}
    53 	delete server;
    54 	delete sched;
    55 	}
    56 
    57 GLDEF_C TInt E32Main()
    58 	{
    59 	__UHEAP_MARK;
    60 	CTrapCleanup* cleanup = CTrapCleanup::New();
    61 	if(cleanup == NULL)
    62 		{
    63 		return KErrNoMemory;
    64 		}
    65 	TRAPD(err,MainL());
    66 	if (err)
    67 	    {
    68 		RDebug::Print(_L("TSurfaceUpdateServer::MainL - Error: %d"), err);
    69 	   	User::Panic(KServerName,err);
    70 	    }
    71 	delete cleanup;
    72 	__UHEAP_MARKEND;
    73 	return KErrNone;
    74     }
    75 
    76 CTestStep* CTSurfaceUpdateServer::CreateTestStep(const TDesC& aStepName)
    77 	{
    78 	CTestStep* testStep = NULL;
    79 	
    80 	if(aStepName == KTSurfaceUpdateStep)
    81 		{
    82 		testStep = new CTSurfaceUpdateStep();
    83 		}
    84 		
    85 	return testStep;
    86 	}