83 RApaLsSession theLs; |
80 RApaLsSession theLs; |
84 User::LeaveIfError(theLs.Connect()); |
81 User::LeaveIfError(theLs.Connect()); |
85 CleanupClosePushL(theLs); |
82 CleanupClosePushL(theLs); |
86 |
83 |
87 // Wait for applist to be updated.... |
84 // Wait for applist to be updated.... |
88 TRequestStatus status; |
85 RPointerArray<TDesC> dummy; |
89 theLs.SetNotify(ETrue, status); |
86 User::LeaveIfError(theLs.ForceRegistration(dummy)); |
90 User::WaitForRequest(status); |
|
91 |
87 |
92 //Check whether app is not present in the applist |
88 //Check whether app is not present in the applist |
93 TInt ret = theLs.GetAppInfo(appInfo,appUid); |
89 TInt ret = theLs.GetAppInfo(appInfo,appUid); |
94 INFO_PRINTF3(_L(" Expected value is %d, Call to GetAppInfo returned : %d "), KErrNotFound, ret); |
90 INFO_PRINTF3(_L(" Expected value is %d, Call to GetAppInfo returned : %d "), KErrNotFound, ret); |
95 TEST(ret==KErrNotFound); |
91 TEST(ret==KErrNotFound); |
96 |
92 |
97 //Install the application. |
93 //Copy the registration file to C: drive. |
|
94 CopyRegFileL(EDriveC); |
98 |
95 |
99 CDriveTestObserver* obs = new(ELeave) CDriveTestObserver(); |
96 CDriveTestObserver* obs = new(ELeave) CDriveTestObserver(); |
100 CleanupStack::PushL(obs); |
97 CleanupStack::PushL(obs); |
101 CApaAppListNotifier* notif = CApaAppListNotifier::NewL(obs, CActive::EPriorityHigh); |
98 CApaAppListNotifier* notif = CApaAppListNotifier::NewL(obs, CActive::EPriorityHigh); |
102 CleanupStack::PushL(notif); |
99 CleanupStack::PushL(notif); |
103 |
100 |
104 obs->iNotifier = notif; |
101 obs->iNotifier = notif; |
105 |
102 |
106 CSisFileInstaller sisFileInstaller; |
|
107 sisFileInstaller.InstallSisL(KNotifyDriveAppSisFile); |
|
108 |
|
109 CActiveScheduler::Start(); |
103 CActiveScheduler::Start(); |
110 //Since c:\\private\\10003a3f\\Import\\apps\\ path is Monitored, a notification is issued and applist is updated. |
104 //Since c:\\private\\10003a3f\\Import\\apps\\ path is Monitored, a notification is issued and applist is updated. |
111 TEST(obs->iNotified > 0); |
105 TEST(obs->iNotified > 0); |
112 INFO_PRINTF2(_L("Received %d notifications"),obs->iNotified); |
106 INFO_PRINTF2(_L("Received %d notifications"),obs->iNotified); |
113 |
107 |
114 //Check whether applist is updated and app is present in the applist. |
108 //Check whether applist is updated and app is present in the applist. |
115 ret = theLs.GetAppInfo(appInfo,appUid); |
109 ret = theLs.GetAppInfo(appInfo,appUid); |
116 INFO_PRINTF3(_L(" Expected value is %d, Call to GetAppInfo returned : %d "), KErrNone, ret); |
110 INFO_PRINTF3(_L(" Expected value is %d, Call to GetAppInfo returned : %d "), KErrNone, ret); |
117 TEST(ret==KErrNone); |
111 TEST(ret==KErrNone); |
118 |
112 |
119 //Uninstall the application |
113 //Deleting the rsc file that is present in c:\\private\\10003a3f\\Import\\apps\\ path. |
120 sisFileInstaller.UninstallSisAndWaitForAppListUpdateL(KNotifyDriveAppComponent); |
114 DeleteRegFileL(EDriveC); |
|
115 |
|
116 // Wait for applist to be updated.... |
|
117 User::LeaveIfError(theLs.ForceRegistration(dummy)); |
121 |
118 |
122 //Check whether applist is updated and app is absent in the applist. |
119 //Check whether applist is updated and app is absent in the applist. |
123 ret = theLs.GetAppInfo(appInfo,appUid); |
120 ret = theLs.GetAppInfo(appInfo,appUid); |
124 INFO_PRINTF3(_L(" Expected value is %d, Call to GetAppInfo returned : %d "), KErrNotFound, ret); |
121 INFO_PRINTF3(_L(" Expected value is %d, Call to GetAppInfo returned : %d "), KErrNotFound, ret); |
125 TEST(ret==KErrNotFound); |
122 TEST(ret==KErrNotFound); |
144 #else |
141 #else |
145 ret = theLs.GetAppInfo(appInfo,appUid); |
142 ret = theLs.GetAppInfo(appInfo,appUid); |
146 TEST(ret==KErrNone); |
143 TEST(ret==KErrNone); |
147 INFO_PRINTF3(_L(" Expected value is %d, Call to GetAppInfo returned : %d "),KErrNone, ret); |
144 INFO_PRINTF3(_L(" Expected value is %d, Call to GetAppInfo returned : %d "),KErrNone, ret); |
148 //Deleting the rsc file. |
145 //Deleting the rsc file. |
149 // DeleteRegFileL(drive); |
146 DeleteRegFileL(drive); |
150 #endif |
147 #endif |
151 CleanupStack::PopAndDestroy(3, &theLs); |
148 CleanupStack::PopAndDestroy(3, &theLs); |
152 |
149 |
153 INFO_PRINTF1(_L("End TestDrivesNotificationL()")); |
150 INFO_PRINTF1(_L("End TestDrivesNotificationL()")); |
154 } |
151 } |
185 ret = smlServer.CreateDirectoryL(tempFolderToBeCreated); |
182 ret = smlServer.CreateDirectoryL(tempFolderToBeCreated); |
186 if (ret != KErrNone && ret != KErrAlreadyExists) |
183 if (ret != KErrNone && ret != KErrAlreadyExists) |
187 { |
184 { |
188 User::LeaveIfError(ret); |
185 User::LeaveIfError(ret); |
189 } |
186 } |
190 // ret = smlServer.CopyFileL(KResourceFileSourceZ, tempPathToBeCopied); |
187 ret = smlServer.CopyFileL(KResourceFileSourceZ, tempPathToBeCopied); |
191 TEST(ret == KErrNone); |
188 TEST(ret == KErrNone); |
192 INFO_PRINTF2(_L("Copied Registration file. Finished with the value : %d "), ret); |
189 INFO_PRINTF2(_L("Copied Registration file. Finished with the value : %d "), ret); |
193 CleanupStack::PopAndDestroy(4, &fs); |
190 CleanupStack::PopAndDestroy(4, &fs); |
194 } |
191 } |
195 |
192 |