commonuisupport/uikon/test/tuiktestserver/uiktestserver.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 // Copyright (c) 2005-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 // uiktetestserver.CPP
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent - Internal Symbian test code 
       
    21 */
       
    22 
       
    23 #include <basched.h>
       
    24 #include <eikenv.h>
       
    25 #include <eikappui.h>
       
    26 #include <techview/eikon.hrh>
       
    27 #include <eikapp.h>
       
    28 #include <eikdoc.h>
       
    29 #include <techview/eiklabel.h>
       
    30 #include <eikfctry.h>
       
    31 #include <coecntrl.h>
       
    32 #include <barsread.h>
       
    33 #include <techview/eiktbar.h>
       
    34 #include <techview/eikmenub.h>
       
    35 #include <eikspane.h>
       
    36 
       
    37 #include "appfwk_test_AppUi.h"
       
    38 #include "uiktestserver.h"
       
    39 #include "Taddlib.h"
       
    40 #include "tspane.h"
       
    41 #include "Tmsg.h"
       
    42 #include "thlsprite.h"
       
    43 #include "tbrdrcol.h"
       
    44 #include "tbackup.h"
       
    45 #include "tnotdial.h"
       
    46 #include "Tcolscm.h"
       
    47 #include "TCOLOVRStep.h"
       
    48 #include "terrorStep.h"
       
    49 #include "TpackageStarter.h"
       
    50 #include "tshutter.h"
       
    51 #include "Tautolib.h"
       
    52 #include "tfileutils.h"
       
    53 #include "teikenv.h"
       
    54 #include "T_FocusStep.h"
       
    55 #include "T_NonFocusStep.h"
       
    56 #include "T_ParentStep.h"
       
    57 #include "TCapability1.h"
       
    58 #include "TCapability2.h"
       
    59 #include "TSysColor.h"
       
    60 #include "TDisableExitChecksStep.h"
       
    61 
       
    62 
       
    63 #include "TAppLangStarter.h"
       
    64 #include "TAppLangFrenchStarter.h"
       
    65 #include "TAppLangZuluStarter.h"
       
    66 #include "TAppLangNotSetStarter.h"
       
    67 #include "TAppLangScStarter.h"
       
    68 
       
    69 
       
    70 CUiktestServer* CUiktestServer::NewL()
       
    71 	{
       
    72 	CUiktestServer * server = new (ELeave) CUiktestServer();
       
    73 	CleanupStack::PushL(server);
       
    74 	// CServer base class call
       
    75 	TParsePtrC serverName(RProcess().FileName());	
       
    76 	server->StartL(serverName.Name());
       
    77 	CleanupStack::Pop(server);
       
    78 	return server;
       
    79 	}
       
    80 
       
    81 
       
    82 CTestStep* CUiktestServer::CreateTestStep(const TDesC& aStepName)
       
    83 	{
       
    84 	CTestStep* testStep = NULL;
       
    85 
       
    86 	// This server creates just one step but create as many as you want
       
    87 	// They are created "just in time" when the worker thread is created
       
    88 	if(aStepName == KTestAddLibraryStep)
       
    89 		{
       
    90 		testStep = new CTestAddLibraryStep();
       
    91 		}
       
    92 	else if(aStepName == KTestAutoLibStep)
       
    93 		{
       
    94 		testStep = new CTestAutoLibStep();
       
    95 		}
       
    96 	else if(aStepName == KTestSpaneStep)
       
    97 		{
       
    98 		testStep = new CTestSpaneStep();
       
    99 		}
       
   100 	else if(aStepName == KTestMsgStep)
       
   101 		{
       
   102 		testStep = new CTestMsgStep();
       
   103 		}
       
   104 	else if(aStepName == KHlSpriteStep)
       
   105 		{
       
   106 		testStep = new CTestThlspriteStep();
       
   107 		}
       
   108 	else if(aStepName == KTestBrdrColStep)
       
   109 		{
       
   110 		testStep = new CTestBrdrColStep();
       
   111 		}
       
   112 	else if(aStepName == KTestBackupStep)
       
   113 		{
       
   114 		testStep = new CTestBackupStep();
       
   115 		}
       
   116 	else if(aStepName == KTestColscmStep)
       
   117 		{
       
   118 		testStep = new CTestColscmStep();
       
   119 		}
       
   120 	else if(aStepName == KTestPackageStep)
       
   121 		{
       
   122 		testStep = new CTestPackageStep();
       
   123 		}
       
   124 	else if(aStepName == KTColOvrStep)
       
   125 		{
       
   126 		testStep = new CTColOvrStep();
       
   127 		}
       
   128 	else if(aStepName == KTErrorStep)
       
   129 		{
       
   130 		testStep = new CTErrorStep();
       
   131 		}
       
   132 	else if(aStepName == KTShutter)
       
   133 		{
       
   134 		testStep = new CTShutter();
       
   135 		}
       
   136 	else if(aStepName == KTNotdialStep)
       
   137 		{
       
   138 		testStep = new CTNotdialStep();
       
   139 		}
       
   140 	else if(aStepName == KFileUtilsStep)
       
   141 		{
       
   142 		testStep = new CFileUtilsStep();
       
   143 		}
       
   144 	else if(aStepName == KEikEnvStep)
       
   145 		{
       
   146 		testStep = new CEikEnvStep();
       
   147 		}
       
   148 	else if (aStepName == KTestApplicationLanguageStep)
       
   149 		{
       
   150 		testStep = new CTestApplicationLanguageStep();
       
   151 		}
       
   152 	else if (aStepName == KTestApplicationLanguageFrenchStep)
       
   153 		{
       
   154 		testStep = new CTestApplicationLanguageFrenchStep();
       
   155 		}
       
   156 	else if (aStepName == KTestApplicationLanguageZuluStep)
       
   157 		{
       
   158 		testStep = new CTestApplicationLanguageZuluStep();
       
   159 		}
       
   160 	else if (aStepName == KTestApplicationLanguageNotSetStep)
       
   161 		{
       
   162 		testStep = new CTestApplicationLanguageNotSetStep();
       
   163 		}
       
   164 	else if (aStepName == KTestApplicationLanguageSCStep)
       
   165 		{
       
   166 		testStep = new CTestApplicationLanguageSCStep();
       
   167 		}
       
   168 	else if (aStepName == KTestFocusStep)
       
   169 		{
       
   170 		testStep = new CTestFocusStep();
       
   171 		}
       
   172 	else if (aStepName == KTestNonFocusStep)
       
   173 		{
       
   174 		testStep = new CTestNonFocusStep();
       
   175 		}
       
   176 	else if (aStepName == KTestParentStep)
       
   177 		{
       
   178 		testStep = new CTestParentStep();
       
   179 		}
       
   180 	else if	(aStepName == KTCapability1Step)
       
   181 		{
       
   182 		testStep = new CTCapability1Step();
       
   183 		}
       
   184 	else if	(aStepName == KTCapability2Step)
       
   185 		{
       
   186 		testStep = new CTCapability2Step();
       
   187 		}
       
   188 	else if	(aStepName == KTSysColorStep)
       
   189 		{
       
   190 		testStep = new CTSysColorStep();
       
   191 		}
       
   192 	else if	(aStepName == KTDisableExitChecksStep)
       
   193 		{
       
   194 		testStep = new CTDisableExitChecksStep();
       
   195 		}
       
   196 	return testStep;
       
   197 	}
       
   198 
       
   199 
       
   200 LOCAL_C void MainL()
       
   201 	{
       
   202 	// Leave the hooks in for platform security
       
   203 	CActiveScheduler* sched=NULL;
       
   204 	sched=new(ELeave) CActiveScheduler;
       
   205 	CActiveScheduler::Install(sched);
       
   206 
       
   207 	CUiktestServer* server = NULL;
       
   208 	// Create the CTestServer derived server
       
   209 	TRAPD(err,server = CUiktestServer::NewL());
       
   210 	if(!err)
       
   211 		{
       
   212 		// Sync with the client and enter the active scheduler
       
   213 		RProcess::Rendezvous(KErrNone);
       
   214 		sched->Start();
       
   215 		}
       
   216 	delete server;
       
   217 	delete sched;
       
   218 	}
       
   219 
       
   220 
       
   221 GLDEF_C TInt E32Main()
       
   222 /**
       
   223    @return - Standard Epoc error code on exit
       
   224  */
       
   225 	{
       
   226 	CTrapCleanup* cleanup = CTrapCleanup::New();
       
   227 	if(cleanup == NULL)
       
   228 		{
       
   229 		return KErrNoMemory;
       
   230 		}
       
   231 	TRAP_IGNORE(MainL());
       
   232 	delete cleanup;
       
   233 	return KErrNone;
       
   234     }