1 /* |
|
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 /** |
|
20 @file |
|
21 @test |
|
22 */ |
|
23 |
|
24 #include "sifsecuritycontext.h" |
|
25 #include <usif/sif/sif.h> |
|
26 #include <e32def.h> |
|
27 |
|
28 _LIT(KSifSecurityContextName, "SIF TSecurityContext APIs test"); |
|
29 |
|
30 using namespace Usif; |
|
31 |
|
32 // This test calls only the GetComponentInfo() API because the logic of passing TSecurityContext to |
|
33 // a SIF plug-in is exactly the same for all the SIF operations. |
|
34 namespace |
|
35 { |
|
36 _LIT(KFileName, "z:\\tusif\\tsif\\data\\test.nonnativepackage.txt"); |
|
37 _LIT_SECURE_ID(KTestSuiteSecureId, 0x10285BCC); |
|
38 |
|
39 void DoTestL() |
|
40 { |
|
41 RSoftwareInstall sif; |
|
42 User::LeaveIfError(sif.Connect()); |
|
43 CleanupClosePushL(sif); |
|
44 |
|
45 CComponentInfo* compInfo = CComponentInfo::NewLC(); |
|
46 |
|
47 TRequestStatus status; |
|
48 sif.GetComponentInfo(KFileName, *compInfo, status); |
|
49 User::WaitForRequest(status); |
|
50 |
|
51 CleanupStack::PopAndDestroy(2, &sif); |
|
52 User::LeaveIfError(status.Int()); |
|
53 } |
|
54 } |
|
55 |
|
56 CSifSecurityContextTest* CSifSecurityContextTest::NewL() |
|
57 { |
|
58 CSifSecurityContextTest* self=new(ELeave) CSifSecurityContextTest(); |
|
59 CleanupStack::PushL(self); |
|
60 self->ConstructL(); |
|
61 CleanupStack::Pop(self); |
|
62 return self; |
|
63 } |
|
64 |
|
65 CSifSecurityContextTest::CSifSecurityContextTest() |
|
66 { |
|
67 SetCapabilityRequired(ECapabilityReadUserData); |
|
68 SetSidRequired(KTestSuiteSecureId); |
|
69 } |
|
70 |
|
71 void CSifSecurityContextTest::ConstructL() |
|
72 { |
|
73 SetNameL(KSifSecurityContextName); |
|
74 } |
|
75 |
|
76 void CSifSecurityContextTest::RunTestL() |
|
77 { |
|
78 TRAPD(err, DoTestL()); |
|
79 CheckFailL(err, _L("CSifSecurityContextTest::DoTestL()")); |
|
80 } |
|