Update contrib.
2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
22 @internalComponent Internal Symbian test code
25 #include "TFntStoreServer.h"
28 #include "T_FontBitmap.H"
29 #include "T_MatchFonts.h"
30 #include "T_GlyphTreeDel.h"
31 #include "T_OpenFontTypes.h"
32 #include "T_FontMetrics.h"
33 #include "T_GetNearestFont.h"
34 #include "T_GetNearestFontCapability.h"
35 #include "T_SetDefaultTypefaceName.h"
36 #include "t_corruptfonts.h"
38 #include "T_SHAPERCACHE.H"
39 #include "T_LinkedFonts.h"
40 #include "t_cachedeletion.h"
41 #include "T_LinkedFonts2.h"
42 #include "t_linkedfontsmemory.h"
43 #include "t_linkedfontscomparison.h"
44 #include "t_linkedfontscapability.h"
45 #include "T_LinkedFontUpdateTests.h"
47 #include "T_FontSessionCache.h"
49 CTFntStoreServer* CTFntStoreServer::NewL()
51 @return - Instance of the test server
52 Same code for Secure and non-secure variants
53 Called inside the MainL() function to create and start the
54 CTestServer derived server.
57 CTFntStoreServer * server = new (ELeave) CTFntStoreServer();
58 CleanupStack::PushL(server);
60 // Get server name from process so we can use SetCap to change the capabilites and use this server with a different filename
61 RProcess handle = RProcess();
62 TParsePtrC serverName(handle.FileName());
64 // CServer base class call
65 server->StartL(serverName.Name());
67 CleanupStack::Pop(server);
75 // Much simpler, uses the new Rendezvous() call to sync with the client
78 RProcess().DataCaging(RProcess::EDataCagingOn);
79 RProcess().SecureApi(RProcess::ESecureApiOn);
80 CActiveScheduler* sched=NULL;
81 sched=new(ELeave) CActiveScheduler;
82 CActiveScheduler::Install(sched);
83 CTFntStoreServer* server = NULL;
84 // Create the CTestServer derived server
85 TRAPD(err,server = CTFntStoreServer::NewL());
88 // Sync with the client and enter the active scheduler
89 RProcess::Rendezvous(KErrNone);
96 /** @return - Standard Epoc error code on process exit
98 Process entry point. Called by client using RProcess API
100 GLDEF_C TInt E32Main()
103 CTrapCleanup* cleanup = CTrapCleanup::New();
111 RDebug::Print(_L("CTFntStoreServer::MainL - Error: %d"), err);
112 User::Panic(_L("CTFntStoreServer"),err);
119 CTestStep* CTFntStoreServer::CreateTestStep(const TDesC& aStepName)
121 @return - A CTestStep derived instance
122 Secure and non-secure variants
123 Implementation of CTestServer pure virtual
126 if (aStepName == KTFntStep)
128 return new CTFntStep();
130 else if(aStepName == KTFntMemStep)
132 return new CTFntMemStep();
134 else if(aStepName == KTFsOpenStep)
136 return new CTFsOpenStep();
138 else if(aStepName == KTFontBitmapStep)
140 return new CTFontBitmapStep();
142 else if(aStepName == KTMatchFontsStep)
144 return new CTMatchFontsStep();
146 else if(aStepName == KTGlyphTreeDelStep)
148 return new CTGlyphTreeDelStep();
150 else if(aStepName == KTOpenFontTypesStep)
152 return new CTOpenFontTypesStep();
154 else if(aStepName == KTFontMetricsStep)
156 return new CTFontMetricsStep();
158 else if(aStepName == KTGetNearestFontStep)
160 return new CTGetNearestFontStep();
162 else if(aStepName == KTGetNearestFontCapabilityStep) // These tests have no capabilities and are expected to cause panics i.e. they will show up pass in the log files
164 return new CTGetNearestFontCapabilityStep();
166 else if(aStepName == KTSetDefaultTypefaceNameStep) // These tests have no capabilities and are expected to cause panics i.e. they will show up pass in the log files
168 return new CTSetDefaultTypefaceNameStep();
170 else if(aStepName == KTCorruptFontRejectionStep)
172 return new CTCorruptFontRejectionStep();
174 else if(aStepName == KTShaperCacheStep)
176 return new CTShaperCacheStep();
178 else if (aStepName == KTCacheDeletionStep)
180 return new CTCacheDeletionStep();
182 else if (aStepName == KTLinkedFonts2Step)
184 return new CTLinkedFonts2Step();
186 else if (aStepName == KTLinkedFontsMemoryStep)
188 return new CTLinkedFontsMemoryStep();
190 else if (aStepName == KTLinkedFontsComparisonStep)
192 return new CTLinkedFontsComparisonStep();
194 else if (aStepName == KTLinkedFontsCapabilityStep)
196 return new CTLinkedFontsCapabilityStep();
198 else if (aStepName == KTLinkedFontsUpdateStage1Step)
200 return new CTLinkedFontsUpdateStage1Step();
202 else if (aStepName == KTLinkedFontsUpdateStage2Step)
204 return new CTLinkedFontsUpdateStage2Step();
206 else if (aStepName == KTCacheStep)
208 return new CTCacheStep();
210 else if (aStepName == KTFontSessionCacheStep)
212 return new CTFontSessionCacheStep();
214 RDebug::Printf("Test Step is either mis-spelt or doesn't exist - see CTFntStoreServer::CreateTestStep");