|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // The following test case is used to test whether uiktestserver has the capability |
|
15 // to access writable apis |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalComponent - Internal Symbian test code |
|
22 */ |
|
23 |
|
24 #include "TCapability2.h" |
|
25 #include <e32def.h> |
|
26 #include "eiksrvc.h" |
|
27 #include <e32test.h> |
|
28 #include <test/appfwk_test.h> |
|
29 |
|
30 /** |
|
31 @SYMTestCaseID UIF-UIKON-0002 |
|
32 |
|
33 @SYMPREQ Policing server apis |
|
34 |
|
35 @SYMTestCaseDesc Testing whether uiktestserver has the capability to access writable apis |
|
36 |
|
37 @SYMTestPriority High |
|
38 |
|
39 @SYMTestStatus Implemented |
|
40 |
|
41 @SYMTestActions |
|
42 To connect to REikAppUiSession and to check whether uiktestserver process |
|
43 has the permission to access the mentioned apis |
|
44 API Calls:\n |
|
45 REikAppUiSession::Connect(); |
|
46 REikAppUiSession::OpenFepAttributes(); |
|
47 REikAppUiSession::SetInstalledFepName(const TDesC& aName, TBool aRaiseFileError) const; |
|
48 REikAppUiSession::SetFepAttribute(TUid aAttribUid, const TDesC8& aAttribData) const; |
|
49 REikAppUiSession::CommitFepAttributes() const ; |
|
50 @SYMTestExpectedResults Test should complete without any panic. |
|
51 |
|
52 */ |
|
53 void CTCapability2Step::ExecuteL() |
|
54 { |
|
55 TInt ret; |
|
56 REikAppUiSession uiSession; |
|
57 |
|
58 TEST(uiSession.Connect()==KErrNone); |
|
59 CleanupClosePushL(uiSession); |
|
60 |
|
61 TSecurityInfo info; |
|
62 info.Set(RProcess()); |
|
63 |
|
64 ret=uiSession.SetInstalledFepName(KNullDesC,FALSE); |
|
65 INFO_PRINTF1(_L("Capability check of SetInstalledFepName")); |
|
66 INFO_PRINTF3(_L("Expected return code: %d, Actual return code: %d"), KErrNone, ret); |
|
67 TEST(ret==KErrNone); |
|
68 |
|
69 uiSession.OpenFepAttributes(); |
|
70 |
|
71 ret=uiSession.SetFepAttribute(KNullUid,KNullDesC8); |
|
72 INFO_PRINTF1(_L("Capability check of SetFepAttribute")); |
|
73 INFO_PRINTF3(_L("Expected return code: %d, Actual return code: %d"), KErrNone, ret); |
|
74 TEST(ret==KErrNone); |
|
75 |
|
76 CleanupStack::PopAndDestroy(&uiSession); |
|
77 } |
|
78 |
|
79 CTCapability2Step::CTCapability2Step() |
|
80 /** |
|
81 Constructor |
|
82 */ |
|
83 { |
|
84 // Call base class method to set up the human readable name for logging |
|
85 SetTestStepName(KTCapability2Step); |
|
86 } |
|
87 |
|
88 CTCapability2Step::~CTCapability2Step() |
|
89 { |
|
90 } |
|
91 |
|
92 TVerdict CTCapability2Step::doTestStepL() |
|
93 { |
|
94 INFO_PRINTF1(_L("UIF-UIKON-0002: Capability2 - Started")); |
|
95 |
|
96 __UHEAP_MARK; // mark heap state |
|
97 SetTestStepID(_L("UIF-UIKON-0002")); |
|
98 TRAPD(error,ExecuteL()); // do most stuff under cleanup stack |
|
99 __ASSERT_ALWAYS(!error,User::Panic(_L("TestParse"),error)); |
|
100 RecordTestResultL(); |
|
101 CloseTMSGraphicsStep(); |
|
102 __UHEAP_MARKEND; // check no memory leak |
|
103 |
|
104 INFO_PRINTF1(_L("UIF-UIKON-0002: Capability2 - Finished")); |
|
105 |
|
106 return TestStepResult(); |
|
107 } |