|
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". |
|
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 <coecntrl.h> |
|
23 |
|
24 #include "appfwk_test_AppUi.h" |
|
25 #include "t_gfxtranstestServer.h" |
|
26 #include "t_gfxtranseffect.h" |
|
27 |
|
28 |
|
29 CGfxTransTestServer* CGfxTransTestServer::NewL() |
|
30 /** |
|
31 @return - Instance of the test server |
|
32 Called inside the MainL() function to create and start the |
|
33 CTestServer derived server. |
|
34 */ |
|
35 { |
|
36 CGfxTransTestServer * server = new (ELeave) CGfxTransTestServer(); |
|
37 CleanupStack::PushL(server); |
|
38 // CServer base class call |
|
39 TParsePtrC serverName(RProcess().FileName()); |
|
40 server->StartL(serverName.Name()); |
|
41 CleanupStack::Pop(server); |
|
42 return server; |
|
43 } |
|
44 |
|
45 |
|
46 CTestStep* CGfxTransTestServer::CreateTestStep(const TDesC& aStepName) |
|
47 /** |
|
48 @return - A CTestStep derived instance |
|
49 Secure and non-secure variants |
|
50 Implementation of CTestServer pure virtual |
|
51 */ |
|
52 { |
|
53 CTestStep* testStep = NULL; |
|
54 |
|
55 // This server creates just one step but create as many as you want |
|
56 // They are created "just in time" when the worker thread is created |
|
57 if (aStepName == KTestGfxTransEffect) |
|
58 { |
|
59 testStep = new CTestGfxTransEffect(); |
|
60 } |
|
61 return testStep; |
|
62 } |
|
63 |
|
64 |
|
65 LOCAL_C void MainL() |
|
66 /** |
|
67 Much simpler, uses the new Rendezvous() call to sync with the client |
|
68 */ |
|
69 { |
|
70 CActiveScheduler* sched=NULL; |
|
71 sched=new(ELeave) CActiveScheduler; |
|
72 CActiveScheduler::Install(sched); |
|
73 |
|
74 CGfxTransTestServer* server = NULL; |
|
75 // Create the CTestServer derived server |
|
76 TRAPD(err,server = CGfxTransTestServer::NewL()); |
|
77 if(!err) |
|
78 { |
|
79 // Sync with the client and enter the active scheduler |
|
80 RProcess::Rendezvous(KErrNone); |
|
81 sched->Start(); |
|
82 } |
|
83 delete server; |
|
84 delete sched; |
|
85 } |
|
86 |
|
87 |
|
88 GLDEF_C TInt E32Main() |
|
89 /** |
|
90 @return - Standard Epoc error code on exit |
|
91 */ |
|
92 { |
|
93 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
94 if(cleanup == NULL) |
|
95 { |
|
96 return KErrNoMemory; |
|
97 } |
|
98 TRAP_IGNORE(MainL()); |
|
99 delete cleanup; |
|
100 return KErrNone; |
|
101 } |