|
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 "scrallfiles.h" |
|
25 |
|
26 #include <usif/scr/scr.h> |
|
27 #include <e32def.h> |
|
28 |
|
29 _LIT(KScrAllFilesSecName, "SCR AllFiles APIs test"); |
|
30 |
|
31 using namespace Usif; |
|
32 |
|
33 CScrAllFilesSecTest* CScrAllFilesSecTest::NewL() |
|
34 { |
|
35 CScrAllFilesSecTest* self=new(ELeave) CScrAllFilesSecTest(); |
|
36 CleanupStack::PushL(self); |
|
37 self->ConstructL(); |
|
38 CleanupStack::Pop(self); |
|
39 return self; |
|
40 } |
|
41 |
|
42 CScrAllFilesSecTest::CScrAllFilesSecTest() |
|
43 { |
|
44 SetCapabilityRequired(ECapabilityAllFiles); |
|
45 } |
|
46 |
|
47 void CScrAllFilesSecTest::ConstructL() |
|
48 { |
|
49 SetNameL(KScrAllFilesSecName); |
|
50 } |
|
51 |
|
52 void CScrAllFilesSecTest::RunTestL() |
|
53 { |
|
54 RSoftwareComponentRegistry scrSession; |
|
55 User::LeaveIfError(scrSession.Connect()); |
|
56 CleanupClosePushL(scrSession); |
|
57 |
|
58 TInt err(0); |
|
59 |
|
60 TRAP(err, scrSession.SetIsComponentRemovableL(1, ETrue)); |
|
61 CheckFailL(err, _L("SetIsComponentRemovableL - set as removable")); |
|
62 |
|
63 TRAP(err, scrSession.SetIsComponentRemovableL(1, EFalse)); |
|
64 CheckFailL(err, _L("SetIsComponentRemovableL - set as non-removable")); |
|
65 |
|
66 CleanupStack::PopAndDestroy(&scrSession); |
|
67 } |