First public contribution.
1 // Copyright (c) 2007-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
21 #include <ecom/ecom.h>
23 #include "egltestserver.h"
24 #include "eglteststep.h"
27 _LIT(KEGLTestServerName,"egltestserver");
30 CTestStep* CTestEGLServer::CreateTestStep(const TDesC& aStepName)
32 return EglTestStepFactory::GetEglTestStep(aStepName);
35 CTestEGLServer* CTestEGLServer::NewL()
37 CTestEGLServer* server = new(ELeave) CTestEGLServer();
38 CleanupStack::PushL(server);
39 // CServer base class call
40 TParsePtrC serverName(RProcess().FileName());
41 server->StartL(serverName.Name());
42 CleanupStack::Pop(server);
48 CActiveScheduler* sched=NULL;
49 sched=new(ELeave) CActiveScheduler;
50 CActiveScheduler::Install(sched);
53 // Construct and destroy a process-wide state object in emulator builds.
54 // This will cause initialisation of PLS for EGL and SgDriver
55 // and allow checking for leaks in tests
56 if(!eglReleaseThread())
58 // Call to eglReleaseThread failed
59 User::Leave(KErrGeneral);
63 CTestEGLServer* server = NULL;
64 // Create the CTestServer derived server
65 TRAPD(err, server = CTestEGLServer::NewL());
68 // Sync with the client and enter the active scheduler
69 RProcess::Rendezvous(KErrNone);
77 @return Standard Epoc error code on process exit
78 Process entry point. Called by client using RProcess API
83 CTrapCleanup* cleanup = CTrapCleanup::New();
92 RDebug::Print(_L("CTestEGLServer::MainL - Error: %d"), err);
93 User::Panic(KEGLTestServerName,err);
97 REComSession::FinalClose();