os/graphics/egl/egltest/src/egltestcommonstep.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file
sl@0
    18
 @test
sl@0
    19
*/
sl@0
    20
sl@0
    21
#include <test/tefunit.h> // for ASSERT macros
sl@0
    22
#include <iniparser.h>
sl@0
    23
#include <apgtask.h>
sl@0
    24
#include <e32math.h>
sl@0
    25
#include <e32msgqueue.h> 
sl@0
    26
sl@0
    27
#include "egltestcommonstep.h"
sl@0
    28
#include "egltestcommonsession.h"
sl@0
    29
#include "egltestcommonutils.h"
sl@0
    30
#include "egltestcommonprocess.h"
sl@0
    31
sl@0
    32
static const TUint KDefaultHeapSize = 0x100000;
sl@0
    33
CEglTestStep::TThreadStatus::TThreadStatus()
sl@0
    34
    {
sl@0
    35
    for(TInt i=0; i<ESize; i++)
sl@0
    36
        {
sl@0
    37
        iStatus[i] = 0;
sl@0
    38
        }
sl@0
    39
    }
sl@0
    40
sl@0
    41
EXPORT_C CEglTestStep::CEglTestStep() : 
sl@0
    42
    iWaitForCompletionOnPostamble(EFalse),
sl@0
    43
	iSourceFormat(KDefaultSourceFormat),
sl@0
    44
	iSurfaceFormat(KDefaultSurfaceFormat)
sl@0
    45
	{
sl@0
    46
	}
sl@0
    47
sl@0
    48
EXPORT_C CEglTestStep::~CEglTestStep()
sl@0
    49
	{
sl@0
    50
	for (TInt i=0; i<KMaxProcessNumber; i++)
sl@0
    51
		{
sl@0
    52
		iProcessStatus[i].iProcess.Close();
sl@0
    53
		}
sl@0
    54
	TInt countThread = iThreadStatus.Count();
sl@0
    55
	for (TInt i=0; i<countThread; i++)
sl@0
    56
		{
sl@0
    57
		iThreadStatus[i].iThread.Close();
sl@0
    58
		}
sl@0
    59
	iThreadStatus.Close();
sl@0
    60
sl@0
    61
    iSemaphore[0].Close();
sl@0
    62
    iSemaphore[1].Close();
sl@0
    63
  
sl@0
    64
    CleanAll();
sl@0
    65
    CloseWsSession();
sl@0
    66
	}
sl@0
    67
sl@0
    68
EXPORT_C TVerdict CEglTestStep::doTestStepPreambleL()
sl@0
    69
	{
sl@0
    70
	User::LeaveIfError(Logger().ShareAuto());
sl@0
    71
	//When EGL Logging is enabled this causes a file server session to be allocated
sl@0
    72
	//Which needs to be done before any handle checks otherwise the test will fail
sl@0
    73
	ASSERT_EGL_TRUE(eglReleaseThread());	
sl@0
    74
	__UHEAP_MARK;
sl@0
    75
	HandleMark();
sl@0
    76
	return TestStepResult();
sl@0
    77
	}
sl@0
    78
sl@0
    79
EXPORT_C TVerdict CEglTestStep::doTestStepPostambleL()
sl@0
    80
	{
sl@0
    81
	if(iWaitForCompletionOnPostamble && (iThreadStatus.Count() > 0))
sl@0
    82
        {
sl@0
    83
        INFO_PRINTF1(_L("Main thread waits for other threads to be terminated!!"));
sl@0
    84
        Test_MultiThread_WaitL(ETrue, TThreadStatus::ELogin);
sl@0
    85
        }	
sl@0
    86
	
sl@0
    87
	if (iDisplay != EGL_NO_DISPLAY)
sl@0
    88
		{
sl@0
    89
		// Output a warning because this should be done by the test
sl@0
    90
		WARN_PRINTF1(_L("Terminating Display during doTestStepPostambleL"));
sl@0
    91
		ASSERT_EGL_TRUE(eglTerminate(iDisplay));
sl@0
    92
		iDisplay = EGL_NO_DISPLAY;
sl@0
    93
		}
sl@0
    94
sl@0
    95
	ASSERT_EGL_TRUE(eglReleaseThread());
sl@0
    96
sl@0
    97
	HandleMarkEnd();
sl@0
    98
 	__UHEAP_MARKEND;
sl@0
    99
	return TestStepResult();
sl@0
   100
	}
sl@0
   101
sl@0
   102
EXPORT_C void CEglTestStep::CleanAll()
sl@0
   103
	{
sl@0
   104
	delete iEglSess;
sl@0
   105
	iEglSess = NULL;
sl@0
   106
	
sl@0
   107
	if (iDisplay != EGL_NO_DISPLAY)
sl@0
   108
		{
sl@0
   109
		ASSERT_EGL_TRUE(eglTerminate(iDisplay));
sl@0
   110
		iDisplay = EGL_NO_DISPLAY;
sl@0
   111
		}
sl@0
   112
	ASSERT_EGL_TRUE(eglReleaseThread());
sl@0
   113
	}
sl@0
   114
sl@0
   115
/*****************************************************************************
sl@0
   116
 ** Utility methods
sl@0
   117
 *****************************************************************************/
sl@0
   118
sl@0
   119
void CEglTestStep::HandleMark()
sl@0
   120
	{
sl@0
   121
	RThread().HandleCount(iProcHandleMark, iThreadHandleMark);
sl@0
   122
	INFO_PRINTF3(_L("MARK: (%d) process-owned handle(s) / (%d) thread-owned handle(s)"), iProcHandleMark, iThreadHandleMark);
sl@0
   123
	}
sl@0
   124
sl@0
   125
void CEglTestStep::HandleMarkEnd()
sl@0
   126
	{
sl@0
   127
	RThread().HandleCount(iProcHandleMarkEnd, iThreadHandleMarkEnd);
sl@0
   128
	INFO_PRINTF3(_L("MARK-END: (%d) process-owned handle(s) / (%d) thread-owned handle(s)"), iProcHandleMarkEnd, iThreadHandleMarkEnd);
sl@0
   129
#ifdef __WINS__
sl@0
   130
	WARN_PRINTF1(_L("Process-owned handle test is ignored on WINS build due to Pls() behaviour."));
sl@0
   131
#endif
sl@0
   132
	// When using Pls() on WINS build, it inteferes with handle count assert here due to Pls() behaviour which initialises PLS object
sl@0
   133
	// on first call of Pls() rather than during DLL loading, which cause extra count into iProcHandleMark.
sl@0
   134
	// ARMV5 build does not suffer this problem as proper WSD support is used.
sl@0
   135
#ifndef __WINS__
sl@0
   136
	ASSERT_EQUALS(iProcHandleMarkEnd, iProcHandleMark);
sl@0
   137
#endif
sl@0
   138
	ASSERT_EQUALS(iThreadHandleMarkEnd, iThreadHandleMark);
sl@0
   139
	}
