279
|
1 |
// Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
|
0
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of the License "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 |
//
|
|
15 |
|
|
16 |
#ifndef __DOMAIN_POLICY_TEST_H__
|
|
17 |
#define __DOMAIN_POLICY_TEST_H__
|
|
18 |
|
279
|
19 |
#include <domainpolicy.h>
|
0
|
20 |
|
279
|
21 |
// Policy Domain Timeout
|
|
22 |
const TInt KDomainTimeout = 2000000; /* 2000ms */
|
|
23 |
|
|
24 |
// The original test domain hierarchy id
|
0
|
25 |
static const TDmHierarchyId KDmHierarchyIdTest = 99;
|
|
26 |
|
279
|
27 |
// The test domain hierarchy Id for V2 policy with V2 features enabled
|
|
28 |
static const TDmHierarchyId KDmHierarchyIdTestV2 = 98;
|
|
29 |
|
|
30 |
// The original test domain hierarchy id but as a V2 policy with V1 functionality
|
|
31 |
static const TDmHierarchyId KDmHierarchyIdTestV2_97 = 97;
|
|
32 |
|
|
33 |
// The original test domain hierarchy id but as a V2 policy with V1 functionality, null state spec
|
|
34 |
static const TDmHierarchyId KDmHierarchyIdTestV2_96 = 96;
|
|
35 |
|
|
36 |
// The test domain hierarchy Id for V2 policy with V2 features enabled but botched
|
|
37 |
static const TDmHierarchyId KDmHierarchyIdTestV2_95 = 95;
|
|
38 |
|
|
39 |
// The test domain hierarchy Id for V2 policy with V2 features enabled but botched
|
|
40 |
static const TDmHierarchyId KDmHierarchyIdTestV2_94 = 94;
|
|
41 |
|
|
42 |
|
0
|
43 |
/*
|
279
|
44 |
Domains defined in this hierarchy.
|
0
|
45 |
The hierarchy desribed here looks like this:
|
|
46 |
Root
|
|
47 |
A B C
|
|
48 |
AA AB BA CA
|
|
49 |
ABA ABB CAA
|
279
|
50 |
|
|
51 |
This hierarchy is used in V1 and V2 policies.
|
0
|
52 |
*/
|
|
53 |
static const TDmDomainId KDmIdTestA = 0x02;
|
|
54 |
static const TDmDomainId KDmIdTestB = 0x03;
|
|
55 |
static const TDmDomainId KDmIdTestC = 0x04;
|
|
56 |
|
|
57 |
static const TDmDomainId KDmIdTestAA = 0x05;
|
|
58 |
static const TDmDomainId KDmIdTestAB = 0x06;
|
|
59 |
static const TDmDomainId KDmIdTestBA = 0x07;
|
|
60 |
static const TDmDomainId KDmIdTestCA = 0x08;
|
|
61 |
|
|
62 |
static const TDmDomainId KDmIdTestABA = 0x09;
|
|
63 |
static const TDmDomainId KDmIdTestABB = 0x0A;
|
|
64 |
static const TDmDomainId KDmIdTestCAA = 0x0B;
|
279
|
65 |
|
0
|
66 |
static const TInt KTestDomains = 0x0B; // number of domains including root
|
|
67 |
|
|
68 |
|
|
69 |
/*
|
279
|
70 |
Simulated system-wide states for test purposes.
|
0
|
71 |
|
279
|
72 |
The typical state transitions expected in this model:
|
|
73 |
EStartupCriticalStatic -> EStartupCriticalDynamic
|
|
74 |
EStartupCriticalDynamic -> EStartupNonCritical
|
|
75 |
EStartupNonCritical -> ENormalRunning
|
|
76 |
ENormalRunning -> EBackupMode
|
|
77 |
EBackupMode -> ENormalRunning
|
|
78 |
ENormalRunning -> EShutdownCritical
|
|
79 |
EShutdownCritical -> EShutdownNonCritical
|
|
80 |
|
|
81 |
However, that does not stop tests from transition from/to any state as required
|
|
82 |
for test cases. Further states can be added through numbering e.g. EBackupMode1
|
|
83 |
if required.
|
0
|
84 |
*/
|
279
|
85 |
enum TSystemState
|
0
|
86 |
{
|
279
|
87 |
/** Device starting up initialising ROM based components/resources */
|
0
|
88 |
EStartupCriticalStatic,
|
|
89 |
|
279
|
90 |
/** Device continuing start up initisliaing non-ROM based components/resoruces */
|
0
|
91 |
EStartupCriticalDynamic,
|
|
92 |
|
279
|
93 |
/** Device continues start up initialising non-critical components/resoruces */
|
0
|
94 |
EStartupNonCritical,
|
279
|
95 |
|
|
96 |
/** Device running normally */
|
|
97 |
ENormalRunning,
|
|
98 |
|
|
99 |
/** Device about to start system wide backup operation */
|
|
100 |
EBackupMode,
|
0
|
101 |
|
279
|
102 |
/** Device about to start system wide restore operation */
|
|
103 |
ERestoreMode,
|
|
104 |
|
|
105 |
/** Device starting shutdown perform critical shutdown actions */
|
|
106 |
EShutdownCritical,
|
|
107 |
|
|
108 |
/** Device performing non-critical shutdown actions */
|
|
109 |
EShutdownNonCritical,
|
|
110 |
|
|
111 |
|
|
112 |
/** An integer that is strictly greater than any legal system state value */
|
|
113 |
ESystemStateLimit
|
0
|
114 |
};
|
|
115 |
|
279
|
116 |
|
|
117 |
// Externs for test policy data
|
|
118 |
|
|
119 |
extern const TDmDomainSpec DomainHierarchy[];
|
|
120 |
extern const TDmHierarchyPolicy HierarchyPolicy;
|
|
121 |
|
|
122 |
extern const SDmStateSpecV1 StateSpecification[];
|
|
123 |
extern const TUint StateSpecificationSize;
|
|
124 |
extern const TInt StateSpecificationVersion;
|
|
125 |
|
0
|
126 |
#endif
|
|
127 |
|
279
|
128 |
|