117 |
114 |
118 TInt RTstAppService::DoTestL(TUid aServiceUid, TBool aPassingFileByHandle, const TDesC& aFileNameWithoutDriveOrPath) |
115 TInt RTstAppService::DoTestL(TUid aServiceUid, TBool aPassingFileByHandle, const TDesC& aFileNameWithoutDriveOrPath) |
119 { // static |
116 { // static |
120 RTstAppService appService(aServiceUid); |
117 RTstAppService appService(aServiceUid); |
121 CleanupClosePushL(appService); |
118 CleanupClosePushL(appService); |
122 appService.ConnectL(); |
119 |
|
120 TInt error=KErrNone; |
|
121 |
|
122 //Try maximum 6 times to connect to server application |
|
123 for(TInt loopCount=0; loopCount<6; loopCount++) |
|
124 { |
|
125 TRAP(error, appService.ConnectL()); |
|
126 if(error==KErrNone) |
|
127 break; |
|
128 |
|
129 if(error!=KErrNotFound) |
|
130 User::Leave(error); |
|
131 |
|
132 User::After(1000000); //wait till one second before trying again |
|
133 } |
|
134 |
|
135 User::LeaveIfError(error); |
|
136 |
123 TRequestStatus requestStatus; |
137 TRequestStatus requestStatus; |
124 appService.ReceiveTestResult(requestStatus, aPassingFileByHandle, aFileNameWithoutDriveOrPath); |
138 appService.ReceiveTestResult(requestStatus, aPassingFileByHandle, aFileNameWithoutDriveOrPath); |
125 User::WaitForRequest(requestStatus); |
139 User::WaitForRequest(requestStatus); |
126 const TInt result=User::LeaveIfError(requestStatus.Int()); |
140 const TInt result=User::LeaveIfError(requestStatus.Int()); |
127 CleanupStack::PopAndDestroy(&appService); |
141 CleanupStack::PopAndDestroy(&appService); |
500 TThreadId threadId; |
514 TThreadId threadId; |
501 //due to access of file in private folder |
515 //due to access of file in private folder |
502 APPFWK_EXPECTED_PLATSEC_START; |
516 APPFWK_EXPECTED_PLATSEC_START; |
503 User::LeaveIfError(aApparcServer.StartDocument(fullFileName, threadId)); |
517 User::LeaveIfError(aApparcServer.StartDocument(fullFileName, threadId)); |
504 APPFWK_EXPECTED_PLATSEC_FINISH; |
518 APPFWK_EXPECTED_PLATSEC_FINISH; |
505 User::After(1500000); |
|
506 TEST(RTstAppService::DoTestL(serviceUid, EFalse, fileNameWithoutDriveOrPath) == KCheckPass); |
519 TEST(RTstAppService::DoTestL(serviceUid, EFalse, fileNameWithoutDriveOrPath) == KCheckPass); |
507 } |
520 } |
508 |
521 |
509 { |
522 { |
510 TThreadId threadId; |
523 TThreadId threadId; |
511 User::LeaveIfError(aApparcServer.StartDocument(fullFileName, TDataType(expectedDataType), threadId)); |
524 User::LeaveIfError(aApparcServer.StartDocument(fullFileName, TDataType(expectedDataType), threadId)); |
512 User::After(1500000); |
|
513 TEST(RTstAppService::DoTestL(serviceUid, EFalse, fileNameWithoutDriveOrPath) == KCheckPass); |
525 TEST(RTstAppService::DoTestL(serviceUid, EFalse, fileNameWithoutDriveOrPath) == KCheckPass); |
514 } |
526 } |
515 |
527 |
516 { |
528 { |
517 TThreadId threadId; |
529 TThreadId threadId; |
518 User::LeaveIfError(aApparcServer.StartDocument(fullFileName, TUid::Uid(0x10207f92), threadId)); |
530 User::LeaveIfError(aApparcServer.StartDocument(fullFileName, TUid::Uid(0x10207f92), threadId)); |
519 User::After(1500000); |
|
520 TEST(RTstAppService::DoTestL(serviceUid, EFalse, fileNameWithoutDriveOrPath) == KCheckPass); |
531 TEST(RTstAppService::DoTestL(serviceUid, EFalse, fileNameWithoutDriveOrPath) == KCheckPass); |
521 } |
532 } |
522 } |
533 } |
523 } |
534 } |
524 //avoid race conditions |
535 //avoid race conditions |
651 |
661 |
652 INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() ")); |
662 INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() ")); |
653 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
663 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
654 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, *registrationResourceFileWriter, NULL, NULL); |
664 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, *registrationResourceFileWriter, NULL, NULL); |
655 aApparcServer.CommitNonNativeApplicationsUpdatesL(); |
665 aApparcServer.CommitNonNativeApplicationsUpdatesL(); |
656 CheckApplicationLaunchesOkayL(aApparcServer, *nextCommandLine, (TAny*)EAppA); |
666 CheckApplicationLaunchesOkayL(aApparcServer, *nextCommandLine, EAppA); |
657 //Check if there is no problem in registering same app again(basically simulating an upgrade) |
667 //Check if there is no problem in registering same app again(basically simulating an upgrade) |
658 INFO_PRINTF1(_L("..registering same app again using RegisterNonNativeApplicationL() ")); |
668 INFO_PRINTF1(_L("..registering same app again using RegisterNonNativeApplicationL() ")); |
659 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
669 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
660 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, *registrationResourceFileWriter, NULL, NULL); |
670 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, *registrationResourceFileWriter, NULL, NULL); |
661 aApparcServer.CommitNonNativeApplicationsUpdatesL(); |
671 aApparcServer.CommitNonNativeApplicationsUpdatesL(); |
662 CheckApplicationLaunchesOkayL(aApparcServer, *nextCommandLine, (TAny*)EAppA); |
672 CheckApplicationLaunchesOkayL(aApparcServer, *nextCommandLine, EAppA); |
663 |
673 |
664 INFO_PRINTF1(_L("..deregistering app using DeregisterNonNativeApplicationL() ")); |
674 INFO_PRINTF1(_L("..deregistering app using DeregisterNonNativeApplicationL() ")); |
665 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
675 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
666 aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA)); |
676 aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA)); |
667 aApparcServer.CommitNonNativeApplicationsUpdatesL(); |
677 aApparcServer.CommitNonNativeApplicationsUpdatesL(); |
668 CheckApplicationFailsToLaunchL(aApparcServer, *nextCommandLine, (TAny*)EAppA); |
678 CheckApplicationFailsToLaunchL(aApparcServer, *nextCommandLine, EAppA); |
669 |
679 |
670 _LIT8(KLitOpData, "opaquedata"); |
680 _LIT8(KLitOpData, "opaquedata"); |
671 registrationResourceFileWriter->SetOpaqueDataL(KLitOpData); |
681 registrationResourceFileWriter->SetOpaqueDataL(KLitOpData); |
672 |
682 |
673 CApaLocalisableResourceFileWriter* const localisableResourceFileWriter_noIcons=CApaLocalisableResourceFileWriter::NewL(KNullDesC, KLitApplicationCaptionA, 0, KNullDesC); |
683 CApaLocalisableResourceFileWriter* const localisableResourceFileWriter_noIcons=CApaLocalisableResourceFileWriter::NewL(KNullDesC, KLitApplicationCaptionA, 0, KNullDesC); |
675 INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() with localisableResourceFileWriter_noIcons")); |
685 INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() with localisableResourceFileWriter_noIcons")); |
676 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
686 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
677 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, *registrationResourceFileWriter, localisableResourceFileWriter_noIcons, NULL); |
687 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, *registrationResourceFileWriter, localisableResourceFileWriter_noIcons, NULL); |
678 aApparcServer.CommitNonNativeApplicationsUpdatesL(); |
688 aApparcServer.CommitNonNativeApplicationsUpdatesL(); |
679 CleanupStack::PopAndDestroy(localisableResourceFileWriter_noIcons); |
689 CleanupStack::PopAndDestroy(localisableResourceFileWriter_noIcons); |
680 CheckApplicationLaunchesOkayL(aApparcServer, *nextCommandLine, (TAny*)EAppA); |
690 CheckApplicationLaunchesOkayL(aApparcServer, *nextCommandLine, EAppA); |
681 |
691 |
682 //Testing with OpaqueData |
692 //Testing with OpaqueData |
683 TPtrC8 opData =nextCommandLine->OpaqueData(); |
693 TPtrC8 opData =nextCommandLine->OpaqueData(); |
684 TInt tst=opData.CompareF(KLitOpData); |
694 TInt tst=opData.CompareF(KLitOpData); |
685 TEST(opData.CompareF(KLitOpData)==0); |
695 TEST(opData.CompareF(KLitOpData)==0); |
686 |
696 |
687 INFO_PRINTF1(_L("..deregistering app using DeregisterNonNativeApplicationL() with localisableResourceFileWriter_noIcons")); |
697 INFO_PRINTF1(_L("..deregistering app using DeregisterNonNativeApplicationL() with localisableResourceFileWriter_noIcons")); |
688 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
698 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
689 aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA)); |
699 aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA)); |
690 aApparcServer.CommitNonNativeApplicationsUpdatesL(); |
700 aApparcServer.CommitNonNativeApplicationsUpdatesL(); |
691 CheckApplicationFailsToLaunchL(aApparcServer, *nextCommandLine, (TAny*)EAppA); |
701 CheckApplicationFailsToLaunchL(aApparcServer, *nextCommandLine, EAppA); |
692 |
702 |
693 //Testing with IconFile |
703 //Testing with IconFile |
694 CApaLocalisableResourceFileWriter* const localisableResourceFileWriter_withIcons=CApaLocalisableResourceFileWriter::NewL(KNullDesC, KLitApplicationCaptionA, 2, KNullDesC); |
704 CApaLocalisableResourceFileWriter* const localisableResourceFileWriter_withIcons=CApaLocalisableResourceFileWriter::NewL(KNullDesC, KLitApplicationCaptionA, 2, KNullDesC); |
695 CleanupStack::PushL(localisableResourceFileWriter_withIcons); |
705 CleanupStack::PushL(localisableResourceFileWriter_withIcons); |
696 INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() with localisableResourceFileWriter_withIcons")); |
706 INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() with localisableResourceFileWriter_withIcons")); |
703 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, *registrationResourceFileWriter, localisableResourceFileWriter_withIcons, &iconFile); |
713 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, *registrationResourceFileWriter, localisableResourceFileWriter_withIcons, &iconFile); |
704 iconFile.Close(); |
714 iconFile.Close(); |
705 CleanupStack::PopAndDestroy(&iconFile); |
715 CleanupStack::PopAndDestroy(&iconFile); |
706 |
716 |
707 aApparcServer.CommitNonNativeApplicationsUpdatesL(); |
717 aApparcServer.CommitNonNativeApplicationsUpdatesL(); |
708 CheckApplicationLaunchesOkayL(aApparcServer, *nextCommandLine, (TAny*)EAppA); |
718 CheckApplicationLaunchesOkayL(aApparcServer, *nextCommandLine, EAppA); |
709 |
719 |
710 HBufC* iconFileName = NULL; |
720 HBufC* iconFileName = NULL; |
711 TInt err = aApparcServer.GetAppIcon(TUid::Uid(KApplicationA),iconFileName); |
721 TInt err = aApparcServer.GetAppIcon(TUid::Uid(KApplicationA),iconFileName); |
712 TEST(err == KErrNone); |
722 TEST(err == KErrNone); |
713 _LIT(KIconFileName, "tstapp.mbm"); |
723 _LIT(KIconFileName, "tstapp.mbm"); |
905 CApaCommandLine* commandLine=NULL; |
916 CApaCommandLine* commandLine=NULL; |
906 User::LeaveIfError(CApaCommandLine::GetCommandLineFromProcessEnvironment(commandLine)); |
917 User::LeaveIfError(CApaCommandLine::GetCommandLineFromProcessEnvironment(commandLine)); |
907 CleanupStack::PushL(commandLine); |
918 CleanupStack::PushL(commandLine); |
908 const TPtrC executableName(commandLine->ExecutableName()); |
919 const TPtrC executableName(commandLine->ExecutableName()); |
909 |
920 |
910 |
|
911 _LIT_SECURITY_POLICY_S0(readSecurityPolicy, KMySID); |
921 _LIT_SECURITY_POLICY_S0(readSecurityPolicy, KMySID); |
912 _LIT_SECURITY_POLICY_PASS(writeSecurityPolicy); |
922 _LIT_SECURITY_POLICY_PASS(writeSecurityPolicy); |
913 |
923 |
914 //TNNAPP2.exe sets the document name passed as part of the command line to this property. |
924 //TNNAPP2.exe sets the document name passed as part of the command line to this property. |
915 const TInt error=RProperty::Define(KPropertyKey, RProperty::EText, readSecurityPolicy, writeSecurityPolicy); |
925 const TInt error=RProperty::Define(KPropertyKey, RProperty::EText, readSecurityPolicy, writeSecurityPolicy); |
916 if (error!=KErrAlreadyExists) |
926 if (error!=KErrAlreadyExists) |
917 { |
927 { |
918 User::LeaveIfError(error); |
928 User::LeaveIfError(error); |
963 endTime.HomeTime(); |
973 endTime.HomeTime(); |
964 INFO_PRINTF1(_L("..commiting the deregistration is done")); |
974 INFO_PRINTF1(_L("..commiting the deregistration is done")); |
965 timeTakenToCommitDeregistration=endTime.MicroSecondsFrom(startTime); |
975 timeTakenToCommitDeregistration=endTime.MicroSecondsFrom(startTime); |
966 value = timeTakenToCommitDeregistration.Int64(); |
976 value = timeTakenToCommitDeregistration.Int64(); |
967 INFO_PRINTF2(_L("..Time taken for deregistration of application by CommitNonNativeApplicationsUpdatesL is %d micro seconds"), value); |
977 INFO_PRINTF2(_L("..Time taken for deregistration of application by CommitNonNativeApplicationsUpdatesL is %d micro seconds"), value); |
968 CheckApplicationFailsToLaunchL(aApparcServer, *nextCommandLine, (TAny*)EAppA); |
978 CheckApplicationFailsToLaunchL(aApparcServer, *nextCommandLine, EAppA); |
969 |
979 |
970 |
980 |
971 INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() ")); |
981 INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() ")); |
972 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
982 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
973 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, *registrationResourceFileWriter, NULL, NULL); |
983 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, *registrationResourceFileWriter, NULL, NULL); |
981 value = timeTakenToForceCommitRegistration.Int64(); |
991 value = timeTakenToForceCommitRegistration.Int64(); |
982 INFO_PRINTF2(_L("..Time taken for registration of application by ForceCommitNonNativeApplicationsUpdatesL is %d micro seconds"), value); |
992 INFO_PRINTF2(_L("..Time taken for registration of application by ForceCommitNonNativeApplicationsUpdatesL is %d micro seconds"), value); |
983 TRequestStatus appScanCompleted=KRequestPending; |
993 TRequestStatus appScanCompleted=KRequestPending; |
984 aApparcServer.SetNotify(EFalse,appScanCompleted); |
994 aApparcServer.SetNotify(EFalse,appScanCompleted); |
985 User::WaitForRequest(appScanCompleted); |
995 User::WaitForRequest(appScanCompleted); |
986 TEST(appScanCompleted.Int()==MApaAppListServObserver::EAppListChanged); |
996 TEST(appScanCompleted.Int()==MApaAppListServObserver::EAppListChanged); |
987 CheckApplicationLaunchesOkayL(aApparcServer, *nextCommandLine, (TAny*)EAppA); |
997 CheckApplicationLaunchesOkayL(aApparcServer, *nextCommandLine, EAppA); |
988 |
998 |
989 INFO_PRINTF1(_L("..deregistering app using DeregisterNonNativeApplicationL() ")); |
999 INFO_PRINTF1(_L("..deregistering app using DeregisterNonNativeApplicationL() ")); |
990 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1000 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
991 aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA)); |
1001 aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA)); |
992 TTimeIntervalMicroSeconds timeTakenToForceCommitDeregistration; |
1002 TTimeIntervalMicroSeconds timeTakenToForceCommitDeregistration; |
999 value = timeTakenToForceCommitDeregistration.Int64(); |
1009 value = timeTakenToForceCommitDeregistration.Int64(); |
1000 INFO_PRINTF2(_L("..Time taken for deregistration of application by ForceCommitNonNativeApplicationsUpdatesL is %d micro seconds"), value); |
1010 INFO_PRINTF2(_L("..Time taken for deregistration of application by ForceCommitNonNativeApplicationsUpdatesL is %d micro seconds"), value); |
1001 appScanCompleted=KRequestPending; |
1011 appScanCompleted=KRequestPending; |
1002 aApparcServer.SetNotify(EFalse,appScanCompleted); |
1012 aApparcServer.SetNotify(EFalse,appScanCompleted); |
1003 User::WaitForRequest(appScanCompleted); |
1013 User::WaitForRequest(appScanCompleted); |
1004 TEST(appScanCompleted.Int()==MApaAppListServObserver::EAppListChanged); |
1014 TEST(appScanCompleted.Int()==MApaAppListServObserver::EAppListChanged); |
1005 CheckApplicationFailsToLaunchL(aApparcServer, *nextCommandLine, (TAny*)EAppA); |
1015 CheckApplicationFailsToLaunchL(aApparcServer, *nextCommandLine, EAppA); |
1006 TEST(timeTakenToForceCommitRegistration<timeTakenToCommitRegistration); |
1016 TEST(timeTakenToForceCommitRegistration<timeTakenToCommitRegistration); |
1007 TEST(timeTakenToForceCommitDeregistration<timeTakenToCommitDeregistration); |
1017 TEST(timeTakenToForceCommitDeregistration<timeTakenToCommitDeregistration); |
1008 |
1018 |
1009 CleanupStack::PopAndDestroy(4, commandLine); |
1019 CleanupStack::PopAndDestroy(4, commandLine); |
1010 } |
1020 } |
1011 |
1021 |
1012 /** |
1022 /** |
1013 @SYMTestCaseID APPFWK-APPARC-0103 |
1023 @SYMTestCaseID APPFWK-APPARC-0103 |
1014 |
1024 |
1015 @SYMDEF PDEF134174 |
1025 @SYMDEF PDEF135324 |
1016 |
1026 |
1017 @SYMTestCaseDesc Tests ForceCommitNonNativeApplicationsUpdatesL() API. |
1027 @SYMTestCaseDesc Tests ForceCommitNonNativeApplicationsUpdatesL() API. |
1018 |
1028 |
1019 @SYMTestPriority High |
1029 @SYMTestPriority High |
1020 |
1030 |
1071 |
1081 |
1072 TApaAppInfo info; |
1082 TApaAppInfo info; |
1073 CApaRegistrationResourceFileWriter* const registrationResourceFileWriterB=CApaRegistrationResourceFileWriter::NewL(TUid::Uid(KApplicationB), KLitLogicalExecutableA, TApaAppCapability::ENonNative); |
1083 CApaRegistrationResourceFileWriter* const registrationResourceFileWriterB=CApaRegistrationResourceFileWriter::NewL(TUid::Uid(KApplicationB), KLitLogicalExecutableA, TApaAppCapability::ENonNative); |
1074 CleanupStack::PushL(registrationResourceFileWriterB); |
1084 CleanupStack::PushL(registrationResourceFileWriterB); |
1075 registrationResourceFileWriterB->AddDataTypeL(KDataTypePriorityNormal, KLitMimeTypeB); |
1085 registrationResourceFileWriterB->AddDataTypeL(KDataTypePriorityNormal, KLitMimeTypeB); |
1076 |
1086 |
1077 TestForceCommitL(aApparcServer, *registrationResourceFileWriter, *registrationResourceFileWriterB, *nextCommandLine); |
1087 TestForceCommitL(aApparcServer, *registrationResourceFileWriter, *registrationResourceFileWriterB, *nextCommandLine); |
1078 TestRollbackRegistrationL(aApparcServer, *registrationResourceFileWriter, *registrationResourceFileWriterB, *nextCommandLine); |
1088 TestRollbackRegistrationL(aApparcServer, *registrationResourceFileWriter, *registrationResourceFileWriterB, *nextCommandLine); |
1079 TestRollbackDeregistrationL(aApparcServer, *registrationResourceFileWriter, *registrationResourceFileWriterB, *nextCommandLine); |
1089 TestRollbackDeregistrationL(aApparcServer, *registrationResourceFileWriter, *registrationResourceFileWriterB, *nextCommandLine); |
1080 |
1090 |
1081 CleanupStack::PopAndDestroy(5, commandLine); |
1091 CleanupStack::PopAndDestroy(5, commandLine); |
1097 //Register app A and ForceCommitNNAUpdate |
1107 //Register app A and ForceCommitNNAUpdate |
1098 INFO_PRINTF1(_L("..registering app 'A' using RegisterNonNativeApplicationL() ")); |
1108 INFO_PRINTF1(_L("..registering app 'A' using RegisterNonNativeApplicationL() ")); |
1099 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1109 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1100 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, aRegistrationResourceFileWriter, NULL, NULL); |
1110 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, aRegistrationResourceFileWriter, NULL, NULL); |
1101 aApparcServer.ForceCommitNonNativeApplicationsUpdatesL(); |
1111 aApparcServer.ForceCommitNonNativeApplicationsUpdatesL(); |
1102 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppA);//Since applist update has not yet completed |
1112 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, EAppA);//Since applist update has not yet completed |
1103 |
1113 |
1104 //Register app B and ForceCommitNNAUpdate |
1114 //Register app B and ForceCommitNNAUpdate |
1105 INFO_PRINTF1(_L("..registering app 'B' using RegisterNonNativeApplicationL() ")); |
1115 INFO_PRINTF1(_L("..registering app 'B' using RegisterNonNativeApplicationL() ")); |
1106 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1116 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1107 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, aRegistrationResourceFileWriterB, NULL, NULL); |
1117 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, aRegistrationResourceFileWriterB, NULL, NULL); |
1108 aApparcServer.ForceCommitNonNativeApplicationsUpdatesL(); |
1118 aApparcServer.ForceCommitNonNativeApplicationsUpdatesL(); |
1109 TThreadId notUsed2; |
1119 TThreadId notUsed2; |
1110 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppB); |
1120 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, EAppB); |
1111 |
1121 |
1112 //Wait for applist to be updated |
1122 //Wait for applist to be updated |
1113 WaitForApplistUpdate(aApparcServer); |
1123 WaitForApplistUpdate(aApparcServer); |
1114 CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, (TAny*)EAppA);//Check if app A launches since applist update is complete now |
1124 CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, EAppA);//Check if app A launches since applist update is complete now |
1115 CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, (TAny*)EAppB);//Similarly check if app B launches |
1125 CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, EAppB);//Similarly check if app B launches |
1116 |
1126 |
1117 //DeRegister app B and ForceCommitNNAUpdate |
1127 //DeRegister app B and ForceCommitNNAUpdate |
1118 INFO_PRINTF1(_L("..deregistering app 'B' using DeregisterNonNativeApplicationL() ")); |
1128 INFO_PRINTF1(_L("..deregistering app 'B' using DeregisterNonNativeApplicationL() ")); |
1119 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1129 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1120 aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationB)); |
1130 aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationB)); |
1121 aApparcServer.ForceCommitNonNativeApplicationsUpdatesL(); |
1131 aApparcServer.ForceCommitNonNativeApplicationsUpdatesL(); |
1122 //Since applist update has not yet completed, both apps should launch |
1132 //Since applist update has not yet completed, both apps should launch |
1123 CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, (TAny*)EAppA); |
1133 CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, EAppA); |
1124 CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, (TAny*)EAppB); |
1134 CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, EAppB); |
1125 |
1135 |
1126 //Wait for applist to be updated |
1136 //Wait for applist to be updated |
1127 WaitForApplistUpdate(aApparcServer); |
1137 WaitForApplistUpdate(aApparcServer); |
1128 CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, (TAny*)EAppA); |
1138 CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, EAppA); |
1129 //Check if app B fails to launches Since applist update is complete now |
1139 //Check if app B fails to launches Since applist update is complete now |
1130 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppB); |
1140 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, EAppB); |
1131 |
1141 |
1132 //Deregister app A and ForceCommitNNAUpdate |
1142 //Deregister app A and ForceCommitNNAUpdate |
1133 INFO_PRINTF1(_L("..deregistering app 'A' using RegisterNonNativeApplicationL() ")); |
1143 INFO_PRINTF1(_L("..deregistering app 'A' using RegisterNonNativeApplicationL() ")); |
1134 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1144 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1135 aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA)); |
1145 aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA)); |
1136 aApparcServer.ForceCommitNonNativeApplicationsUpdatesL(); |
1146 aApparcServer.ForceCommitNonNativeApplicationsUpdatesL(); |
1137 WaitForApplistUpdate(aApparcServer); |
1147 WaitForApplistUpdate(aApparcServer); |
1138 //Both apps fail to launch since they are deregistered |
1148 //Both apps fail to launch since they are deregistered |
1139 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppA); |
1149 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, EAppA); |
1140 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppB); |
1150 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, EAppB); |
1141 |
1151 |
1142 INFO_PRINTF1(_L("..End Testing TestForceCommitL API...")); |
1152 INFO_PRINTF1(_L("..End Testing TestForceCommitL API...")); |
1143 } |
1153 } |
1144 |
1154 |
1145 void CT_NonNativeAppsStep::TestRollbackRegistrationL(RApaLsSession& aApparcServer, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriter, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriterB, CApaCommandLine& aNextCommandLine) |
1155 void CT_NonNativeAppsStep::TestRollbackRegistrationL(RApaLsSession& aApparcServer, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriter, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriterB, CApaCommandLine& aNextCommandLine) |
1149 //Register app A and ForceCommitNNAUpdate |
1159 //Register app A and ForceCommitNNAUpdate |
1150 INFO_PRINTF1(_L("..registering app 'A' using RegisterNonNativeApplicationL() ")); |
1160 INFO_PRINTF1(_L("..registering app 'A' using RegisterNonNativeApplicationL() ")); |
1151 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1161 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1152 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, aRegistrationResourceFileWriter, NULL, NULL); |
1162 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, aRegistrationResourceFileWriter, NULL, NULL); |
1153 aApparcServer.ForceCommitNonNativeApplicationsUpdatesL(); |
1163 aApparcServer.ForceCommitNonNativeApplicationsUpdatesL(); |
1154 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppA);//Since applist update has not yet completed |
1164 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, EAppA);//Since applist update has not yet completed |
1155 |
1165 |
1156 //Register app B and RollbackNNAUpdates |
1166 //Register app B and RollbackNNAUpdates |
1157 INFO_PRINTF1(_L("..registering app 'B' using RegisterNonNativeApplicationL() ")); |
1167 INFO_PRINTF1(_L("..registering app 'B' using RegisterNonNativeApplicationL() ")); |
1158 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1168 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1159 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, aRegistrationResourceFileWriterB, NULL, NULL); |
1169 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, aRegistrationResourceFileWriterB, NULL, NULL); |
1160 aApparcServer.RollbackNonNativeApplicationsUpdates(); |
1170 aApparcServer.RollbackNonNativeApplicationsUpdates(); |
1161 |
1171 |
1162 //Wait for applist to be updated |
1172 //Wait for applist to be updated |
1163 WaitForApplistUpdate(aApparcServer); |
1173 WaitForApplistUpdate(aApparcServer); |
1164 CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, (TAny*)EAppA);//Check if app A launches |
1174 CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, EAppA);//Check if app A launches |
1165 //App B's registration was rolled back, so cannot launch it |
1175 //App B's registration was rolled back, so cannot launch it |
1166 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppB); |
1176 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, EAppB); |
1167 |
1177 |
1168 //DeRegister app A and ForceCommitNNAUpdate |
1178 //DeRegister app A and ForceCommitNNAUpdate |
1169 INFO_PRINTF1(_L("..deregistering app 'A' using DeregisterNonNativeApplicationL() ")); |
1179 INFO_PRINTF1(_L("..deregistering app 'A' using DeregisterNonNativeApplicationL() ")); |
1170 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1180 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1171 aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA)); |
1181 aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA)); |
1172 aApparcServer.ForceCommitNonNativeApplicationsUpdatesL(); |
1182 aApparcServer.ForceCommitNonNativeApplicationsUpdatesL(); |
1173 //Since applist update has not yet completed, app A should launch |
1183 //Since applist update has not yet completed, app A should launch |
1174 CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, (TAny*)EAppA); |
1184 CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, EAppA); |
1175 |
1185 |
1176 //Wait for applist to be updated |
1186 //Wait for applist to be updated |
1177 WaitForApplistUpdate(aApparcServer); |
1187 WaitForApplistUpdate(aApparcServer); |
1178 //Both apps fail to launch |
1188 //Both apps fail to launch |
1179 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppA); |
1189 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, EAppA); |
1180 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppB); |
1190 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, EAppB); |
1181 |
1191 |
1182 INFO_PRINTF1(_L("..End Testing TestRollbackRegistrationL API...")); |
1192 INFO_PRINTF1(_L("..End Testing TestRollbackRegistrationL API...")); |
1183 } |
1193 } |
1184 |
1194 |
1185 void CT_NonNativeAppsStep::TestRollbackDeregistrationL(RApaLsSession& aApparcServer, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriter, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriterB, CApaCommandLine& aNextCommandLine) |
1195 void CT_NonNativeAppsStep::TestRollbackDeregistrationL(RApaLsSession& aApparcServer, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriter, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriterB, CApaCommandLine& aNextCommandLine) |
1189 //Register app A and ForceCommitNNAUpdate |
1199 //Register app A and ForceCommitNNAUpdate |
1190 INFO_PRINTF1(_L("..registering app 'A' using RegisterNonNativeApplicationL() ")); |
1200 INFO_PRINTF1(_L("..registering app 'A' using RegisterNonNativeApplicationL() ")); |
1191 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1201 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1192 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, aRegistrationResourceFileWriter, NULL, NULL); |
1202 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, aRegistrationResourceFileWriter, NULL, NULL); |
1193 aApparcServer.ForceCommitNonNativeApplicationsUpdatesL(); |
1203 aApparcServer.ForceCommitNonNativeApplicationsUpdatesL(); |
1194 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppA);//Since applist update has not yet completed |
1204 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, EAppA);//Since applist update has not yet completed |
1195 |
1205 |
1196 //Register app B and ForceCommitNNAUpdate |
1206 //Register app B and ForceCommitNNAUpdate |
1197 INFO_PRINTF1(_L("..registering app 'B' using RegisterNonNativeApplicationL() ")); |
1207 INFO_PRINTF1(_L("..registering app 'B' using RegisterNonNativeApplicationL() ")); |
1198 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1208 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1199 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, aRegistrationResourceFileWriterB, NULL, NULL); |
1209 aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KApplicationType), EDriveC, aRegistrationResourceFileWriterB, NULL, NULL); |
1200 aApparcServer.ForceCommitNonNativeApplicationsUpdatesL(); |
1210 aApparcServer.ForceCommitNonNativeApplicationsUpdatesL(); |
1201 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppB); |
1211 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, EAppB); |
1202 |
1212 |
1203 //Wait for applist to be updated |
1213 //Wait for applist to be updated |
1204 WaitForApplistUpdate(aApparcServer); |
1214 WaitForApplistUpdate(aApparcServer); |
1205 //Check if both apps launches since applist update is complete now |
1215 //Check if both apps launches since applist update is complete now |
1206 CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, (TAny*)EAppA); |
1216 CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, EAppA); |
1207 CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, (TAny*)EAppB); |
1217 CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, EAppB); |
1208 |
1218 |
1209 //DeRegister app B and ForceCommitNNAUpdate |
1219 //DeRegister app B and ForceCommitNNAUpdate |
1210 INFO_PRINTF1(_L("..deregistering app 'B' using DeregisterNonNativeApplicationL() ")); |
1220 INFO_PRINTF1(_L("..deregistering app 'B' using DeregisterNonNativeApplicationL() ")); |
1211 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1221 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1212 aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationB)); |
1222 aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationB)); |
1219 aApparcServer.RollbackNonNativeApplicationsUpdates(); |
1229 aApparcServer.RollbackNonNativeApplicationsUpdates(); |
1220 |
1230 |
1221 //Wait for applist to be updated |
1231 //Wait for applist to be updated |
1222 WaitForApplistUpdate(aApparcServer); |
1232 WaitForApplistUpdate(aApparcServer); |
1223 //Since deregistration of app A was rolled back it still launches |
1233 //Since deregistration of app A was rolled back it still launches |
1224 CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, (TAny*)EAppA); |
1234 CheckApplicationLaunchesOkayL(aApparcServer, aNextCommandLine, EAppA); |
1225 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppB); |
1235 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, EAppB); |
1226 |
1236 |
1227 INFO_PRINTF1(_L("..deregistering app 'A' using DeregisterNonNativeApplicationL() ")); |
1237 INFO_PRINTF1(_L("..deregistering app 'A' using DeregisterNonNativeApplicationL() ")); |
1228 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1238 aApparcServer.PrepareNonNativeApplicationsUpdatesL(); |
1229 aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA)); |
1239 aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KApplicationA)); |
1230 aApparcServer.ForceCommitNonNativeApplicationsUpdatesL(); |
1240 aApparcServer.ForceCommitNonNativeApplicationsUpdatesL(); |
1231 |
1241 |
1232 //Wait for applist to be updated |
1242 //Wait for applist to be updated |
1233 WaitForApplistUpdate(aApparcServer); |
1243 WaitForApplistUpdate(aApparcServer); |
1234 //Both apps fail to launch |
1244 //Both apps fail to launch |
1235 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppA); |
1245 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, EAppA); |
1236 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, (TAny*)EAppB); |
1246 CheckApplicationFailsToLaunchL(aApparcServer, aNextCommandLine, EAppB); |
1237 |
1247 |
1238 INFO_PRINTF1(_L("..End Testing TestRollbackDeregistrationL API...")); |
1248 INFO_PRINTF1(_L("..End Testing TestRollbackDeregistrationL API...")); |
1239 } |
1249 } |
1240 |
1250 |
1241 // CTestStep derived functions |
1251 // CTestStep derived functions |