sl@0
   140
sl@0
   141
/** Initialises the window server session and window group objects. */
sl@0
   142
EXPORT_C void CEglTestStep::OpenWsSessionL(TInt aGroupId)
sl@0
   143
	{
sl@0
   144
	User::LeaveIfError(iWsSession.Connect());
sl@0
   145
	iWindowGroup = RWindowGroup(iWsSession);
sl@0
   146
	User::LeaveIfError(iWindowGroup.Construct(aGroupId));
sl@0
   147
	}
sl@0
   148
sl@0
   149
/** Uninitialises the window group object and the window server session. */
sl@0
   150
EXPORT_C void CEglTestStep::CloseWsSession()
sl@0
   151
	{
sl@0
   152
	iWindowGroup.Close();
sl@0
   153
	iWsSession.Close();
sl@0
   154
	}
sl@0
   155
sl@0
   156
/**
sl@0
   157
Uses the Eikon Environment to construct a window and put it on top.
sl@0
   158
@param aWindow A non-constructed window object
sl@0
   159
@param aRect The intial position and size of the window
sl@0
   160
@leave Standard system errors
sl@0
   161
*/
sl@0
   162
EXPORT_C void CEglTestStep::ConstructWindowL(RWindow& aWindow, const TRect& aRect)
sl@0
   163
	{
sl@0
   164
	INFO_PRINTF1(_L("CEglTestStep::CreateWindowL()"));
sl@0
   165
sl@0
   166
	const TUint32 ENullWsHandle = 0xFFFFFFFF;	// Events delivered to this handle are thrown away
sl@0
   167
	aWindow = RWindow(iWsSession);
sl@0
   168
	CleanupClosePushL(aWindow);
sl@0
   169
	User::LeaveIfError(aWindow.Construct(iWindowGroup, ENullWsHandle));
sl@0
   170
	aWindow.SetExtent(aRect.iTl, aRect.Size());
sl@0
   171
	aWindow.Activate();
sl@0
   172
	CleanupStack::Pop(&aWindow);
sl@0
   173
	}
sl@0
   174
sl@0
   175
/**
sl@0
   176
Prints both the Source pixel format and the target pixel format
sl@0
   177
*/
sl@0
   178
EXPORT_C void CEglTestStep::PrintUsedPixelConfiguration()
sl@0
   179
	{
sl@0
   180
	INFO_PRINTF1(_L("******UsedPixelConfiguration******"));
sl@0
   181
	INFO_PRINTF1(_L("Source Pixel Format"));
sl@0
   182
	PrintPixelFormat(iSourceFormat);	
sl@0
   183
	
sl@0
   184
	INFO_PRINTF1(_L("Target Format"));
sl@0
   185
	PrintVGImageFormat(iSurfaceFormat);
sl@0
   186
	INFO_PRINTF1(_L("**********************************"));
sl@0
   187
	}
sl@0
   188
sl@0
   189
EXPORT_C void CEglTestStep::PrintPixelFormat(TUidPixelFormat aFormat)
sl@0
   190
	{
sl@0
   191
	switch(aFormat)
sl@0
   192
		{
sl@0
   193
        case EUidPixelFormatA_8:
sl@0
   194
            INFO_PRINTF1(_L("EUidPixelFormatA_8"));
sl@0
   195
            break;
sl@0
   196
		case EUidPixelFormatRGB_565:
sl@0
   197
			INFO_PRINTF1(_L("EUidPixelFormatRGB_565"));
sl@0
   198
			break;
sl@0
   199
		case EUidPixelFormatXRGB_8888:
sl@0
   200
			INFO_PRINTF1(_L("EUidPixelFormatXRGB_8888"));
sl@0
   201
			break;
sl@0
   202
		case EUidPixelFormatARGB_8888:
sl@0
   203
			INFO_PRINTF1(_L("EUidPixelFormatARGB_8888"));
sl@0
   204
			break;
sl@0
   205
		case EUidPixelFormatARGB_8888_PRE:
sl@0
   206
			INFO_PRINTF1(_L("EUidPixelFormatARGB_8888_PRE"));
sl@0
   207
			break;
sl@0
   208
		default:
sl@0
   209
			ERR_PRINTF2(_L("Unsupported pixel format (%d)"), aFormat);
sl@0
   210
			ASSERT_TRUE(EFalse);
sl@0
   211
		}
sl@0
   212
	}
sl@0
   213
sl@0
   214
EXPORT_C void CEglTestStep::PrintVGImageFormat(VGImageFormat aAttr)
sl@0
   215
	{
sl@0
   216
	switch(aAttr)
sl@0
   217
		{
sl@0
   218
		case VG_sRGB_565:
sl@0
   219
			INFO_PRINTF1(_L("VG_sRGB_565"));
sl@0
   220
			break;
sl@0
   221
		case VG_sXRGB_8888:
sl@0
   222
			INFO_PRINTF1(_L("VG_sXRGB_8888"));
sl@0
   223
			break;
sl@0
   224
		case VG_sARGB_8888:
sl@0
   225
			INFO_PRINTF1(_L("VG_sARGB_8888"));
sl@0
   226
			break;
sl@0
   227
		case VG_sARGB_8888_PRE:
sl@0
   228
			INFO_PRINTF1(_L("VG_sARGB_8888_PRE"));
sl@0
   229
			break;
sl@0
   230
		default:
sl@0
   231
			ERR_PRINTF2(_L("Unsupported VGImage format (%d)"), aAttr);
sl@0
   232
			ASSERT_TRUE(EFalse);
sl@0
   233
		}
sl@0
   234
	}
sl@0
   235
sl@0
   236
sl@0
   237
/*****************************************************************************
sl@0
   238
 ** Multiprocess test utils
sl@0
   239
 *****************************************************************************/
