appfw/apparchitecture/tef/t_servicebasestep.cpp
changeset 0 2e3d3ce01487
child 29 6a787171e1de
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 // Copyright (c) 2008-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 "t_servicebasestep.h"
       
    23 #include <apaserverapp.h>
       
    24 #include <w32std.h>
       
    25 #include "appfwk_test.h"
       
    26 #include "testableapalssession.h"
       
    27 #include "../tef/TNonNative/TNNApp1.h"
       
    28 
       
    29 TInt PanicTest(TAny* aOption);
       
    30 
       
    31 // RTstServiceApp
       
    32 
       
    33 TInt RTstServiceApp::DoTestTransferSessionL(TUid aServiceUid, TBool aPassingFileByHandle, const TDesC& aFileNameWithoutDriveOrPath)
       
    34 	{ // static
       
    35 	//create the first session object
       
    36 	RTstServiceApp appServiceFirst(aServiceUid);
       
    37 	CleanupClosePushL(appServiceFirst);
       
    38 	//connecting first session object
       
    39 	appServiceFirst.ConnectL();
       
    40 	
       
    41 	//create the second session object
       
    42 	RTstServiceApp appServiceSecond(aServiceUid);
       
    43 	//transfer session for first session object to the second session object
       
    44 	appServiceSecond.TransferExistingSessionL(appServiceFirst);
       
    45 	CleanupClosePushL(appServiceSecond);
       
    46 	
       
    47 	TRequestStatus requestStatus;
       
    48 	//request for a service from the second session object
       
    49 	appServiceSecond.ReceiveTestResult(requestStatus, aPassingFileByHandle, aFileNameWithoutDriveOrPath);
       
    50 	User::WaitForRequest(requestStatus);
       
    51 	const TInt result=User::LeaveIfError(requestStatus.Int());
       
    52 
       
    53 	CleanupStack::PopAndDestroy(&appServiceSecond);
       
    54 	CleanupStack::PopAndDestroy(&appServiceFirst);
       
    55 	User::After(5 * 1000000); //Wait 5sec for Apparc update due to paging
       
    56 	
       
    57 	return result;
       
    58 	}
       
    59 	
       
    60 TInt RTstServiceApp::DoTestTransferSessionAndBackL(TUid aServiceUid, TBool aPassingFileByHandle, const TDesC& aFileNameWithoutDriveOrPath)
       
    61 	{ // static
       
    62 	//create the first session object
       
    63 	RTstServiceApp appServiceFirst(aServiceUid);
       
    64 	CleanupClosePushL(appServiceFirst);
       
    65 	//connecting first session object
       
    66 	appServiceFirst.ConnectL();
       
    67 	
       
    68 	//create the second session object
       
    69 	RTstServiceApp appServiceSecond(aServiceUid);
       
    70 	//transfer session from first session object to the second session object
       
    71 	appServiceSecond.TransferExistingSessionL(appServiceFirst);
       
    72 	CleanupClosePushL(appServiceSecond);
       
    73 	
       
    74 	//transfer session back to  first session object from the second session object
       
    75 	appServiceFirst.TransferExistingSessionL(appServiceSecond);
       
    76 	TRequestStatus requestStatus;
       
    77 	//request for a service from the first session object
       
    78 	appServiceFirst.ReceiveTestResult(requestStatus, aPassingFileByHandle, aFileNameWithoutDriveOrPath);
       
    79 	User::WaitForRequest(requestStatus);
       
    80 	const TInt result=User::LeaveIfError(requestStatus.Int());
       
    81 
       
    82 	CleanupStack::PopAndDestroy(&appServiceSecond);
       
    83 	CleanupStack::PopAndDestroy(&appServiceFirst);
       
    84 	User::After(5 * 1000000); //Wait 5sec for Apparc update due to paging
       
    85 	
       
    86 	return result;
       
    87 	}
       
    88 TInt RTstServiceApp::DoTestTransferWithUnconnectedSessionL(TUid aServiceUid, TBool aPassingFileByHandle, const TDesC& aFileNameWithoutDriveOrPath)
       
    89 	{ // static
       
    90 	//create the first session object
       
    91 	RTstServiceApp appServiceFirst(aServiceUid);
       
    92 	CleanupClosePushL(appServiceFirst);
       
    93 		
       
    94 	//create the second session object
       
    95 	RTstServiceApp appServiceSecond(aServiceUid);
       
    96 	//transfer session for first session object to the second session object
       
    97 	appServiceSecond.TransferExistingSessionL(appServiceFirst);
       
    98 	CleanupClosePushL(appServiceSecond);
       
    99 	
       
   100 	TRequestStatus requestStatus;
       
   101 	//request for a service from the second session object
       
   102 	appServiceSecond.ReceiveTestResult(requestStatus, aPassingFileByHandle, aFileNameWithoutDriveOrPath);
       
   103 	User::WaitForRequest(requestStatus);
       
   104 	const TInt result=User::LeaveIfError(requestStatus.Int());
       
   105 
       
   106 	CleanupStack::PopAndDestroy(&appServiceSecond);
       
   107 	CleanupStack::PopAndDestroy(&appServiceFirst);
       
   108 	User::After(5 * 1000000); //Wait 5sec for Apparc update due to paging
       
   109 	
       
   110 	return result;
       
   111 	}
       
   112 	
       
   113 RTstServiceApp::RTstServiceApp(TUid aServiceUid)
       
   114 	:iServiceUid(aServiceUid)
       
   115 	{
       
   116 	}
       
   117 
       
   118 void RTstServiceApp::ConnectL()
       
   119 	{
       
   120 	ConnectExistingByNameL(KLitServerName);
       
   121 	}
       
   122 
       
   123 void RTstServiceApp::ReceiveTestResult(TRequestStatus& aRequestStatus, TBool aPassingFileByHandle, const TDesC& aFileNameWithoutDriveOrPath)
       
   124 	{
       
   125 	SendReceive(EOpcode_receiveTestResult, TIpcArgs(aPassingFileByHandle, &aFileNameWithoutDriveOrPath), aRequestStatus);
       
   126 	}
       
   127 
       
   128 TUid RTstServiceApp::ServiceUid() const
       
   129 	{
       
   130 	return iServiceUid;
       
   131 	}
       
   132 
       
   133 //CT_ServiceBaseStep
       
   134 	
       
   135 void CT_ServiceBaseStep::ClosePanicWindowL()
       
   136 	{
       
   137 	RWsSession	ws;
       
   138 	User::LeaveIfError(ws.Connect());
       
   139 
       
   140 	TInt wgFocus = ws.GetFocusWindowGroup();
       
   141 
       
   142 	const TUint32 KClientHandle = 0xFFFFFFFF;	// Events delivered to this handle are thrown away
       
   143 	RWindowGroup wg = RWindowGroup(ws);
       
   144 
       
   145 	wg.Construct(KClientHandle);
       
   146 	TInt wgId = wg.Identifier();
       
   147 
       
   148 	TWsEvent event;
       
   149 	event.SetType(EEventKey);
       
   150 	TKeyEvent *keyEvent = event.Key();
       
   151 	keyEvent->iCode = EKeyEscape;
       
   152 	keyEvent->iScanCode = EStdKeyEscape;
       
   153 	keyEvent->iModifiers = 0;
       
   154 
       
   155 	TInt limit = 0;
       
   156 	for(limit = 0; wgFocus != wgId && (limit < 50); limit++)
       
   157 		{
       
   158 		ws.SendEventToAllWindowGroups(event);
       
   159 		wgFocus = ws.GetFocusWindowGroup();
       
   160 		RDebug::Print(_L("ClosePanicWindowL() - EKeyEscape sent to Windows Group"));
       
   161 		}
       
   162 
       
   163 	// close everything
       
   164 	wg.Close();
       
   165 	ws.Close();
       
   166 	}
       
   167 	
       
   168 void PanicFirstInstanceAfterTransferL()
       
   169 	{
       
   170 	TPtrC fullFileName = _L("z:\\private\\101F289C\\GIF.NNA1");
       
   171 	TPtrC fileNameWithoutDriveOrPath(TParsePtrC(fullFileName).NameAndExt());
       
   172 	const TUid serviceUid = {0x10207f97};
       
   173 	
       
   174 	RTestableApaLsSession apparcServer;
       
   175 	CleanupClosePushL(apparcServer);
       
   176 	User::LeaveIfError(apparcServer.Connect());
       
   177 
       
   178 	RFs fileServer;
       
   179 	CleanupClosePushL(fileServer);
       
   180 	User::LeaveIfError(fileServer.Connect());
       
   181 	User::LeaveIfError(fileServer.ShareProtected());
       
   182 
       
   183 	apparcServer.FlushRecognitionCache();
       
   184 	
       
   185 	RFile file;
       
   186 	CleanupClosePushL(file);
       
   187 	User::LeaveIfError(file.Open(fileServer, fullFileName, EFileShareReadersOnly|EFileStream|EFileRead));
       
   188 		
       
   189 	TThreadId threadId2;
       
   190 	TRequestStatus requestStatusForRendezvous2;
       
   191 	User::LeaveIfError(apparcServer.StartDocument(file, threadId2, &requestStatusForRendezvous2));
       
   192 	User::WaitForRequest(requestStatusForRendezvous2);
       
   193 	
       
   194 	//create the first session object
       
   195 	RTstServiceApp appServiceFirst(serviceUid);
       
   196 	CleanupClosePushL(appServiceFirst);
       
   197 	appServiceFirst.ConnectL();
       
   198 	
       
   199 	//create the second session object
       
   200 	RTstServiceApp appServiceSecond(serviceUid);
       
   201 	//transfer session from first session object to the second session object
       
   202 	appServiceSecond.TransferExistingSessionL(appServiceFirst);
       
   203 	CleanupClosePushL(appServiceSecond);
       
   204 	TRequestStatus requestStatus;
       
   205 	//request for a service from the first session object
       
   206 	appServiceFirst.ReceiveTestResult(requestStatus, ETrue, fileNameWithoutDriveOrPath);
       
   207 	//code should have panicked by now
       
   208 	User::WaitForRequest(requestStatus);
       
   209 	const TInt result=User::LeaveIfError(requestStatus.Int());
       
   210 	
       
   211 	CleanupStack::PopAndDestroy(&appServiceSecond);
       
   212 	CleanupStack::PopAndDestroy(&appServiceFirst);
       
   213 	}
       
   214 		
       
   215 void PanicSecondInstanceAfterTransferBackL()
       
   216 	{
       
   217 	TPtrC fullFileName = _L("z:\\private\\101F289C\\GIF.NNA1");
       
   218 	TPtrC fileNameWithoutDriveOrPath(TParsePtrC(fullFileName).NameAndExt());
       
   219 	const TUid serviceUid = {0x10207f97};
       
   220 	
       
   221 	RTstServiceApp appServiceFirst(serviceUid);
       
   222 	CleanupClosePushL(appServiceFirst);
       
   223 	appServiceFirst.ConnectL();
       
   224 	
       
   225 	RTstServiceApp appServiceSecond(serviceUid);
       
   226 	//transfer session from first session object to the second session object
       
   227 	appServiceSecond.TransferExistingSessionL(appServiceFirst);
       
   228 	CleanupClosePushL(appServiceSecond);
       
   229 	
       
   230 	//Transfer ownership back to first instance
       
   231 	appServiceFirst.TransferExistingSessionL(appServiceSecond);
       
   232 	
       
   233 	TRequestStatus requestStatus;
       
   234 	//request for a service from the first session object
       
   235 	appServiceSecond.ReceiveTestResult(requestStatus, ETrue, fileNameWithoutDriveOrPath);
       
   236 	//code should have panicked by now
       
   237 	User::WaitForRequest(requestStatus);
       
   238 	const TInt result=User::LeaveIfError(requestStatus.Int());
       
   239 	
       
   240 	CleanupStack::PopAndDestroy(&appServiceSecond);
       
   241 	CleanupStack::PopAndDestroy(&appServiceFirst);
       
   242 	}
       
   243 	
       
   244 TInt PanicTest(TAny* aOption)
       
   245 	{
       
   246 	CTrapCleanup* trapCleanup = CTrapCleanup::New();
       
   247 	if (!trapCleanup)
       
   248 		{
       
   249 		return KErrNoMemory;
       
   250 		}
       
   251 	TInt option = (TInt)aOption;
       
   252 	TInt err = KErrNone;	
       
   253 	if (option == 1)
       
   254 		{
       
   255 		TRAP(err, PanicFirstInstanceAfterTransferL());
       
   256 		}
       
   257 	else
       
   258 		{
       
   259 		TRAP(err, PanicSecondInstanceAfterTransferBackL());
       
   260 		}
       
   261 		
       
   262 	delete trapCleanup;
       
   263 	return err;
       
   264 	}	
       
   265 	
       
   266 void CT_ServiceBaseStep::OpenFileLC(RFile& aFile, RFs& aFileServer, const TDesC& aFullFileName)
       
   267 	{
       
   268 	CleanupClosePushL(aFile);
       
   269 	User::LeaveIfError(aFile.Open(aFileServer, aFullFileName, EFileShareReadersOnly|EFileStream|EFileRead));
       
   270 	}
       
   271 	
       
   272 /**
       
   273    @SYMTestCaseID APPFWK-APPARC-0092
       
   274   
       
   275    @SYMCR CR1555
       
   276   
       
   277    @SYMTestCaseDesc Transfer ownership of session from one instance of RApaAppServiceBase to another
       
   278   
       
   279    @SYMTestPriority High
       
   280   
       
   281    @SYMTestStatus Implemented
       
   282    
       
   283    @SYMTestActions Start the server application.
       
   284 				   Create an instance of RApaAppServiceBase and connect to server.
       
   285 				   Create another instance of RApaAppServiceBase and take the ownership of the connected session.
       
   286 			       Request a service from the second instance.
       
   287 
       
   288    @SYMTestExpectedResults Check if request has been serviced correctly.
       
   289  */	
       
   290 void CT_ServiceBaseStep::TestServiceAppL(RApaLsSession& aApparcServer, RFs& aFileServer)
       
   291 	{
       
   292 	TPtrC fullFileName = _L("z:\\private\\101F289C\\GIF.NNA1");
       
   293 	TPtrC fileNameWithoutDriveOrPath(TParsePtrC(fullFileName).NameAndExt());
       
   294 	const TUid serviceUid = {0x10207f97};
       
   295 
       
   296 	//Transfer session from one RApaAppServiceBase instance to another and request for service from the latter
       
   297 	__UHEAP_MARK;
       
   298 	RFile file;
       
   299 	OpenFileLC(file, aFileServer, fullFileName);
       
   300 	TThreadId threadId;
       
   301 	TRequestStatus requestStatusForRendezvous;
       
   302 	User::LeaveIfError(aApparcServer.StartDocument(file, threadId, &requestStatusForRendezvous));
       
   303 	User::WaitForRequest(requestStatusForRendezvous);
       
   304 	INFO_PRINTF1(_L("App started....\n"));
       
   305 	TEST(RTstServiceApp::DoTestTransferSessionL(serviceUid, ETrue, fileNameWithoutDriveOrPath) == KCheckPass);
       
   306   	INFO_PRINTF1(_L("Requested service completed successfully....\n"));					
       
   307 	CleanupStack::PopAndDestroy(&file);
       
   308 	__UHEAP_MARKEND;
       
   309 	}
       
   310 
       
   311 /**
       
   312    @SYMTestCaseID APPFWK-APPARC-0093 APPFWK-APPARC-0095
       
   313   
       
   314    @SYMCR CR1555
       
   315   
       
   316    @SYMTestCaseDesc Testing if requesting service with the wrong instance will panic
       
   317   
       
   318    @SYMTestPriority High
       
   319   
       
   320    @SYMTestStatus Implemented
       
   321    
       
   322    @SYMTestActions Start the server application.
       
   323 				   Create two instances of RApaAppServiceBase and connect to server.
       
   324 				   Request service with the wrong instance(which does not have the session).
       
   325    
       
   326    @SYMTestExpectedResults Requesting service with the wrong instance should raise a KERN-EXEC 0 panic.
       
   327  */	
       
   328 void CT_ServiceBaseStep::TestPanicWithWrongInstanceL()
       
   329 	{
       
   330 	RThread thread;
       
   331 	TRequestStatus stat;
       
   332 	TBuf<32> threadNameBuf;
       
   333 	// Give each thread a unique name to avoid KErrAlreadyExists error on thread creation
       
   334 	_LIT(KThreadNameFormat, "CT_ServiceBaseStep%d");
       
   335 	threadNameBuf.Format(KThreadNameFormat, 1);
       
   336 	
       
   337 	//Transfer session from one RApaAppServiceBase instance to another and request for service from the first, this should panic with KERN-EXEC 0
       
   338 	TInt threadCreationVal = thread.Create(threadNameBuf,PanicTest,KDefaultStackSize,0x2000,0x20000,(TAny*)1);
       
   339 	TEST(threadCreationVal==KErrNone);	
       
   340 
       
   341 	TRequestStatus status;
       
   342 	thread.Logon(status);
       
   343 	TBool jit =	User::JustInTime();
       
   344 	User::SetJustInTime(EFalse);
       
   345 	thread.Resume();
       
   346 	User::WaitForRequest(status);
       
   347 
       
   348 	// we are always expecting the same panic category
       
   349 	TExitCategoryName category = thread.ExitCategory();
       
   350 	TEST(category.Compare(_L("KERN-EXEC")) == 0);
       
   351 	INFO_PRINTF2(_L("Expected exit category:KERN-EXEC, Actual exit category:  '%S'..."), &category);
       
   352 
       
   353 	TInt exitReason = thread.ExitReason();
       
   354 	TEST(exitReason == 0);
       
   355 	INFO_PRINTF2(_L("Expected exit reason: 0, Actual exit reason:, %d \n"), exitReason);
       
   356 	
       
   357 	thread.Close();
       
   358 	
       
   359 	threadNameBuf.Format(KThreadNameFormat, 2);
       
   360 	//Transfer session from one RApaAppServiceBase instance to another and back, request for service from the second instance, this should panic with KERN-EXEC 0
       
   361 	threadCreationVal = thread.Create(threadNameBuf,PanicTest,KDefaultStackSize,0x2000,0x20000,(TAny*)2);
       
   362 	TEST(threadCreationVal==KErrNone);	
       
   363 
       
   364 	thread.Logon(status);
       
   365 	User::SetJustInTime(EFalse);
       
   366 	thread.Resume();
       
   367 	User::WaitForRequest(status);
       
   368 
       
   369 	// we are always expecting the same panic category
       
   370 	category = thread.ExitCategory();
       
   371 	TEST(category.Compare(_L("KERN-EXEC")) == 0);
       
   372 	INFO_PRINTF2(_L("Expected exit category:KERN-EXEC, Actual exit category:  '%S'..."), &category);
       
   373 	
       
   374 	exitReason = thread.ExitReason();
       
   375 	TEST(exitReason == 0);
       
   376 	INFO_PRINTF2(_L("Expected exit reason: 0, Actual exit reason:, %d \n"), exitReason);
       
   377 	
       
   378 	thread.Close();
       
   379 	User::SetJustInTime(jit);
       
   380 	ClosePanicWindowL();
       
   381 	}
       
   382 	
       
   383 /**
       
   384    @SYMTestCaseID APPFWK-APPARC-0094
       
   385   
       
   386    @SYMCR CR1555
       
   387   
       
   388    @SYMTestCaseDesc Transfer ownership of session from one instance of RApaAppServiceBase to another and transfer back to first instance
       
   389   
       
   390    @SYMTestPriority High
       
   391   
       
   392    @SYMTestStatus Implemented
       
   393    
       
   394    @SYMTestActions	Start the server application.
       
   395 				    Create an instance of RApaAppServiceBase and connect to server.
       
   396 				    Create another instance of RApaAppServiceBase and take the ownership of the connected session.
       
   397 				    Transfer back the ownership to the first instance.
       
   398 			        Request a service from the first instance.
       
   399 			        
       
   400    @SYMTestExpectedResults Check if request has been serviced correctly.
       
   401  */	
       
   402 void CT_ServiceBaseStep::TestTransferBackL(RApaLsSession& aApparcServer, RFs& aFileServer)
       
   403 	{
       
   404 	TPtrC fullFileName = _L("z:\\private\\101F289C\\GIF.NNA1");
       
   405 	TPtrC fileNameWithoutDriveOrPath(TParsePtrC(fullFileName).NameAndExt());
       
   406 	const TUid serviceUid = {0x10207f97};
       
   407 	
       
   408 	__UHEAP_MARK;
       
   409 	RFile file;
       
   410 	OpenFileLC(file, aFileServer, fullFileName);
       
   411 	TThreadId threadId;
       
   412 	TRequestStatus requestStatusForRendezvous;
       
   413 	User::LeaveIfError(aApparcServer.StartDocument(file, threadId, &requestStatusForRendezvous));
       
   414 	User::WaitForRequest(requestStatusForRendezvous);
       
   415 	INFO_PRINTF1(_L("App started....\n"));	
       
   416 	TEST(RTstServiceApp::DoTestTransferSessionAndBackL(serviceUid, ETrue, fileNameWithoutDriveOrPath) == KCheckPass);
       
   417   	INFO_PRINTF1(_L("Requested service completed successfully....\n"));						
       
   418 	CleanupStack::PopAndDestroy(&file);
       
   419 	__UHEAP_MARKEND;
       
   420 	}
       
   421 
       
   422 /**
       
   423    @SYMTestCaseID APPFWK-APPARC-0097
       
   424   
       
   425    @SYMCR CR1555
       
   426   
       
   427    @SYMTestCaseDesc Transfer ownership of session from one instance of RApaAppServiceBase which is not connected to another
       
   428   
       
   429    @SYMTestPriority High
       
   430   
       
   431    @SYMTestStatus Implemented
       
   432    
       
   433    @SYMTestActions	Start the server application.
       
   434 				    Create an instance of RApaAppServiceBase.
       
   435 				    Create another instance of RApaAppServiceBase and take the ownership of unconnected session.
       
   436 				    			        
       
   437    @SYMTestExpectedResults Check if function leaves with KErrArgument.
       
   438  */	
       
   439 void CT_ServiceBaseStep::TestTransferWithUnconnectedSessionL()
       
   440 	{
       
   441 	TPtrC fullFileName = _L("z:\\private\\101F289C\\GIF.NNA1");
       
   442 	TPtrC fileNameWithoutDriveOrPath(TParsePtrC(fullFileName).NameAndExt());
       
   443 	const TUid serviceUid = {0x10207f97};
       
   444 	
       
   445 	__UHEAP_MARK;
       
   446 	TInt err;
       
   447 	TRAP(err, RTstServiceApp::DoTestTransferWithUnconnectedSessionL(serviceUid, ETrue, fileNameWithoutDriveOrPath));
       
   448 	TEST(err == KErrArgument);
       
   449   	INFO_PRINTF2(_L("Expected error code: -6, Actual error code:, %d \n"), err);						
       
   450 	__UHEAP_MARKEND;	
       
   451 	}
       
   452 	
       
   453 // CTestStep derived functions
       
   454 	
       
   455 CT_ServiceBaseStep::~CT_ServiceBaseStep()
       
   456 	{
       
   457 	}
       
   458 
       
   459 CT_ServiceBaseStep::CT_ServiceBaseStep()
       
   460 	{
       
   461 	SetTestStepName(KT_ServiceBaseStep);
       
   462 	}
       
   463 
       
   464 TVerdict CT_ServiceBaseStep::doTestStepPreambleL()
       
   465 	{
       
   466 	SetTestStepResult(EPass);
       
   467 	return TestStepResult();
       
   468 	}
       
   469 
       
   470 TVerdict CT_ServiceBaseStep::doTestStepPostambleL()
       
   471 	{
       
   472 	return TestStepResult();
       
   473 	}
       
   474 
       
   475 TVerdict CT_ServiceBaseStep::doTestStepL()
       
   476 	{
       
   477 	INFO_PRINTF1(_L("Test ServiceBase starting....\n"));
       
   478 
       
   479 	RTestableApaLsSession apparcServer;
       
   480 	CleanupClosePushL(apparcServer);
       
   481 	User::LeaveIfError(apparcServer.Connect());
       
   482 
       
   483 	RFs fileServer;
       
   484 	CleanupClosePushL(fileServer);
       
   485 	User::LeaveIfError(fileServer.Connect());
       
   486 	User::LeaveIfError(fileServer.ShareProtected());
       
   487 
       
   488 	apparcServer.FlushRecognitionCache();
       
   489 
       
   490 	HEAP_TEST_LS_SESSION(apparcServer, 0, DONT_CHECK, TestServiceAppL(apparcServer, fileServer), apparcServer.FlushRecognitionCache());
       
   491 	HEAP_TEST_LS_SESSION(apparcServer, 0, 0, TestPanicWithWrongInstanceL(), apparcServer.FlushRecognitionCache());
       
   492 	HEAP_TEST_LS_SESSION(apparcServer, 0, DONT_CHECK, TestTransferBackL(apparcServer, fileServer), apparcServer.FlushRecognitionCache());
       
   493 	HEAP_TEST_LS_SESSION(apparcServer, 0, 0, TestTransferWithUnconnectedSessionL(), apparcServer.FlushRecognitionCache());
       
   494 	
       
   495 	CleanupStack::PopAndDestroy(2, &apparcServer);
       
   496 
       
   497 	INFO_PRINTF1(_L("....Test ServiceBase completed!"));
       
   498 	return TestStepResult();
       
   499 	}