1 /* |
1 /* |
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 * under the terms of the License "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
51 _LIT(KPrivateRegistryCapTestName, "Registry private interface capability test"); |
51 _LIT(KPrivateRegistryCapTestName, "Registry private interface capability test"); |
52 _LIT(KDaemonRegistryCapTestName, "Registry daemon interface capability test"); |
52 _LIT(KDaemonRegistryCapTestName, "Registry daemon interface capability test"); |
53 _LIT(KRevocationRegistryCapTestName, "Registry revocation interface capability test"); |
53 _LIT(KRevocationRegistryCapTestName, "Registry revocation interface capability test"); |
54 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
54 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
55 _LIT(KSifServerRegistryCapTestName, "Registry SIF interface security test"); |
55 _LIT(KSifServerRegistryCapTestName, "Registry SIF interface security test"); |
|
56 _LIT(KSisRegistryTCBCapTestName, "Sis Registry interface requiring TCB security test"); |
56 #endif |
57 #endif |
57 |
58 |
58 CPublicRegistryCapTest* CPublicRegistryCapTest::NewL() |
59 CPublicRegistryCapTest* CPublicRegistryCapTest::NewL() |
59 { |
60 { |
60 CPublicRegistryCapTest* self=new(ELeave) CPublicRegistryCapTest(); |
61 CPublicRegistryCapTest* self=new(ELeave) CPublicRegistryCapTest(); |
409 |
410 |
410 TRAP(err, session.UpdateEntryL(*app, *buffer, id)); |
411 TRAP(err, session.UpdateEntryL(*app, *buffer, id)); |
411 CheckFailL(err, _L("UpdateEntryL")); |
412 CheckFailL(err, _L("UpdateEntryL")); |
412 |
413 |
413 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
414 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
414 RCPointerArray<CSoftwareTypeRegInfo> regInfoArray; |
415 RCPointerArray<Usif::CSoftwareTypeRegInfo> regInfoArray; |
415 CleanupClosePushL(regInfoArray); |
416 CleanupClosePushL(regInfoArray); |
416 |
417 |
417 TRAP(err, session.AddEntryL(*app, *buffer, regInfoArray, id)); |
418 TRAP(err, session.AddEntryL(*app, *buffer, regInfoArray, id)); |
418 CheckFailL(err, _L("AddEntryL for LEEs")); |
419 CheckFailL(err, _L("AddEntryL for LEEs")); |
419 |
420 |
490 CheckFailL(err, _L("RemoveDriveL")); |
491 CheckFailL(err, _L("RemoveDriveL")); |
491 #endif |
492 #endif |
492 |
493 |
493 TRAP(err, session.RecoverL()); |
494 TRAP(err, session.RecoverL()); |
494 CheckFailL(err, _L("RecoverL")); |
495 CheckFailL(err, _L("RecoverL")); |
|
496 |
|
497 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
498 TRAP(err, session.SetComponentPresenceL(1, EFalse)); |
|
499 CheckFailL(err, _L("SetComponentPresenceL")); |
|
500 |
|
501 // Negative tests |
|
502 //TRAP(err, session.SetComponentPresenceL(1234, EFalse)); |
|
503 //CheckFailL(err, _L("SetComponentPresenceL Negative 1")); |
|
504 //TRAP(err, session.SetComponentPresenceL(0, EFalse)); |
|
505 //CheckFailL(err, _L("SetComponentPresenceL Negative 2")); |
|
506 //TRAP(err, session.SetComponentPresenceL(-1, EFalse)); |
|
507 //CheckFailL(err, _L("SetComponentPresenceL Negative 3")); |
|
508 #endif |
495 |
509 |
496 CleanupStack::PopAndDestroy(&session); |
510 CleanupStack::PopAndDestroy(&session); |
497 } |
511 } |
498 |
512 |
499 |
513 |
592 TRAP(err, session.DeactivateComponentL(componentId)); |
606 TRAP(err, session.DeactivateComponentL(componentId)); |
593 CheckFailL(err, _L("DeactivateComponentL")); |
607 CheckFailL(err, _L("DeactivateComponentL")); |
594 |
608 |
595 CleanupStack::PopAndDestroy(&session); |
609 CleanupStack::PopAndDestroy(&session); |
596 } |
610 } |
597 #endif |
611 |
598 |
612 CSisRegistryTCBCapTest* CSisRegistryTCBCapTest::NewL() |
599 |
613 { |
|
614 CSisRegistryTCBCapTest* self=new(ELeave) CSisRegistryTCBCapTest(); |
|
615 CleanupStack::PushL(self); |
|
616 self->ConstructL(); |
|
617 CleanupStack::Pop(self); |
|
618 return self; |
|
619 } |
|
620 |
|
621 CSisRegistryTCBCapTest::CSisRegistryTCBCapTest() |
|
622 { |
|
623 SetCapabilityRequired(ECapabilityTCB); //API requires TCB capability, so giving it |
|
624 } |
|
625 |
|
626 void CSisRegistryTCBCapTest::ConstructL() |
|
627 { |
|
628 SetNameL(KSisRegistryTCBCapTestName); |
|
629 } |
|
630 |
|
631 void CSisRegistryTCBCapTest::RunTestL() |
|
632 { |
|
633 Swi::RSisRegistrySession registrySession; |
|
634 CleanupClosePushL(registrySession); |
|
635 _LIT(regFileName,"c:\\private\\10003a3f\\import\\apps\\dummy_reg.rsc"); |
|
636 TInt err = registrySession.Connect(); |
|
637 if (KErrNone != err) |
|
638 { |
|
639 SetFail(); |
|
640 CleanupStack::PopAndDestroy(®istrySession); |
|
641 return; |
|
642 } |
|
643 |
|
644 TRAP(err, registrySession.AddAppRegInfoL(regFileName)); |
|
645 CheckFailL(err, _L("AddAppRegInfoL")); |
|
646 |
|
647 TRAP(err, registrySession.RemoveAppRegInfoL(regFileName)); |
|
648 CheckFailL(err, _L("RemoveAppRegInfoL")); |
|
649 |
|
650 CleanupStack::PopAndDestroy(®istrySession); |
|
651 } |
|
652 #endif |
|
653 |
|
654 |