sl@0
   240
sl@0
   241
/**
sl@0
   242
Launches the specified number of processes, where each process will perform the actions specified in 
sl@0
   243
the doProcessFunctionL of the calling test. As no images TSgDrawableId has been passed, an 
sl@0
   244
an array of one (NULL) TSgDrawableId will be created.
sl@0
   245
@param aProcessCount Number of processes
sl@0
   246
@param aTestName Name of the calling test case (so that it can call it's doProcessFunctionL method 
sl@0
   247
@leave Standard system errors
sl@0
   248
*/  
sl@0
   249
EXPORT_C void CEglTestStep::Test_MultiProcessL(const TDesC& aTestDllName, TInt aProcessCount, const TDesC& aTestStepName)
sl@0
   250
	{
sl@0
   251
	TSgDrawableId sgId;
sl@0
   252
	Mem::FillZ(&sgId, sizeof(TSgDrawableId));
sl@0
   253
	Test_MultiProcessL(aTestDllName, aProcessCount, aTestStepName, sgId);
sl@0
   254
	}
sl@0
   255
sl@0
   256
/**
sl@0
   257
Launches the specified number of processes, where each process will perform the actions specified in 
sl@0
   258
the doProcessFunctionL of the calling test.
sl@0
   259
@param aProcessCount Number of processes
sl@0
   260
@param aTestName Name of the calling test case (so that it can call it's doProcessFunctionL method 
sl@0
   261
@param aSgId Images TSgDrawableId which will be used to create an array of one TSgDrawableId
sl@0
   262
@leave Standard system errors
sl@0
   263
*/  
sl@0
   264
EXPORT_C void CEglTestStep::Test_MultiProcessL(const TDesC& aTestDllName, TInt aProcessCount, const TDesC& aTestStepName, const TSgDrawableId& aSgId)
sl@0
   265
	{
sl@0
   266
	// we assume we pass the same Id to all the processes (array of one)
sl@0
   267
	RArray<TSgDrawableId> sgIdList;
sl@0
   268
	ASSERT_EQUALS(sgIdList.Insert(aSgId,0), KErrNone);
sl@0
   269
	Test_MultiProcessL(aTestDllName, aProcessCount, aTestStepName, sgIdList);
sl@0
   270
	sgIdList.Close();
sl@0
   271
	}
sl@0
   272
sl@0
   273
/**
sl@0
   274
Launches the specified number of processes, where each process will perform the actions specified in 
sl@0
   275
the doProcessFunctionL of the calling test. The association of images and processes is done via the
sl@0
   276
predefined ImageIndexFromProcessId() method.
sl@0
   277
@param aProcessCount Number of processes
sl@0
   278
@param aTestName Name of the calling test case (so that it can call it's doProcessFunctionL method 
sl@0
   279
@param aSgIdList Array containing the list of images' TSgDrawableId 
sl@0
   280
@leave Standard system errors
sl@0
   281
*/  
sl@0
   282
