50 eventUp.Set(TRawEvent::EKeyUp, EStdKeyComma); |
53 eventUp.Set(TRawEvent::EKeyUp, EStdKeyComma); |
51 UserSvr::AddEvent(eventUp); |
54 UserSvr::AddEvent(eventUp); |
52 User::After(100000); |
55 User::After(100000); |
53 } |
56 } |
54 |
57 |
55 eventDown.Set(TRawEvent::EKeyDown, EStdKeyEnter); |
58 eventDown.Set(TRawEvent::EButton1Down, okButtonPos1,okButtonPos2); |
56 UserSvr::AddEvent(eventDown); |
59 UserSvr::AddEvent(eventDown); |
57 eventUp.Set(TRawEvent::EKeyUp, EStdKeyEnter); |
60 eventUp.Set(TRawEvent::EButton1Up, okButtonPos1,okButtonPos2); |
58 UserSvr::AddEvent(eventUp); |
61 UserSvr::AddEvent(eventUp); |
59 User::After(100000); |
62 User::After(100000); |
60 |
63 |
61 wsSession.Flush(); |
64 wsSession.Flush(); |
62 wsSession.Close(); |
65 wsSession.Close(); |
89 |
92 |
90 iActiveSchedulerWait = new(ELeave) CActiveSchedulerWait; |
93 iActiveSchedulerWait = new(ELeave) CActiveSchedulerWait; |
91 |
94 |
92 iAsyncStopScheduler = new(ELeave) CAsyncCallBack(CActive::EPriorityIdle); |
95 iAsyncStopScheduler = new(ELeave) CAsyncCallBack(CActive::EPriorityIdle); |
93 |
96 |
|
97 TInt err = RProperty::Define(KPropertyCategory, KMiscPluginPropertyKey, RProperty::EInt); |
|
98 TEST ((KErrNone == err) || (KErrAlreadyExists == err)); |
|
99 err = RProperty::Set(KPropertyCategory, KMiscPluginPropertyKey, 1); |
|
100 TEST (KErrNone == err); |
|
101 |
94 //Start the test exe which defines startup related property keys |
102 //Start the test exe which defines startup related property keys |
95 RProcess processHandle; |
103 RProcess processHandle; |
96 CleanupClosePushL(processHandle); |
104 CleanupClosePushL(processHandle); |
97 processHandle.Create(KExeToDefineStartUpPS, KNullDesC); |
105 processHandle.Create(KExeToDefineStartUpPS, KNullDesC); |
98 processHandle.Resume(); |
106 processHandle.Resume(); |
106 TEST(KErrNone == retVal); |
114 TEST(KErrNone == retVal); |
107 // leave if the process has not started properly |
115 // leave if the process has not started properly |
108 User::LeaveIfError(retVal); |
116 User::LeaveIfError(retVal); |
109 CleanupStack::PopAndDestroy(); |
117 CleanupStack::PopAndDestroy(); |
110 |
118 |
|
119 //Start the test exe which defines startup state related property keys |
111 RProcess processHandle1; |
120 RProcess processHandle1; |
112 TInt err1 = processHandle1.Create(KExeToDefineStartUpStatePS, KNullDesC); |
121 CleanupClosePushL(processHandle1); |
113 INFO_PRINTF2(_L("KExeToDefineStartUpStatePS ret is %d"), err1); |
122 err = processHandle1.Create(KExeToDefineStartUpStatePS, KNullDesC); |
|
123 INFO_PRINTF2(_L("KExeToDefineStartUpStatePS ret is %d"), err); |
|
124 User::LeaveIfError(err); |
114 processHandle1.Resume(); |
125 processHandle1.Resume(); |
115 processHandle1.Close(); |
126 |
|
127 // wait for the newly created process to rendezvous |
|
128 processHandle1.Rendezvous(status); |
|
129 User::WaitForRequest(status); |
|
130 retVal = status.Int(); |
|
131 //leave if the process has not started properly |
|
132 INFO_PRINTF2(_L("KExeToDefineStartUpStatePS rendezvous returns %d"), retVal); |
|
133 User::LeaveIfError(retVal); |
|
134 CleanupStack::PopAndDestroy(); |
116 |
135 |
117 //there are 8 different scenarios to test the custom command. Check the test spec for the scenarios. |
136 //there are 8 different scenarios to test the custom command. Check the test spec for the scenarios. |
118 //CMiscAdaptationRef::SecurityStateChange() has been changed to simulate the scenarios. |
137 //CMiscAdaptationRef::SecurityStateChange() has been changed to simulate the scenarios. |
119 //CMiscAdaptationRef::SecurityStateChange() uses KTestCmdSecurityCheckTestFile to get the scenario number |
138 //CMiscAdaptationRef::SecurityStateChange() uses KTestCmdSecurityCheckTestFile to get the scenario number |
120 //connect to file server |
139 //connect to file server |
|
140 |
121 User::LeaveIfError(iFs.Connect()); |
141 User::LeaveIfError(iFs.Connect()); |
122 TInt err = iFs.MkDirAll(KDirNameOfTestCasesNumFile); |
142 err = iFs.MkDirAll(KDirNameOfTestCasesNumFile); |
123 if (KErrAlreadyExists != err && KErrNone != err) |
143 if (KErrAlreadyExists != err && KErrNone != err) |
124 { |
144 { |
125 User::Leave(err); |
145 User::Leave(err); |
126 } |
146 } |
127 err = iFile.Replace(iFs, KTestCmdSecurityCheckTestFile, EFileWrite | EFileStream); |
147 err = iFile.Replace(iFs, KTestCmdSecurityCheckTestFile, EFileWrite | EFileStream); |
|
148 TEST(KErrNone == err); |
128 iFile.Close(); |
149 iFile.Close(); |
129 |
150 |
130 //For stopping the key simulation when execution behaviour is deferredwaitforsignal and fireandforget |
151 //For stopping the key simulation when execution behaviour is deferredwaitforsignal and fireandforget |
131 iStopSimulatekey = CStopSimulatekey::NewL(this); |
152 iStopSimulatekey = CStopSimulatekey::NewL(this); |
132 |
153 |
133 //Connect to SsmStateManager |
154 //Connect to SsmStateManager |
134 const TInt connect = iClient.Connect(); |
155 const TInt connect = iClient.Connect(); |
135 TEST(KErrNone == connect); |
156 TEST(KErrNone == connect); |
136 |
157 |
137 //RProperty property; |
158 //RProperty property; |
138 iProperty.Define(KCustomcmdServerSID, iSwp.Key(), RProperty::EInt); |
159 err = iProperty.Define(KCustomcmdServerSID, iSwp.Key(), RProperty::EInt); |
|
160 TEST ((KErrNone == err) || (KErrAlreadyExists == err)); |
139 |
161 |
140 // Register mapping between keys and swp policy DLL (done once per ssmserver) |
162 // Register mapping between keys and swp policy DLL (done once per ssmserver) |
141 INFO_PRINTF1(_L("Registering swp...")); |
163 INFO_PRINTF1(_L("Registering swp...")); |
142 iClient.RegisterSwpMapping(KTestSwp, KTestSwpPolicyCustomCmd); |
164 iClient.RegisterSwpMapping(KTestSwp, KTestSwpPolicyCustomCmd); |
143 |
165 |