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