EXPORT_C void CEglTestStep::Test_MultiProcessL(const TDesC& aTestDllName, TInt aProcessCount, const TDesC& aTestStepName, const RArray<TSgDrawableId>& aSgIdList)
sl@0
   283
	{
sl@0
   284
	TInt imageCount = aSgIdList.Count();
sl@0
   285
	if(aProcessCount <= 0 || imageCount <=0 || aProcessCount > KMaxProcessNumber || imageCount > aProcessCount)
sl@0
   286
		{
sl@0
   287
		ERR_PRINTF1(_L("Invalid process request!"));
sl@0
   288
		User::Leave(KErrArgument);
sl@0
   289
		}
sl@0
   290
sl@0
   291
    // create MsgQueue (only used in some test to pass data between 2 processes)
sl@0
   292
	RMsgQueue<TSgDrawableId> messageQueueSgId;
sl@0
   293
	TInt ret = messageQueueSgId.CreateGlobal(KNullDesC, 1, EOwnerProcess);
sl@0
   294
	ASSERT_EQUALS(ret, KErrNone);
sl@0
   295
	CleanupClosePushL(messageQueueSgId);
sl@0
   296
sl@0
   297
	RMsgQueue<TProcessId> messageQueueProcId;
sl@0
   298
	ret = messageQueueProcId.CreateGlobal(KNullDesC, 1, EOwnerProcess);
sl@0
   299
	ASSERT_EQUALS(ret, KErrNone);
sl@0
   300
	CleanupClosePushL(messageQueueProcId);
sl@0
   301
sl@0
   302
    // Create semphores that can be shared (only used in some test to synch between 2 process)
sl@0
   303
    ret = iSemaphore[0].CreateGlobal(KNullDesC(), 0, EOwnerProcess);
sl@0
   304
    ASSERT_EQUALS(ret, KErrNone);
sl@0
   305
    ret = iSemaphore[1].CreateGlobal(KNullDesC(), 0, EOwnerProcess);
sl@0
   306
    ASSERT_EQUALS(ret, KErrNone);
sl@0
   307
sl@0
   308
    // create MsgQueue (only used in some tests to pass data from client processes to the main process)
sl@0
   309
    RMsgQueue<TEglStepMessageBuffer> messageQueueClientProcParam;
sl@0
   310
    ret = messageQueueClientProcParam.CreateGlobal(KNullDesC, 1, EOwnerProcess);
sl@0
   311
    ASSERT_EQUALS(ret, KErrNone);
sl@0
   312
    CleanupClosePushL(messageQueueClientProcParam);
sl@0
   313
    
sl@0
   314
	for (TInt i=0; i<aProcessCount; i++)
sl@0
   315
		{
sl@0
   316
		TProcessInfo info;
sl@0
   317
		info.iIdx=i;
sl@0
   318
		info.iSgId=	aSgIdList[ImageIndexFromProcessId(i, imageCount)];
sl@0
   319
sl@0
   320
		ret = iProcessStatus[i].iProcess.Create(KEglTestServerWrapperProcess, KNullDesC);
sl@0
   321
		User::LeaveIfError(ret);
sl@0
   322
      
sl@0
   323
		// Specify the test for the process
sl@0
   324
		ret = iProcessStatus[i].iProcess.SetParameter(EProcSlotTestDllName, aTestDllName);
sl@0
   325
		User::LeaveIfError(ret);
sl@0
   326
		ret = iProcessStatus[i].iProcess.SetParameter(EProcSlotTestStepName, aTestStepName);
sl@0
   327
		User::LeaveIfError(ret);	
sl@0
   328
        
sl@0
   329
		// Specify the non-handle params passed to the process
sl@0
   330
		TPckg<TProcessInfo> pckgInfo(info);
sl@0
   331
		ret = iProcessStatus[i].iProcess.SetParameter(EProcSlotParams, pckgInfo);
sl@0
   332
		User::LeaveIfError(ret);
sl@0
   333
sl@0
   334
		// Pass in the semaphores
sl@0
   335
		ret = iProcessStatus[i].iProcess.SetParameter(EProcSlotSemaphore0, iSemaphore[0]);
sl@0
   336
		User::LeaveIfError(ret);
sl@0
   337
		ret = iProcessStatus[i].iProcess.SetParameter(EProcSlotSemaphore1, iSemaphore[1]);
sl@0
   338
		User::LeaveIfError(ret);
sl@0
   339
		ret = iProcessStatus[i].iProcess.SetParameter(EProcSlotMsgQueueSgId, messageQueueSgId);
sl@0
   340
		User::LeaveIfError(ret);
sl@0
   341
		ret = iProcessStatus[i].iProcess.SetParameter(EProcSlotMsgQueueProcId, messageQueueProcId);
sl@0
   342
		User::LeaveIfError(ret);
sl@0
   343
		ret = iProcessStatus[i].iProcess.SetParameter(EProcSlotSourceFormat, static_cast<TInt>(iSourceFormat));
sl@0
   344
		User::LeaveIfError(ret);
sl@0
   345
		ret = iProcessStatus[i].iProcess.SetParameter(EProcSlotSurfaceFormat, static_cast<TInt>(iSurfaceFormat));
sl@0
   346
		User::LeaveIfError(ret);
sl@0
   347
        ret = iProcessStatus[i].iProcess.SetParameter(EProcSlotCustomClientParam, messageQueueClientProcParam);
sl@0
   348
        User::LeaveIfError(ret);
sl@0
   349
		
sl@0
   350
		iProcessStatus[i].iProcess.Logon(iProcessStatus[i].iStatus); 
sl@0
   351
		iProcessStatus[i].iProcess.Resume();
sl@0
   352
		}
sl@0
   353
    
sl@0
   354
	//by default an empty implementation
sl@0
   355
    ReceiveMessageFromClient(messageQueueClientProcParam);
sl@0
   356
sl@0
   357
	// wait for all processes to complete (not worried about the order)
sl@0
   358
	// This is needed, as the only way to determine whether the process step has failed is to check
sl@0
   359
	//  the return value (using TEST(EFalse) has no effect on the spawned process)
sl@0
   360
	for (TInt i=0; i<aProcessCount; i++)
sl@0
   361
		{
sl@0
   362
		User::WaitForRequest(iProcessStatus[i].iStatus);
sl@0
   363
		CheckProcessStatusL(i, iProcessStatus[i].iStatus, iProcessStatus[i].iProcess);
sl@0
   364
		RDebug::Print(_L(">>>>>(%d)>> status :%d"), i, iProcessStatus[i].iStatus.Int());
sl@0
   365
		iProcessStatus[i].iProcess.Close();
sl@0
   366
		}
sl@0
   367
sl@0
   368
	// close MsgQueue and semaphores (as used in some test with 2 spawned processes)
sl@0
   369
	CleanupStack::PopAndDestroy(3, &messageQueueSgId); //messageQueueClientProcParam, messageQueueProcId
sl@0
   370
	iSemaphore[1].Close();
sl@0
   371
	iSemaphore[0].Close();
sl@0
   372
	}
sl@0
   373
sl@0
   374
/**
sl@0
   375
Check the status of a process running as part of the current teststep. 
sl@0
   376
@param aIndex Index of the process
sl@0
   377
@param aStatus The request status of the process in question. 
sl@0
   378
@param aProcess The process object itself.  
sl@0
   379
@leave Standard system errors
sl@0
   380
*/  
sl@0
   381
void CEglTestStep::CheckProcessStatusL(TInt aIndex, const TRequestStatus& aStatus, const RProcess& aProcess)
sl@0
   382
	{
sl@0
   383
	TInt status = aStatus.Int();
sl@0
   384
	if (status == KErrNone)
sl@0
   385
		{
sl@0
   386
		return;
sl@0
   387
		}
sl@0
   388
	if (status == KRequestPending)
sl@0
   389
		{
sl@0
   390
		// If the process is still running, that's an error, as we waited for the status  
sl@0
   391
		ERR_PRINTF2(_L("Error in process %d - status should not be KRequestPending"), aIndex);
sl@0
   392
		User::Leave(KErrTEFUnitFail);
sl@0
   393
		}
sl@0
   394
	// Something went wrong
sl@0
   395
	switch (aProcess.ExitType())
sl@0
   396
		{
sl@0
   397
		case EExitPanic:		// The thread or process has been panicked.
sl@0
   398
			{
sl@0
   399
			TPtrC ptrExitCategory = aProcess.ExitCategory();
sl@0
   400
			ERR_PRINTF4(_L("Panic in process %d - category:[%S] reason: %d"), aIndex, &ptrExitCategory, aProcess.ExitReason());
sl@0
   401
			// Propagate the panic
sl@0
   402
			User::Panic(aProcess.ExitCategory(), aProcess.ExitReason());
sl@0
   403
			}
sl@0
   404
			// follow through
sl@0
   405
		case EExitKill: 		// The thread or process has ended as a result of a kill, i.e. Kill() has been called on the RThread or RProcess handle. Or a thread was ended as a result of calling User::Exit(). 
sl@0
   406
		case EExitTerminate: 	// The thread or process has ended as a result of a terminate, i.e. Terminate() has been called on the RThread or RProcess handle. 
sl@0
   407
		case EExitPending:		// The thread or process is alive. 
sl@0
   408
		default:
sl@0
   409
			// Propagate the error
sl@0
   410
			ERR_PRINTF3(_L("Error in process %d - code %d"), aIndex, aStatus.Int());
sl@0
   411
			User::Leave(aStatus.Int());
sl@0
   412
		}
sl@0
   413
	ASSERT(0);
sl@0
   414
	}
sl@0
   415
sl@0
   416
