1 /* |
|
2 * Copyright (c) 2002-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 |
|
21 /** |
|
22 @file |
|
23 */ |
|
24 #ifndef __APRCAPTESTFRAMEWORK_STEP_H__ |
|
25 #define __APRCAPTESTFRAMEWORK_STEP_H__ |
|
26 |
|
27 #include <test/testexecutestepbase.h> |
|
28 #include "captestframeworkserver.h" |
|
29 |
|
30 #include <captestframework/aprcaptestframework.h> |
|
31 |
|
32 |
|
33 struct TTestEnvironment |
|
34 { |
|
35 TTestEnvironment(const TCapabilitySet& aCaps, TUid aSid, TUid aVid, TBool aExpectPass); |
|
36 |
|
37 TCapabilitySet iCaps; |
|
38 TUid iSid; |
|
39 TUid iVid; |
|
40 TBool iExpectPass; |
|
41 }; |
|
42 |
|
43 |
|
44 class CCapTestFrameworkStep : public CTestStep |
|
45 { |
|
46 public: |
|
47 enum TThoroughness |
|
48 { |
|
49 EBasicChecks, // Just test using no capabilities, and capabilities required |
|
50 EThoroughChecks, // Test every subset required |
|
51 }; |
|
52 |
|
53 public: |
|
54 CCapTestFrameworkStep(TThoroughness aThoroughness = EBasicChecks); |
|
55 ~CCapTestFrameworkStep(); |
|
56 |
|
57 TVerdict doTestStepPreambleL(); |
|
58 TVerdict doTestStepPostambleL(); |
|
59 TVerdict doTestStepL(); |
|
60 |
|
61 private: |
|
62 void RunTestDllL(const TDesC& aDllName); |
|
63 MCapabilityTestFactory* SetupFactoryL(); |
|
64 |
|
65 void PrintCapabilitySet(const TCapabilitySet& aCapSet, const TDesC& aExtra=KNullDesC); |
|
66 |
|
67 void RunTestStepL(MCapabilityTest* aTest); |
|
68 |
|
69 void GenerateEnvironmentsL(const TCapabilitySet& aCapsNeeded, const TUid& aSidNeeded, const TUid& aVidNeeded, RArray<TTestEnvironment>& aEnvironments); |
|
70 |
|
71 TCapabilitySet InvertCapSet(const TCapabilitySet& aCapSet); |
|
72 |
|
73 |
|
74 // Sets the helper up with capabilities |
|
75 void SetupHelperL(const TTestEnvironment& aEnvironment); |
|
76 |
|
77 // Runs helper |
|
78 void RunHelperL(TInt aTestNumber, TBool aShouldPass); |
|
79 |
|
80 private: |
|
81 RFs iFs; |
|
82 TThoroughness iThoroughness; |
|
83 TInt iCurrentTest; |
|
84 MCapabilityTestFactory* iFactory; |
|
85 RLibrary iLibrary; |
|
86 TPtrC iDllName; |
|
87 TBool iOmitTCBCapInComplementSet; // This functionality is needed for testing components that don't have the TCB capability, for example the SIF API. |
|
88 }; |
|
89 |
|
90 _LIT(KRunBasicCapabilityChecks,"RunBasicCapabilityChecks"); |
|
91 _LIT(KRunThoroughCapabilityChecks,"RunThoroughCapabilityChecks"); |
|
92 |
|
93 #endif /* #ifndef __APRCAPTESTFRAMEWORK_STEP_H__ */ |
|