1 /* |
1 /* |
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2004-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". |
43 #include "sisregistryobject.h" |
43 #include "sisregistryobject.h" |
44 #include "controllerinfo.h" |
44 #include "controllerinfo.h" |
45 #include "hashcontainer.h" |
45 #include "hashcontainer.h" |
46 #include "sisregistryproperty.h" |
46 #include "sisregistryproperty.h" |
47 |
47 |
|
48 #include <centralrepository.h> |
|
49 |
48 const TInt KDefaultBufferSize = 2048; |
50 const TInt KDefaultBufferSize = 2048; |
49 ///////////////////////////////////////////////////////////////////// |
51 ///////////////////////////////////////////////////////////////////// |
50 // defs, Constants used by test steps |
52 // defs, Constants used by test steps |
51 ///////////////////////////////////////////////////////////////////// |
53 ///////////////////////////////////////////////////////////////////// |
52 |
54 |
53 _LIT(KNoUid, "nouid"); |
55 _LIT(KNoUid, "nouid"); |
54 _LIT(KUid, "uid"); |
56 _LIT(KUid, "uid"); |
|
57 _LIT(KCenRepKey, "cenrepkey"); |
|
58 _LIT(KCenRepValue, "cenrepvalue"); |
55 _LIT(KDrivebitmapcount, "drivebitmapcout"); |
59 _LIT(KDrivebitmapcount, "drivebitmapcout"); |
56 _LIT(KSid, "sid"); |
60 _LIT(KSid, "sid"); |
57 _LIT(KPackage, "package"); |
61 _LIT(KPackage, "package"); |
58 _LIT(KVendor, "vendor"); |
62 _LIT(KVendor, "vendor"); |
59 _LIT(KSisFile, "sis"); |
63 _LIT(KSisFile, "sis"); |
675 CleanupStack::PopAndDestroy(&expectedUids); |
679 CleanupStack::PopAndDestroy(&expectedUids); |
676 |
680 |
677 return TestStepResult(); |
681 return TestStepResult(); |
678 } |
682 } |
679 |
683 |
|
684 ///////////////////////////////////////////////////////////////////// |
|
685 // CSetCenRepSettingStep - Set Central Reposatory Value |
|
686 ///////////////////////////////////////////////////////////////////// |
|
687 CSetCenRepSettingStep::CSetCenRepSettingStep() |
|
688 { |
|
689 SetTestStepName(KSetCenRepSetting); |
|
690 } |
|
691 |
|
692 TVerdict CSetCenRepSettingStep::doTestStepL() |
|
693 { |
|
694 SetTestStepResult(EPass); |
|
695 TUid repUid; |
|
696 if(!GetUidFromConfig(ConfigSection(), KUid, repUid)) |
|
697 { |
|
698 ERR_PRINTF1(_L("Package UID is missing in the configuration file!")); |
|
699 SetTestStepResult(EFail); |
|
700 return TestStepResult(); |
|
701 } |
|
702 |
|
703 TInt cenRepKey; |
|
704 if(!GetIntFromConfig(ConfigSection(), KCenRepKey, cenRepKey)) |
|
705 { |
|
706 ERR_PRINTF1(_L("Central Reposatory Key is missing in the configuration file!")); |
|
707 SetTestStepResult(EFail); |
|
708 return TestStepResult(); |
|
709 } |
|
710 |
|
711 TInt cenRepValue; |
|
712 if(!GetIntFromConfig(ConfigSection(), KCenRepValue, cenRepValue)) |
|
713 { |
|
714 ERR_PRINTF1(_L("Central Reposatory Value is missing in the configuration file!")); |
|
715 SetTestStepResult(EFail); |
|
716 return TestStepResult(); |
|
717 } |
|
718 |
|
719 CRepository* rep = CRepository::NewLC(repUid); |
|
720 TInt err = rep->Set(cenRepKey, cenRepValue); |
|
721 |
|
722 if( err == KErrNone ) |
|
723 { |
|
724 INFO_PRINTF4(_L("Setting Central Reposatory 0x%08x , key = %d, value = %d"),repUid,cenRepKey,cenRepValue); |
|
725 } |
|
726 else |
|
727 { |
|
728 SetTestStepResult(EFail); |
|
729 ERR_PRINTF4(_L("Failed Setting Central Reposatory 0x%08x , key = %d, value = %d"),repUid,cenRepKey,cenRepValue); |
|
730 } |
|
731 |
|
732 CleanupStack::PopAndDestroy(rep); |
|
733 return TestStepResult(); |
|
734 } |
|
735 |
|
736 |
680 ///////////////////////////////////////////////////////////////////// |
737 ///////////////////////////////////////////////////////////////////// |
681 // CIsPackageInstalledStep - checks if packages are registered |
738 // CIsPackageInstalledStep - checks if packages are registered |
682 ///////////////////////////////////////////////////////////////////// |
739 ///////////////////////////////////////////////////////////////////// |
683 |
740 |
684 CIsPackageInstalledStep::CIsPackageInstalledStep() |
741 CIsPackageInstalledStep::CIsPackageInstalledStep() |