sl@0
   417
/*****************************************************************************
sl@0
   418
 ** Multithread test utils
sl@0
   419
 *****************************************************************************/
sl@0
   420
sl@0
   421
/**
sl@0
   422
Launches the specified number of threads, where each thread will perform the actions specified in 
sl@0
   423
the doThreadFunctionL of the calling test. 
sl@0
   424
@param aThreadCount Number of threads
sl@0
   425
@param aWaitForCompletion To wait until the launched thread has completed 
sl@0
   426
@leave Standard system errors
sl@0
   427
*/  
sl@0
   428
EXPORT_C void CEglTestStep::Test_MultiThreadL(TInt aThreadCount, TBool aWaitForCompletion)
sl@0
   429
	{
sl@0
   430
	if(aThreadCount <= 0 || aThreadCount > KMaxThreadNumber)
sl@0
   431
		{
sl@0
   432
		ERR_PRINTF1(_L("Invalid thread request!"));
sl@0
   433
		User::Leave(KErrArgument);
sl@0
   434
		}
sl@0
   435
sl@0
   436
	iWaitForCompletionOnPostamble = !aWaitForCompletion;
sl@0
   437
	
sl@0
   438
	//we just care for these 2 semaphores
sl@0
   439
	ASSERT_EQUALS(iSemaphore[0].CreateLocal(0, EOwnerProcess), KErrNone);
sl@0
   440
	ASSERT_EQUALS(iSemaphore[1].CreateLocal(0, EOwnerProcess), KErrNone);
sl@0
   441
	
sl@0
   442
	_LIT(KThread, "CEglTestStep_Thread");
sl@0
   443
	_LIT(KUnderScore, "_");
sl@0
   444
 	
sl@0
   445
	TInt ret = KErrNone;
sl@0
   446
	ASSERT_EQUALS(iThreadStatus.Count(),0);
sl@0
   447
	// Reserve space to avoid reallocation of iThreadStatus.iStatus
sl@0
   448
	iThreadStatus.ReserveL(aThreadCount);
sl@0
   449
	for (TInt i=0; i<aThreadCount; i++)	
sl@0
   450
		{
sl@0
   451
		iThreadInfos[i].iSelf=this;
sl@0
   452
		iThreadInfos[i].iIdx=i;
sl@0
   453
 
sl@0
   454
		TTime tm;
sl@0
   455
		TBuf<32> bufTime;
sl@0
   456
		tm.UniversalTime();
sl@0
   457
	    tm.FormatL(bufTime, _L("_%H%T%S%C_"));
sl@0
   458
sl@0
   459
		// guaranteed unique thread name (useful if several threads are created with aWaitForCompletion = false)
sl@0
   460
		TName threadName(KThread);
sl@0
   461
		threadName.Append(KUnderScore);
sl@0
   462
		threadName.AppendNum(i, EDecimal);
sl@0
   463
		threadName.Append(KUnderScore);
sl@0
   464
		threadName.Append(bufTime); 
sl@0
   465
	    threadName.AppendNum(Math::Random(), EHex);
sl@0
   466
sl@0
   467
	    iThreadStatus.AppendL(TThreadStatus());
sl@0
   468
		ret = iThreadStatus[i].iThread.Create(threadName, ThreadFunction, KDefaultStackSize, KMinHeapSize, KDefaultHeapSize, &iThreadInfos[i], EOwnerProcess);
sl@0
   469
		User::LeaveIfError(ret);
sl@0
   470
sl@0
   471
		if(!aWaitForCompletion)
sl@0
   472
			{
sl@0
   473
			// We want to wait for the notification that the extra thread is about to be launched
sl@0
   474
			// Improves timing issues within a hardware WDP environment
sl@0
   475
			iThreadStatus[i].iThread.Rendezvous(iThreadStatus[i].iStatus[TThreadStatus::ERendezvous]);
sl@0
   476
			}
sl@0
   477
		iThreadStatus[i].iThread.Logon(iThreadStatus[i].iStatus[TThreadStatus::ELogin]);
sl@0
   478
		iThreadStatus[i].iThread.Resume();
sl@0
   479
		}
sl@0
   480
    Test_MultiThread_WaitL(aWaitForCompletion, aWaitForCompletion ? TThreadStatus::ELogin : TThreadStatus::ERendezvous);
sl@0
   481
   	}
sl@0
   482
sl@0
   483
EXPORT_C void CEglTestStep::Test_MultiThread_WaitL(TBool aCloseThreads, TThreadStatus::TStatusId aStatusId)
sl@0
   484
    {
sl@0
   485
    // Close handles and wait for all threads to complete (not worried about the order). Note that some 
sl@0
   486
    //   tests do not require to wait for completion. Nevertheless, care should be taken to ensure that the 
sl@0
   487
    //   spawned thread is capable of modifying the main TEF process TestStepResult.
sl@0
   488
       
sl@0
   489
    TInt countThread = iThreadStatus.Count();
sl@0
   490
    for (TInt i=0; i<countThread; i++)
sl@0
   491
        {
sl@0
   492
        User::WaitForRequest(iThreadStatus[i].iStatus[aStatusId]);
sl@0
   493
        CheckThreadStatusL(i, iThreadStatus[i].iStatus[aStatusId], iThreadStatus[i].iThread);
sl@0
   494
        INFO_PRINTF3(_L(">>>>>(%d)>> status :%d"), i, iThreadStatus[i].iStatus[aStatusId].Int());
sl@0
   495
sl@0
   496
        if(aCloseThreads)
sl@0
   497
            {
sl@0
   498
            iThreadStatus[i].iThread.Close();
sl@0
   499
            }
sl@0
   500
        }
sl@0
   501
    if(aCloseThreads)
sl@0
   502
        {
sl@0
   503
        iThreadStatus.Reset();
sl@0
   504
sl@0
   505
        iSemaphore[0].Close();
sl@0
   506
        iSemaphore[1].Close();
sl@0
   507
        }
sl@0
   508
    }
sl@0
   509
sl@0
   510
/**
sl@0
   511
Check the status of a thread running as part of the current teststep. 
sl@0
   512
@param aIndex Index of the thread
sl@0
   513
@param aStatus The request status of the thread in question. 
sl@0
   514
@param aThread The thread object itself.  
sl@0
   515
@leave Standard system errors
sl@0
   516
*/ 
sl@0
   517
