2807 { |
2806 { |
2808 ERR_PRINTF2(_L("Application Registration data not added successfuly , error %d"),res); |
2807 ERR_PRINTF2(_L("Application Registration data not added successfuly , error %d"),res); |
2809 User::Leave(res); |
2808 User::Leave(res); |
2810 } |
2809 } |
2811 CleanupStack::Pop(&sisRegistryAccessSessionSession); |
2810 CleanupStack::Pop(&sisRegistryAccessSessionSession); |
|
2811 SetTestStepResult(EPass); |
2812 return TestStepResult(); |
2812 return TestStepResult(); |
2813 } |
2813 } |
2814 |
2814 |
2815 //////////////////////////////////////////////////////////////////////////// |
2815 //////////////////////////////////////////////////////////////////////////// |
2816 // CRemoveAppRegInfoStep |
2816 // CRemoveAppRegInfoStep |
2817 //////////////////////////////////////////////////////////////////////////// |
2817 //////////////////////////////////////////////////////////////////////////// |
|
2818 |
2818 CRemoveAppRegInfoStep::CRemoveAppRegInfoStep() |
2819 CRemoveAppRegInfoStep::CRemoveAppRegInfoStep() |
2819 { |
2820 { |
2820 SetTestStepName(KIsFileRegisteredStep); |
2821 SetTestStepName(KIsFileRegisteredStep); |
2821 } |
2822 } |
2822 |
2823 |
2823 TVerdict CRemoveAppRegInfoStep::doTestStepL() |
2824 TVerdict CRemoveAppRegInfoStep::doTestStepL() |
2824 { |
2825 { |
2825 TBool expectedResult(EPass); |
|
2826 TPtrC regFileName; |
2826 TPtrC regFileName; |
2827 if(!GetStringFromConfig(ConfigSection(), _L("regFileName"), regFileName)) |
2827 if(!GetStringFromConfig(ConfigSection(), _L("regFileName"), regFileName)) |
2828 { |
2828 { |
2829 ERR_PRINTF1(_L("Reg File Name was not found in ini")); |
2829 ERR_PRINTF1(_L("Reg File Name was not found in ini")); |
2830 User::Leave(KErrNotFound); |
2830 User::Leave(KErrNotFound); |
2833 RSisRegistryAccessSession sisRegistryAccessSessionSession; |
2833 RSisRegistryAccessSession sisRegistryAccessSessionSession; |
2834 User::LeaveIfError(sisRegistryAccessSessionSession.Connect()); |
2834 User::LeaveIfError(sisRegistryAccessSessionSession.Connect()); |
2835 CleanupClosePushL(sisRegistryAccessSessionSession); |
2835 CleanupClosePushL(sisRegistryAccessSessionSession); |
2836 |
2836 |
2837 TInt res = sisRegistryAccessSessionSession.RemoveAppRegInfoL(regFileName, iTimeMeasuredExternally ); |
2837 TInt res = sisRegistryAccessSessionSession.RemoveAppRegInfoL(regFileName, iTimeMeasuredExternally ); |
2838 |
2838 |
2839 if(res != KErrNone) |
2839 if(res != KErrNone) |
2840 { |
2840 { |
2841 ERR_PRINTF2(_L("Application Registration data not added successfuly , error %d"),res); |
2841 ERR_PRINTF2(_L("Application Registration data not added successfuly , error %d"),res); |
2842 User::Leave(res); |
2842 User::Leave(res); |
2843 } |
2843 } |
2844 CleanupStack::Pop(&sisRegistryAccessSessionSession); |
2844 CleanupStack::PopAndDestroy(&sisRegistryAccessSessionSession); |
|
2845 SetTestStepResult(EPass); |
2845 return TestStepResult(); |
2846 return TestStepResult(); |
2846 } |
2847 } |
2847 |
2848 |
|
2849 ////////////////////// |
|
2850 //////CheckAppRegData |
|
2851 ///////////////////// |
|
2852 |
|
2853 CheckAppRegData::CheckAppRegData() |
|
2854 { |
|
2855 SetTestStepName(KIsFileRegisteredStep); |
|
2856 } |
|
2857 |
|
2858 TVerdict CheckAppRegData::doTestStepL() |
|
2859 { |
|
2860 SetTestStepResult(EPass); |
|
2861 // Verify if the reg data is removed properly or not |
|
2862 TBool isAppDataExists(EFalse); |
|
2863 Usif::RSoftwareComponentRegistry scrSession; |
|
2864 User::LeaveIfError(scrSession.Connect()); |
|
2865 CleanupClosePushL(scrSession); |
|
2866 GetBoolFromConfig(ConfigSection(), _L("appDataExists"), isAppDataExists); |
|
2867 if(isAppDataExists) |
|
2868 { |
|
2869 TPtrC appFileName; |
|
2870 if(GetStringFromConfig(ConfigSection(), _L("appFileName"), appFileName)) |
|
2871 { |
|
2872 TUid appUid; |
|
2873 TInt intAppUid(0); |
|
2874 if(!GetHexFromConfig(ConfigSection(), _L("appUid"), intAppUid)) |
|
2875 { |
|
2876 User::Leave(KErrNotFound); |
|
2877 } |
|
2878 |
|
2879 appUid = TUid::Uid(intAppUid); |
|
2880 RArray<TUid> appUidArray; |
|
2881 CleanupClosePushL(appUidArray); |
|
2882 appUidArray.AppendL(appUid); |
|
2883 |
|
2884 //check if we have rolled back to the reg in rom after removal |
|
2885 Usif::RApplicationInfoView appRegistryView; |
|
2886 CleanupClosePushL(appRegistryView); |
|
2887 Usif::CAppInfoFilter* appInfoFilter = Usif::CAppInfoFilter::NewLC(); |
|
2888 appInfoFilter->SetAllApps(); |
|
2889 appRegistryView.OpenViewL(scrSession, appInfoFilter); |
|
2890 RPointerArray<Usif::TAppRegInfo> appInfo; |
|
2891 CleanupClosePushL(appInfo); |
|
2892 appRegistryView.GetNextAppInfoL(5, appInfo); |
|
2893 |
|
2894 for(TInt i = 0; i < 5 ; ++i) |
|
2895 { |
|
2896 if(appInfo[i]->Uid() == appUid) |
|
2897 { |
|
2898 if(appInfo[i]->FullName().Compare(appFileName) != 0) |
|
2899 { |
|
2900 SetTestStepResult(EFail); |
|
2901 CleanupStack::Pop(&appInfo); |
|
2902 appInfo.ResetAndDestroy(); |
|
2903 CleanupStack::PopAndDestroy(4, &scrSession); // appInfoFilter, appRegistryView, appUid, scrSession |
|
2904 return TestStepResult(); |
|
2905 } |
|
2906 break; |
|
2907 } |
|
2908 } |
|
2909 CleanupStack::Pop(&appInfo); |
|
2910 appInfo.ResetAndDestroy(); |
|
2911 CleanupStack::PopAndDestroy(3, &appUidArray); // appInfoFilter, appRegistryView, |
|
2912 } |
|
2913 } |
|
2914 else |
|
2915 { |
|
2916 TUid appUid = TUid::Uid(0); |
|
2917 TInt intAppUid(0); |
|
2918 if(!GetHexFromConfig(ConfigSection(), _L("appUid"), intAppUid)) |
|
2919 { |
|
2920 User::Leave(KErrNotFound); |
|
2921 } |
|
2922 appUid = TUid::Uid(intAppUid); |
|
2923 |
|
2924 TRAPD(err, scrSession.GetComponentIdForAppL(appUid)); |
|
2925 if(err != KErrNotFound) |
|
2926 { |
|
2927 SetTestStepResult(EFail); |
|
2928 CleanupStack::PopAndDestroy(&scrSession); |
|
2929 return TestStepResult(); |
|
2930 } |
|
2931 } |
|
2932 |
|
2933 CleanupStack::PopAndDestroy(&scrSession); |
|
2934 return TestStepResult(); |
|
2935 } |