resourcemgmt/hwresourcesmgr/test/TestCapsHWRMPolicing/src/HWRMFmTxAutoFreqOn_CStep.cpp
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     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 // HWRMFmTxAutoFreqOn_CStep.h.cpp
       
    15 // 
       
    16 //
       
    17 
       
    18 
       
    19 //Test Step header
       
    20 #include "HWRMFmTxAutoFreqOn_CStep.h"
       
    21 #include "HWRMFmTxClientServer.h"
       
    22 
       
    23 
       
    24 //TO BE SAFE
       
    25 IMPORT_C TInt StartDialogThread();
       
    26 
       
    27 CHWRMFmTxAutoFreqOnStep::CHWRMFmTxAutoFreqOnStep()
       
    28 /** Each test step initialises it's own name
       
    29 */
       
    30 	{
       
    31 	// store the name of this test case
       
    32 	// this is the name that is used by the script file
       
    33 	//DEF iTestStepName = _L("CPARAM_MESS_NAMEStep");
       
    34 
       
    35 	TUint32 KCapabilityCapabilityMultimediaDDBitMask  = 0x8; //8LL;
       
    36 	
       
    37 	//The server name and IPC number is obtained and all messages are checked Sync
       
    38 	SR_ServerName		= KServerProcessName;
       
    39 	SR_MESSAGE_TYPE		= KSyncMessage;	//Is it Async or sync?
       
    40 	SR_MESSAGE_ID		= EHWRMFmTxAutoFreqOn ;	//It holds the IPC number
       
    41 	SR_MESSAGE_MASK		= KCapabilityCapabilityMultimediaDDBitMask; //Holds the cap mask for the message
       
    42 	
       
    43 	
       
    44 
       
    45 	//The iServer_Panic is a unique name from Server,but always truncated to KMaxExitCategoryName
       
    46 
       
    47 	iServer_Panic		=	_L("HWRM Server");
       
    48 
       
    49 	//TCapability cap[] = {ECapabilityPARAM_MESS_NAMECAP, ECapability_Limit};
       
    50 	TCapability cap[] = {ECapabilityMultimediaDD, ECapability_Limit};
       
    51 
       
    52 	TSecurityInfo info;
       
    53 	info.Set(RProcess());
       
    54 	TBool result = EFalse;
       
    55 
       
    56 	for (TInt i = 0; cap[i] != ECapability_Limit; i++)
       
    57 	{
       
    58 
       
    59 		if (!(info.iCaps.HasCapability(cap[i])))
       
    60 		{
       
    61 			result=ETrue;
       
    62 
       
    63 		}
       
    64 
       
    65 	}
       
    66 	
       
    67 #ifdef HWRM_FMTX_POLICY_CHECKING_DISABLED
       
    68 
       
    69     result = EFalse;
       
    70 
       
    71 #endif
       
    72 
       
    73     
       
    74 	iExpect_Rejection = result;
       
    75     
       
    76 
       
    77     
       
    78 	iStepCap            = KCapabilityCapabilityMultimediaDDBitMask;
       
    79 
       
    80 	//Get a unique thread name
       
    81 	ChildThread_SR.Format(_L("ChildThread_%S_%d"),&SR_ServerName,SR_MESSAGE_ID);
       
    82 	}
       
    83 
       
    84 /*
       
    85 Exec_SendReceive():
       
    86 	This Fn is called by the Child Thread
       
    87 1.	Create a session with the server
       
    88 2.	Test an SendReceive call
       
    89 3.	Informs the main thread about the status of the call using
       
    90 	a.	iSessionCreated, if the a connection is established
       
    91 	b.	iResult_Server, holds the return value for connection
       
    92 	c.	iResult_SR, the return value of SendReceive	call
       
    93 */
       
    94 
       
    95 TInt CHWRMFmTxAutoFreqOnStep::Exec_SendReceive()
       
    96 	{
       
    97 	iResult_Server = CreateSession(SR_ServerName,Version(),2);
       
    98 
       
    99 	if (iResult_Server!=KErrNone)
       
   100 		{
       
   101 
       
   102 		iResult_Server=StartServer();
       
   103 		if (iResult_Server!=KErrNone)
       
   104 			return(iResult_Server);
       
   105 
       
   106 		iResult_Server = CreateSession(SR_ServerName,TVersion(),2);
       
   107 		}
       
   108 	if(iResult_Server == KErrNone)
       
   109 		{
       
   110 		iSessionCreated = ETrue;
       
   111 		
       
   112 		/*
       
   113 		if(SR_MESSAGE_ID == EEtelDbgMarkHeap ||
       
   114 			SR_MESSAGE_ID == EEtelDbgCheckHeap ||
       
   115 			SR_MESSAGE_ID == EEtelDbgMarkEnd ||
       
   116 			SR_MESSAGE_ID == EEtelDbgFailNext)
       
   117 				{
       
   118  				iResult_SR = TestDebugHeap(SR_MESSAGE_ID);
       
   119 				}
       
   120 		else
       
   121 			*/
       
   122 			if(SR_MESSAGE_ID >= 0)
       
   123 				{
       
   124 			 	TIpcArgs args(0,0,0,0);
       
   125 				iResult_SR	=	SendReceive(SR_MESSAGE_ID,args);
       
   126 				}
       
   127 		}
       
   128 
       
   129 	return iResult_Server;
       
   130 	}