void CEglTestStep::CheckThreadStatusL(TInt aIndex, const TRequestStatus& aStatus, const RThread& aThread)
sl@0
   518
	{
sl@0
   519
	TInt status = aStatus.Int();
sl@0
   520
	if (status == KErrNone)
sl@0
   521
		{
sl@0
   522
		// All went well
sl@0
   523
		return;
sl@0
   524
		}
sl@0
   525
	if (status == KRequestPending)
sl@0
   526
		{
sl@0
   527
		// If the thread is still running, that's an error, as we waited for the status  
sl@0
   528
		ERR_PRINTF2(_L("Error in thread %d - status should not be KRequestPending"), aIndex);
sl@0
   529
		User::Leave(KErrTEFUnitFail);
sl@0
   530
		}
sl@0
   531
	// Something went wrong
sl@0
   532
	switch (aThread.ExitType())
sl@0
   533
		{
sl@0
   534
		case EExitPanic:		// The thread or process has been panicked.
sl@0
   535
			{
sl@0
   536
			TPtrC ptrExitCategory = aThread.ExitCategory();
sl@0
   537
			ERR_PRINTF4(_L("Panic in thread %d - category:[%S] reason: %d"), aIndex, &ptrExitCategory, aThread.ExitReason());
sl@0
   538
			User::Panic(aThread.ExitCategory(), aThread.ExitReason());
sl@0
   539
			}
sl@0
   540
			// follow through
sl@0
   541
		case EExitKill: 		// The thread or process has ended as a result of a kill, i.e. Kill() has been called on the RThread or RProcess handle. Or a thread was ended as a result of calling User::Exit(). 
sl@0
   542
		case EExitTerminate: 	// The thread or process has ended as a result of a terminate, i.e. Terminate() has been called on the RThread or RProcess handle. 
sl@0
   543
		case EExitPending:		// The thread or process is alive. 
sl@0
   544
		default:
sl@0
   545
			// Propagate the error
sl@0
   546
			ERR_PRINTF3(_L("Error in thread %d - code %d"), aIndex, status);
sl@0
   547
			User::Leave(aStatus.Int());
sl@0
   548
		}
sl@0
   549
	// We should not get here!
sl@0
   550
	ASSERT(0);
sl@0
   551
	}
sl@0
   552
sl@0
   553
TInt CEglTestStep::ThreadFunction(TAny* aInfo)
sl@0
   554
// static
sl@0
   555
	{
sl@0
   556
	__UHEAP_MARK;
sl@0
   557
	CTrapCleanup* cleanup = CTrapCleanup::New();
sl@0
   558
	if(cleanup == NULL)
sl@0
   559
		{
sl@0
   560
		return KErrNoMemory;
sl@0
   561
		}
sl@0
   562
sl@0
   563
	CEglTestStep::TThreadInfo* info = reinterpret_cast<CEglTestStep::TThreadInfo*>(aInfo);
sl@0
   564
	TRAPD(err, info->iSelf->ThreadFunctionL(*info));
sl@0
   565
sl@0
   566
	delete cleanup;
sl@0
   567
	__UHEAP_MARKEND;
sl@0
   568
	return err;
sl@0
   569
	}
sl@0
   570
sl@0
   571
void CEglTestStep::ThreadFunctionL(TThreadInfo& aInfo)
sl@0
   572
	{
sl@0
   573
	// Mark the handle count for this thread
sl@0
   574
	TInt processHandleMark=0;
sl@0
   575
	TInt threadHandleMark=0;
sl@0
   576
	RThread().HandleCount(processHandleMark, threadHandleMark);
sl@0
   577
	INFO_PRINTF4(_L("MARK: THREAD %d: (%d) process-owned handle(s) / (%d) thread-owned handle(s)"), aInfo.iIdx, processHandleMark, threadHandleMark);	
sl@0
   578
	
sl@0
   579
	// Notify the main thread that we are about to launch the extra thread
sl@0
   580
	RThread::Rendezvous(KErrNone);
sl@0
   581
	
sl@0
   582
	// Run the real thread funciton
sl@0
   583
	aInfo.iSelf->doThreadFunctionL(aInfo.iIdx);
sl@0
   584
sl@0
   585
	// Release EGL thread state
sl@0
   586
	INFO_PRINTF2(_L("thread %d: Calling eglReleaseThread()"), aInfo.iIdx);
sl@0
   587
	ASSERT_EGL_TRUE(eglReleaseThread());
sl@0
   588
	
sl@0
   589
	// Check the handle count for this thread has not changed
sl@0
   590
	TInt processHandleMarkEnd=0;
sl@0
   591
	TInt threadHandleMarkEnd=0;
sl@0
   592
	RThread().HandleCount(processHandleMarkEnd, threadHandleMarkEnd);
sl@0
   593
	INFO_PRINTF4(_L("MARK-END: THREAD %d: (%d) process-owned handle(s) / (%d) thread-owned handle(s)"), aInfo.iIdx, processHandleMarkEnd, threadHandleMarkEnd);
sl@0
   594
	
sl@0
   595
	//Not testing equality of process-owned handles as these should only be tested from the main thread.
sl@0
   596
	//Process handlecount is dependent on all threads, therefore process handle imbalances could be the responsibility of other threads.
sl@0
   597
	ASSERT_EQUALS(threadHandleMark, threadHandleMarkEnd);
sl@0
   598
	}
sl@0
   599
sl@0
   600
/**
sl@0
   601
Tests should override this method for multithreaded testing
sl@0
   602
*/
sl@0
   603
EXPORT_C void CEglTestStep::doThreadFunctionL(TInt aIdx)
sl@0
   604
	{
sl@0
   605
	// Not supported for this test step
sl@0
   606
	ERR_PRINTF2(_L("thread %d: Calling CEglTestStep::doThreadFunctionL() - should be overriden"), aIdx);
sl@0
   607
	User::Leave(KErrNotSupported);
sl@0
   608
	}
sl@0
   609
sl@0
   610
EXPORT_C void CEglTestStep::doThreadFunctionL(TInt aIdx,const TSgDrawableId& aSgId)
sl@0
   611
	{
sl@0
   612
	// Not supported for this test step
sl@0
   613
	ERR_PRINTF3(_L("thread %d: Calling CEglTestStep::doThreadFunctionL() - should be overriden, TSgDrawableId %lu."), aIdx, aSgId.iId);
sl@0
   614
	User::Leave(KErrNotSupported);
sl@0
   615
	}
