sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
|
sl@0
|
20 |
|
sl@0
|
21 |
/**
|
sl@0
|
22 |
@file
|
sl@0
|
23 |
*/
|
sl@0
|
24 |
#ifndef __CAPTESTFRAMEWORK_STEP_H__
|
sl@0
|
25 |
#define __CAPTESTFRAMEWORK_STEP_H__
|
sl@0
|
26 |
|
sl@0
|
27 |
#include <test/testexecutestepbase.h>
|
sl@0
|
28 |
#include "captestframeworkserver.h"
|
sl@0
|
29 |
|
sl@0
|
30 |
#include "captestframework.h"
|
sl@0
|
31 |
|
sl@0
|
32 |
|
sl@0
|
33 |
struct TTestEnvironment
|
sl@0
|
34 |
{
|
sl@0
|
35 |
TTestEnvironment(const TCapabilitySet& aCaps, TUid aSid, TUid aVid, TBool aExpectPass);
|
sl@0
|
36 |
|
sl@0
|
37 |
TCapabilitySet iCaps;
|
sl@0
|
38 |
TUid iSid;
|
sl@0
|
39 |
TUid iVid;
|
sl@0
|
40 |
TBool iExpectPass;
|
sl@0
|
41 |
};
|
sl@0
|
42 |
|
sl@0
|
43 |
|
sl@0
|
44 |
class CCapTestFrameworkStep : public CTestStep
|
sl@0
|
45 |
{
|
sl@0
|
46 |
public:
|
sl@0
|
47 |
enum TThoroughness
|
sl@0
|
48 |
{
|
sl@0
|
49 |
EBasicChecks, // Just test using no capabilities, and capabilities required
|
sl@0
|
50 |
EThoroughChecks, // Test every subset required
|
sl@0
|
51 |
};
|
sl@0
|
52 |
|
sl@0
|
53 |
public:
|
sl@0
|
54 |
CCapTestFrameworkStep(TThoroughness aThoroughness = EBasicChecks);
|
sl@0
|
55 |
~CCapTestFrameworkStep();
|
sl@0
|
56 |
|
sl@0
|
57 |
TVerdict doTestStepPreambleL();
|
sl@0
|
58 |
TVerdict doTestStepPostambleL();
|
sl@0
|
59 |
TVerdict doTestStepL();
|
sl@0
|
60 |
|
sl@0
|
61 |
private:
|
sl@0
|
62 |
void RunTestDllL(const TDesC& aDllName);
|
sl@0
|
63 |
MCapabilityTestFactory* SetupFactoryL();
|
sl@0
|
64 |
|
sl@0
|
65 |
void PrintCapabilitySet(const TCapabilitySet& aCapSet, const TDesC& aExtra=KNullDesC);
|
sl@0
|
66 |
|
sl@0
|
67 |
void RunTestStepL(MCapabilityTest* aTest);
|
sl@0
|
68 |
|
sl@0
|
69 |
void GenerateEnvironmentsL(const TCapabilitySet& aCapsNeeded, const TUid& aSidNeeded, const TUid& aVidNeeded, RArray<TTestEnvironment>& aEnvironments);
|
sl@0
|
70 |
|
sl@0
|
71 |
TCapabilitySet InvertCapSet(const TCapabilitySet& aCapSet);
|
sl@0
|
72 |
|
sl@0
|
73 |
|
sl@0
|
74 |
// Sets the helper up with capabilities
|
sl@0
|
75 |
void SetupHelperL(const TTestEnvironment& aEnvironment);
|
sl@0
|
76 |
|
sl@0
|
77 |
// Runs helper
|
sl@0
|
78 |
void RunHelperL(TInt aTestNumber, TBool aShouldPass);
|
sl@0
|
79 |
|
sl@0
|
80 |
private:
|
sl@0
|
81 |
RFs iFs;
|
sl@0
|
82 |
TThoroughness iThoroughness;
|
sl@0
|
83 |
TInt iCurrentTest;
|
sl@0
|
84 |
MCapabilityTestFactory* iFactory;
|
sl@0
|
85 |
RLibrary iLibrary;
|
sl@0
|
86 |
TPtrC iDllName;
|
sl@0
|
87 |
TBool iOmitTCBCapInComplementSet; // This functionality is needed for testing components that don't have the TCB capability, for example the SIF API.
|
sl@0
|
88 |
};
|
sl@0
|
89 |
|
sl@0
|
90 |
_LIT(KRunBasicCapabilityChecks,"RunBasicCapabilityChecks");
|
sl@0
|
91 |
_LIT(KRunThoroughCapabilityChecks,"RunThoroughCapabilityChecks");
|
sl@0
|
92 |
|
sl@0
|
93 |
#endif /* #ifndef __CAPTESTFRAMEWORK_STEP_H__ */
|