networksecurity/tlsprovider/Test/ttlsoom/ttlsoom.cpp
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     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 //
       
    15 
       
    16 /**
       
    17  @file
       
    18 */
       
    19 
       
    20 #include <e32base.h>
       
    21 
       
    22 #include "ttlsoom.h"
       
    23 #include "tlsoomstepwrapper.h"
       
    24 
       
    25 _LIT(KServerName,"TTlsOOM");
       
    26 
       
    27 CTlsOOMServer* CTlsOOMServer::NewL()
       
    28 	{
       
    29 	CTlsOOMServer * server = new (ELeave) CTlsOOMServer();
       
    30 	CleanupStack::PushL(server);
       
    31 	
       
    32 	// Either use a StartL or ConstructL, the latter will permit Server Logging.
       
    33 
       
    34 	//server->StartL(KServerName); 
       
    35 	server->ConstructL(KServerName);
       
    36 	CleanupStack::Pop(server);
       
    37 	return server;
       
    38 	}
       
    39 
       
    40 LOCAL_C void MainL()
       
    41 	{
       
    42 	// Leave the hooks in for platform security
       
    43 #if (defined __DATA_CAGING__)
       
    44 	RProcess().DataCaging(RProcess::EDataCagingOn);
       
    45 	RProcess().SecureApi(RProcess::ESecureApiOn);
       
    46 #endif
       
    47 	CActiveScheduler* sched = NULL;
       
    48 	CleanupStack::PushL(sched);
       
    49 	sched=new(ELeave) CActiveScheduler;
       
    50 	CActiveScheduler::Install(sched);
       
    51 	CTlsOOMServer* server = NULL;
       
    52 	TRAPD(err,server = CTlsOOMServer::NewL());
       
    53 	CleanupStack::PushL(server);
       
    54 	
       
    55 	if(!err)
       
    56 		{
       
    57 		RProcess::Rendezvous(KErrNone);
       
    58 		sched->Start();
       
    59 		}
       
    60 		
       
    61 	CleanupStack::PopAndDestroy(2, sched); // server
       
    62 	}
       
    63 
       
    64 GLDEF_C TInt E32Main()
       
    65 	{
       
    66 	CTrapCleanup* cleanup = CTrapCleanup::New();
       
    67 	if(cleanup == NULL)
       
    68 		{
       
    69 		return KErrNoMemory;
       
    70 		}
       
    71 	TRAPD(err,MainL());
       
    72 	delete cleanup;
       
    73 	return KErrNone;
       
    74     }
       
    75 
       
    76 CTestStep* CTlsOOMServer::CreateTestStep(const TDesC& aStepName)
       
    77 	{
       
    78 	CTestStep* testStep = new CTlsOOMStepWrapper(aStepName);
       
    79 	return testStep;
       
    80 	}