sl@0
   616
sl@0
   617
/**
sl@0
   618
Tests should override this method for multiprocess testing
sl@0
   619
*/
sl@0
   620
EXPORT_C void CEglTestStep::doProcessFunctionL(TInt aIdx)
sl@0
   621
	{
sl@0
   622
	// Not supported for this test step
sl@0
   623
	ERR_PRINTF2(_L("Process %d: Calling CEglTestStep::doProcessFunctionL() - should be overriden"), aIdx);
sl@0
   624
	User::Leave(KErrNotSupported);
sl@0
   625
	}
sl@0
   626
sl@0
   627
EXPORT_C void CEglTestStep::doProcessFunctionL(TInt aIdx,const TSgDrawableId& aSgId)
sl@0
   628
	{
sl@0
   629
	// Not supported for this test step
sl@0
   630
	ERR_PRINTF3(_L("Process %d: Calling CEglTestStep::doProcessFunctionL() - should be overriden, TSgDrawableId %lu."), aIdx, aSgId.iId);
sl@0
   631
	User::Leave(KErrNotSupported);
sl@0
   632
	}
sl@0
   633
sl@0
   634
sl@0
   635
/**
sl@0
   636
Rendezvous: Ensures that both threads get to this point before continuing
sl@0
   637
@param aIdx The thread index value that was passed into
sl@0
   638
			the override of CEglTestStep::doThreadFunctionL()
sl@0
   639
*/
sl@0
   640
EXPORT_C void CEglTestStep::Rendezvous(TInt aIdx)
sl@0
   641
	{
sl@0
   642
	if(aIdx >= 2)
sl@0
   643
	    {
sl@0
   644
	    // Currently Rendezvous is only supported between threads with index 0 and index 1
sl@0
   645
	    INFO_PRINTF2(_L("CEglTestStep::Rendezvous() - aIdx (%d) is too big!!"), aIdx);
sl@0
   646
	    ASSERT(0);
sl@0
   647
	    }
sl@0
   648
	INFO_PRINTF2(_L("thread %d: ...At Rendezvous..."), aIdx);
sl@0
   649
	iSemaphore[aIdx].Signal();
sl@0
   650
	iSemaphore[1-aIdx].Wait();
sl@0
   651
	}
sl@0
   652
sl@0
   653
sl@0
   654
/*****************************************************************************
sl@0
   655
 ** Egl Helpers
sl@0
   656
 *****************************************************************************/
sl@0
   657
 
sl@0
   658
/**
sl@0
   659
Temporarily initializes the EGL thread and display in order to check for the 
sl@0
   660
supplied extension string.
sl@0
   661
The display is then released and terminated.
sl@0
   662
Use this method to pre-check for the existence of an extension string prior 
sl@0
   663
to starting a test.
sl@0
   664
There are 2 ways to ask for an extension, via the ID (the default way to do it) 
sl@0
   665
or passing a string containing the full name of the extension (used in some tests only)
sl@0
   666
@param aExtensions The extension ID to look for
sl@0
   667
@param aExtensionName The extension name to look for
sl@0
   668
@return Whether the extension string can be found
sl@0
   669
*/
sl@0
   670
EXPORT_C TBool CEglTestStep::CheckForExtensionL(TInt aExtensions, const TDesC& aExtensionName)
sl@0
   671
	{
sl@0
   672
	ASSERT_TRUE(iDisplay == EGL_NO_DISPLAY);
sl@0
   673
	GetDisplayL();
sl@0
   674
	CTestEglSession* eglSess = CTestEglSession::NewLC(Logger(), iDisplay, -1);
sl@0
   675
	eglSess->InitializeL();
sl@0
   676
	
sl@0
   677
	TBool bFoundExtensions = eglSess->CheckNeededExtensionL(aExtensions, aExtensionName);
sl@0
   678
	
sl@0
   679
	// Cleanup EGL Completely
sl@0
   680
	CleanupStack::PopAndDestroy(eglSess);
sl@0
   681
	eglSess = NULL;
sl@0
   682
	TerminateDisplayL();
sl@0
   683
	ASSERT_EGL_TRUE(eglReleaseThread());
sl@0
   684
sl@0
   685
	// return whether the extension string was found
sl@0
   686
	return bFoundExtensions;
sl@0
   687
	}
sl@0
   688
sl@0
   689
/**
sl@0
   690
Uses eglGetDisplay() to initialise iDisplay, and to check the result of the call
sl@0
   691
*/
sl@0
   692
EXPORT_C void CEglTestStep::GetDisplayL()
sl@0
   693
	{
sl@0
   694
	INFO_PRINTF1(_L("Calling eglGetDisplay..."));
sl@0
   695
	
sl@0
   696
	iDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
sl@0
   697
	ASSERT_EGL_TRUE(iDisplay != EGL_NO_DISPLAY);
sl@0
   698
	}
sl@0
   699
sl@0
   700
/**
sl@0
   701
If the iDisplay has been initialised then this method uses eglTerminate() 
sl@0
   702
to terminate iDisplay, and to check the result of the call.
sl@0
   703
This method also resets the value of iDisplay to EGL_NO_DISPLAY to indicate
sl@0
   704
that the display is no longer initialised.
sl@0
   705
*/
sl@0
   706
EXPORT_C void CEglTestStep::TerminateDisplayL()
sl@0
   707
	{
sl@0
   708
	if (iDisplay != EGL_NO_DISPLAY)
sl@0
   709
		{
sl@0
   710
		INFO_PRINTF1(_L("Calling eglTerminate..."));
sl@0
   711
		ASSERT_EGL_TRUE(eglTerminate(iDisplay));
sl@0
   712
		iDisplay = EGL_NO_DISPLAY;
sl@0
   713
		}
sl@0
   714
	}
sl@0
   715
sl@0
   716
/**
sl@0
   717
Cut and paste from CTestStep::SetLogger() - which is not exported
sl@0
   718
As the name suggests, this is for use by the egl test process wrapper
sl@0
   719
*/
sl@0
   720
