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