kerneltest/e32test/domainmgr/domainpolicytest.h
changeset 279 957c583b417b
parent 245 647ab20fee2e
equal deleted inserted replaced
275:2b433474f2ba 279:957c583b417b
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    14 //
    14 //
    15 
    15 
    16 #ifndef __DOMAIN_POLICY_TEST_H__
    16 #ifndef __DOMAIN_POLICY_TEST_H__
    17 #define __DOMAIN_POLICY_TEST_H__
    17 #define __DOMAIN_POLICY_TEST_H__
    18 
    18 
    19 // The test domain hierarchy id 
    19 #include <domainpolicy.h>
    20 
    20 
       
    21 // Policy Domain Timeout
       
    22 const TInt KDomainTimeout = 2000000; /* 2000ms */
       
    23 
       
    24 // The original test domain hierarchy id
    21 static const TDmHierarchyId	KDmHierarchyIdTest = 99;
    25 static const TDmHierarchyId	KDmHierarchyIdTest = 99;
    22 
    26 
       
    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 
    23 /*
    43 /*
    24 Domains defined in this hiearchy
    44 Domains defined in this hierarchy.
    25 The hierarchy desribed here looks like this:
    45 The hierarchy desribed here looks like this:
    26 		Root
    46 		Root
    27 		A				B				C
    47 		A				B				C
    28 		AA	AB			BA				CA
    48 		AA	AB			BA				CA
    29 			ABA	ABB						CAA
    49 			ABA	ABB						CAA
    30 
    50 			
       
    51 This hierarchy is used in V1 and V2 policies. 
    31 */
    52 */
    32 static const TDmDomainId	KDmIdTestA		= 0x02;
    53 static const TDmDomainId	KDmIdTestA		= 0x02;
    33 static const TDmDomainId	KDmIdTestB		= 0x03;
    54 static const TDmDomainId	KDmIdTestB		= 0x03;
    34 static const TDmDomainId	KDmIdTestC		= 0x04;
    55 static const TDmDomainId	KDmIdTestC		= 0x04;
    35 
    56 
    39 static const TDmDomainId	KDmIdTestCA		= 0x08;
    60 static const TDmDomainId	KDmIdTestCA		= 0x08;
    40 
    61 
    41 static const TDmDomainId	KDmIdTestABA	= 0x09;
    62 static const TDmDomainId	KDmIdTestABA	= 0x09;
    42 static const TDmDomainId	KDmIdTestABB	= 0x0A;
    63 static const TDmDomainId	KDmIdTestABB	= 0x0A;
    43 static const TDmDomainId	KDmIdTestCAA	= 0x0B;
    64 static const TDmDomainId	KDmIdTestCAA	= 0x0B;
       
    65 
    44 static const TInt KTestDomains = 0x0B;	// number of domains including root
    66 static const TInt KTestDomains = 0x0B;	// number of domains including root
    45 
    67 
    46 
    68 
    47 /*
    69 /*
    48 System-wide start-up states
    70 Simulated system-wide states for test purposes.
    49 
    71 
    50 Some of these states may be ommitted depending on the start-up mode.
    72 The typical state transitions expected in this model:
    51 E.g. The system-starter might choose to omit EStartupNonCritical in "safe" mode
    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.
    52 */
    84 */
    53 enum TStartupState
    85 enum TSystemState
    54 	{
    86 	{
    55 	/** In this state, all ROM based (static) components or resources that 
    87 	/** Device starting up initialising ROM based components/resources */
    56 	are critical to the operation of the phone are started */
       
    57 	EStartupCriticalStatic,
    88 	EStartupCriticalStatic,
    58 
    89 
    59 	/** In this state, all non-ROM based (dynamic) components or resources that 
    90 	/** Device continuing start up initisliaing non-ROM based components/resoruces */
    60 	are critical to the operation of the phone are started */
       
    61 	EStartupCriticalDynamic,
    91 	EStartupCriticalDynamic,
    62 
    92 
    63 	/** In this state, all ROM based (static) or non-ROM based (dynamic) 
    93 	/** Device continues start up initialising non-critical components/resoruces */
    64 	components or resources that are not critical to the operation of the phone 
       
    65 	are started */
       
    66 	EStartupNonCritical,
    94 	EStartupNonCritical,
       
    95 	
       
    96 	/** Device running normally */
       
    97 	ENormalRunning,
       
    98 		
       
    99 	/** Device about to start system wide backup operation */
       
   100 	EBackupMode,
    67 
   101 
    68 	/** An integer that is strictly greater thean any legal start-up state value */
   102 	/** Device about to start system wide restore operation */
    69 	EStartupLimit
   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
    70 	};
   114 	};
       
   115 
       
   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;
    71 
   125 
    72 #endif
   126 #endif
    73 
   127 
       
   128