void CEglTestStep::SetLoggerForProcessWrapperL()
sl@0
   721
	{
sl@0
   722
	// Create a cinidata object for parsing the testexecute.ini
sl@0
   723
	CTestExecuteIniData* parseTestExecuteIni = NULL;
sl@0
   724
	TBuf<KMaxTestExecuteNameLength> resultFilePath;
sl@0
   725
	TBuf<KMaxTestExecuteNameLength> xmlFilePath;
sl@0
   726
	TInt logMode;
sl@0
   727
	TInt logLevel;
sl@0
   728
	
sl@0
   729
	TRAPD(err,parseTestExecuteIni = CTestExecuteIniData::NewL());
sl@0
   730
	if (err == KErrNone)
sl@0
   731
		{
sl@0
   732
		CleanupStack::PushL(parseTestExecuteIni);
sl@0
   733
		parseTestExecuteIni->ExtractValuesFromIni();
sl@0
   734
		parseTestExecuteIni->GetKeyValueFromIni(KTEFHtmlKey, resultFilePath);
sl@0
   735
		parseTestExecuteIni->GetKeyValueFromIni(KTEFXmlKey, xmlFilePath);
sl@0
   736
		parseTestExecuteIni->GetKeyValueFromIni(KTEFLogMode, logMode);
sl@0
   737
		parseTestExecuteIni->GetKeyValueFromIni(KTEFLogSeverityKey, logLevel);
sl@0
   738
		parseTestExecuteIni->GetKeyValueFromIni(KTEFEnableIniAccessLog, IniAccessLog());
sl@0
   739
		}
sl@0
   740
	else
sl@0
   741
		{
sl@0
   742
		resultFilePath.Copy(KTestExecuteLogPath);
sl@0
   743
		xmlFilePath.Copy(KTestExecuteLogPath);
sl@0
   744
		logMode = TLoggerOptions(ELogHTMLOnly);
sl@0
   745
		logLevel = RFileFlogger::TLogSeverity(ESevrAll);
sl@0
   746
		IniAccessLog() = ETrue;
sl@0
   747
		}
sl@0
   748
	Logger().SetLoggerOptions(logMode);
sl@0
   749
		
sl@0
   750
	// Initialise a handle to the file logger
sl@0
   751
	User::LeaveIfError(Logger().Connect());
sl@0
   752
	RFs fS;
sl@0
   753
	User::LeaveIfError(fS.Connect());
sl@0
   754
	CleanupClosePushL(fS);
sl@0
   755
	RFile file;
sl@0
   756
	TBuf<KMaxTestExecuteNameLength> xmlLogFile(xmlFilePath);
sl@0
   757
	TBuf<KMaxTestExecuteNameLength> logFile;
sl@0
   758
	TBuf<KMaxTestExecuteNameLength> logFileNameFile(resultFilePath);
sl@0
   759
	logFileNameFile.Append(KTestExecuteScheduleTestLogCompatibilityNameFile);
sl@0
   760
	if(file.Open(fS,logFileNameFile,EFileRead | EFileShareAny) != KErrNone)
sl@0
   761
		{
sl@0
   762
		// For the old flogger we have to create an individual file
sl@0
   763
		logFile.Copy(TestStepName());
sl@0
   764
		_LIT(KTxtExtension,".txt");
sl@0
   765
		logFile.Append(KTxtExtension);
sl@0
   766
		logMode = TLoggerOptions(0);
sl@0
   767
		Logger().SetLoggerOptions(logMode);
sl@0
   768
		}
sl@0
   769
	else
sl@0
   770
		{
sl@0
   771
		CleanupClosePushL(file);
sl@0
   772
		TBuf8<KMaxTestExecuteNameLength> logFile8;
sl@0
   773
		TInt fileSize;
sl@0
   774
		User::LeaveIfError(file.Size(fileSize));
sl@0
   775
		User::LeaveIfError(file.Read(logFile8,fileSize));
sl@0
   776
		logFile.Copy(logFile8);
sl@0
   777
		xmlLogFile.Append(logFile);
sl@0
   778
		_LIT(KXmlExtension,".xml");
sl@0
   779
		xmlLogFile.Append(KXmlExtension);
sl@0
   780
		_LIT(KHtmExtension,".htm");
sl@0
   781
		logFile.Append(KHtmExtension);
sl@0
   782
		CleanupStack::Pop(&file);
sl@0
   783
		file.Close();
sl@0
   784
		}
sl@0
   785
	TBuf<KMaxTestExecuteLogFilePath> logFilePath(resultFilePath);
sl@0
   786
	logFilePath.Append(logFile);
sl@0
   787
	CleanupStack::Pop(&fS);
sl@0
   788
	fS.Close();
sl@0
   789
	
sl@0
   790
	if (logMode == 0 || logMode == 2)
sl@0
   791
		{
sl@0
   792
		User::LeaveIfError(Logger().HtmlLogger().CreateLog(logFilePath,RTestExecuteLogServ::ELogModeAppend));
sl@0
   793
		Logger().HtmlLogger().SetLogLevel(TLogSeverity(logLevel));
sl@0
   794
		}
sl@0
   795
	if (logMode == 1 || logMode == 2)
sl@0
   796
		{
sl@0
   797
		User::LeaveIfError(Logger().XmlLogger().CreateLog(xmlLogFile,RFileFlogger::ELogModeAppend));
sl@0
   798
		Logger().XmlLogger().SetLogLevel(RFileFlogger::TLogSeverity(logLevel));
sl@0
   799
		}
sl@0
   800
	if (parseTestExecuteIni != NULL)
sl@0
   801
		{
sl@0
   802
		CleanupStack::PopAndDestroy(parseTestExecuteIni);
sl@0
   803
		}
sl@0
   804
	}
sl@0
   805
sl@0
   806
EXPORT_C void CEglTestStep::PartialInitialiseL(const TDesC& aStepName)
sl@0
   807
	{
sl@0
   808
	SetTestStepName(aStepName);	
sl@0
   809
	SetLoggerForProcessWrapperL();
sl@0
   810
	// Assume pass
sl@0
   811
	SetTestStepResult(EPass);
sl@0
   812
	}
sl@0
   813
sl@0
   814
EXPORT_C void CEglTestStep::CreateEglSessionL(TInt aIdx)
sl@0
   815
	{
sl@0
   816
	delete iEglSess; //just in case it was called twice
sl@0
   817
	iEglSess = CTestEglSession::NewL(Logger(), iDisplay, aIdx);
sl@0
   818
	}
sl@0
   819