os/graphics/graphicsresourceservices/graphicsresourceimplementation/test/src/tgraphicsresourceinternalserver.cpp
Update contrib.
1 // Copyright (c) 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.
19 @internalComponent - Internal Symbian test code
22 #include "tgraphicsresourceinternalserver.h"
23 #include "tgraphicsresourceinternal.h"
26 @return - Instance of the test server
27 Same code for Secure and non-secure variants
28 Called inside the MainL() function to create and start the
29 CTestServer derived server.
31 CTGraphicsResourceInternalServer* CTGraphicsResourceInternalServer::NewL()
33 CTGraphicsResourceInternalServer * server = new (ELeave) CTGraphicsResourceInternalServer();
34 CleanupStack::PushL(server);
36 // Get server name from process so we can use SetCap to change the capabilites and use this server with a different filename
37 RProcess handle = RProcess();
38 TParsePtrC serverName(handle.FileName());
40 // CServer base class call
41 server->StartL(serverName.Name());
42 CleanupStack::Pop(server);
48 CActiveScheduler* sched = new(ELeave) CActiveScheduler;
49 CActiveScheduler::Install(sched);
51 CTGraphicsResourceInternalServer* server = NULL;
52 // Create the CTestServer derived server
53 TRAPD(err,server = CTGraphicsResourceInternalServer::NewL());
56 // Sync with the client
57 RProcess::Rendezvous(KErrNone);
65 @return - Standard Epoc error code on process exit
67 GLDEF_C TInt E32Main()
70 CTrapCleanup* cleanup = CTrapCleanup::New();
78 RProcess handle = RProcess();
79 TParsePtrC serverName(handle.FileName());
80 User::Panic(serverName.Name(),err);
88 @return - A CTestStep derived instance
90 CTestStep* CTGraphicsResourceInternalServer::CreateTestStep(const TDesC& aStepName)
92 CTestStep* testStep = NULL;
94 if(aStepName == KTGraphicsResourceInternalStep)
96 testStep = new CTGraphicsResourceInternal();