diff -r 0818dd463d41 -r 924385140d98 appfw/apparchitecture/tef/t_drivenotification.cpp --- a/appfw/apparchitecture/tef/t_drivenotification.cpp Thu Aug 19 10:05:08 2010 +0300 +++ b/appfw/apparchitecture/tef/t_drivenotification.cpp Tue Aug 31 15:24:25 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of "Eclipse Public License v1.0" @@ -29,8 +29,11 @@ #include #include "appfwk_test_utils.h" #include "t_drivenotification.h" +#include "T_SisFileInstaller.h" -_LIT(KResourceFileSourceZ, "z:\\system\\data\\tnotifydrivesapp_reg.rsc"); +_LIT(KNotifyDriveAppSisFile, "z:\\apparctest\\apparctestsisfiles\\tnotifydrivesapp.sis"); +_LIT(KNotifyDriveAppComponent, "tnotifydrivesapp"); + void CDriveTestObserver::HandleAppListEvent(TInt /*aEvent*/) { @@ -82,16 +85,16 @@ CleanupClosePushL(theLs); // Wait for applist to be updated.... - RPointerArray dummy; - User::LeaveIfError(theLs.ForceRegistration(dummy)); + TRequestStatus status; + theLs.SetNotify(ETrue, status); + User::WaitForRequest(status); //Check whether app is not present in the applist TInt ret = theLs.GetAppInfo(appInfo,appUid); INFO_PRINTF3(_L(" Expected value is %d, Call to GetAppInfo returned : %d "), KErrNotFound, ret); TEST(ret==KErrNotFound); - //Copy the registration file to C: drive. - CopyRegFileL(EDriveC); + //Install the application. CDriveTestObserver* obs = new(ELeave) CDriveTestObserver(); CleanupStack::PushL(obs); @@ -99,7 +102,10 @@ CleanupStack::PushL(notif); obs->iNotifier = notif; - + + CSisFileInstaller sisFileInstaller; + sisFileInstaller.InstallSisL(KNotifyDriveAppSisFile); + CActiveScheduler::Start(); //Since c:\\private\\10003a3f\\Import\\apps\\ path is Monitored, a notification is issued and applist is updated. TEST(obs->iNotified > 0); @@ -110,11 +116,8 @@ INFO_PRINTF3(_L(" Expected value is %d, Call to GetAppInfo returned : %d "), KErrNone, ret); TEST(ret==KErrNone); - //Deleting the rsc file that is present in c:\\private\\10003a3f\\Import\\apps\\ path. - DeleteRegFileL(EDriveC); - - // Wait for applist to be updated.... - User::LeaveIfError(theLs.ForceRegistration(dummy)); + //Uninstall the application + sisFileInstaller.UninstallSisAndWaitForAppListUpdateL(KNotifyDriveAppComponent); //Check whether applist is updated and app is absent in the applist. ret = theLs.GetAppInfo(appInfo,appUid); @@ -128,8 +131,8 @@ //Copy the registration file to drive specified. CopyRegFileL(drive); - // Wait for applist to be updated.... - User::LeaveIfError(theLs.ForceRegistration(dummy)); +// // Wait for applist to be updated.... +// User::LeaveIfError(theLs.ForceRegistration(dummy)); //Check whether applist is updated and app is present in the applist. #ifdef __EABI__ @@ -143,7 +146,7 @@ TEST(ret==KErrNone); INFO_PRINTF3(_L(" Expected value is %d, Call to GetAppInfo returned : %d "),KErrNone, ret); //Deleting the rsc file. - DeleteRegFileL(drive); +// DeleteRegFileL(drive); #endif CleanupStack::PopAndDestroy(3, &theLs); @@ -184,7 +187,7 @@ { User::LeaveIfError(ret); } - ret = smlServer.CopyFileL(KResourceFileSourceZ, tempPathToBeCopied); +// ret = smlServer.CopyFileL(KResourceFileSourceZ, tempPathToBeCopied); TEST(ret == KErrNone); INFO_PRINTF2(_L("Copied Registration file. Finished with the value : %d "), ret); CleanupStack::PopAndDestroy(4, &fs);