|
1 // Copyright (c) 2007-2010 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 // |
|
15 |
|
16 #ifndef TGRAPHICSRESOURCEMULTIPROCESSTHREAD_H |
|
17 #define TGRAPHICSRESOURCEMULTIPROCESSTHREAD_H |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <sgresource/sgimage.h> |
|
21 |
|
22 class CTTMSGraphicsStep; |
|
23 |
|
24 //define default slot for multiprocess communication |
|
25 const TInt KSecondProcessFunctionSlot = 1; |
|
26 const TInt KSecondProcessParametersSlot = 2; |
|
27 |
|
28 /** |
|
29 * Enums for passing between the test process and the second process used in testing, |
|
30 * used to define which test should be run on the second process. |
|
31 */ |
|
32 enum TSgresTestCase |
|
33 { |
|
34 ESgresUndefinedTest, |
|
35 ESgresSecondProcessOpenImage, |
|
36 ESgresSecondProcessOpenDrawable, |
|
37 ESgresSecondThreadOpenImage, |
|
38 ESgresSecondThreadOpenDrawable, |
|
39 ESgresSecondProcessOpenImageInvalid, |
|
40 ESgresSecondThreadOpenImageInvalid, |
|
41 ESgresSecondThreadOpenDrawableInvalid, |
|
42 ESgresSecondProcessOpenDrawableInvalid, |
|
43 ESgresSecondThreadPanicDrawableOpenNoDriver, |
|
44 ESgresSecondThreadPanicImageOpenNoDriver, |
|
45 ESgresSecondThreadPanicImageGetInterfaceInvalidHandle, |
|
46 ESgresSecondThreadPanicImageGetInterfaceNoDriver, |
|
47 ESgresSecondThreadPanicImageCloseInvalidHandle, |
|
48 ESgresSecondThreadPanicImageCloseNoDriver, |
|
49 ESgresSecondThreadPanicImageIdInvalidHandle, |
|
50 ESgresSecondThreadPanicImageIdNoDriver, |
|
51 ESgresSecondThreadPanicImageDrawableTypeNoDriver, |
|
52 ESgresSecondThreadPanicImageDrawableTypeInvalidHandle, |
|
53 ESgresSecondThreadPanicImageCreateNoDriver1, |
|
54 ESgresSecondThreadPanicImageCreateNoDriver2, |
|
55 ESgresSecondThreadPanicImageCreateInvalidHandle, |
|
56 ESgresSecondThreadPanicImageGetInfoInvalidHandle, |
|
57 ESgresSecondThreadPanicImageGetInfoNoDriver, |
|
58 ESgresMultipleThreadStressTest, |
|
59 ESgresSecondThreadPanicImageGetAttributeInvalidHandle, |
|
60 ESgresSecondThreadPanicImageGetAttributeNoDriver, |
|
61 ESgresSecondThreadPanicAttributeArrayInvalidIndex, |
|
62 ESgresSecondThreadPanicAttributeArrayInvalidIndex2, |
|
63 ESgresSecondProcessPanicDriverCloseOpenResources, |
|
64 ESgresSecondThreadOpenPassedDriver, |
|
65 ESgresSecondThreadClosePassedDriver, |
|
66 ESgresSecondThreadCreatePassedImage, |
|
67 ESgresSecondThreadOpenPassedImage, |
|
68 ESgresSecondThreadClosePassedImage, |
|
69 ESgresSecondProcessOpenImageMultithreaded, |
|
70 }; |
|
71 |
|
72 /** |
|
73 * Enums for the test results. Used in multi-thread or multi-process tests. |
|
74 * Each test function call may contain several sub-tests. Each EXXXTestPassed |
|
75 * will be bitwised ored to the test result as each sub-test passes. |
|
76 */ |
|
77 enum TSgresTestResult |
|
78 { |
|
79 EFirstTestPassed = 0x00000001, |
|
80 ESecondTestPassed = 0x00000002, |
|
81 EThirdTestPassed = 0x00000004, |
|
82 EFourthTestPassed = 0x00000008, |
|
83 EFifthTestPassed = 0x00000010, |
|
84 ESixthTestPassed = 0x00000020, |
|
85 ESeventhTestPassed = 0x00000040, |
|
86 EEighthTestPassed = 0x00000080, |
|
87 ENinthTestPassed = 0x00000100, |
|
88 ETenthTestPassed = 0x00000200, |
|
89 EEleventhTestPassed = 0x00000400, |
|
90 ETwelvethTestPassed = 0x00000800, |
|
91 EThirteenthTestPassed = 0x00001000, |
|
92 EFourteenthTestPassed = 0x00002000, |
|
93 EFifteenthTestPassed = 0x00004000, |
|
94 }; |
|
95 |
|
96 |
|
97 /** |
|
98 Utility class for passing test info between processes. |
|
99 */ |
|
100 class TSgProcessTestInfo |
|
101 { |
|
102 public: |
|
103 TSgProcessTestInfo() : |
|
104 iDrawableId(KSgNullDrawableId), iImageInfo(), iTestCase(ESgresUndefinedTest) |
|
105 {} |
|
106 TSgProcessTestInfo(TSgDrawableId aId, const TSgImageInfo& aImageInfo, TSgresTestCase aTestCase) : |
|
107 iDrawableId(aId), iImageInfo(aImageInfo), iTestCase(aTestCase) |
|
108 {} |
|
109 TSgDrawableId iDrawableId; |
|
110 TSgImageInfo iImageInfo; |
|
111 TSgresTestCase iTestCase; |
|
112 }; |
|
113 |
|
114 /** |
|
115 Utility class for passing test info between threads. |
|
116 */ |
|
117 class TSgThreadTestInfo |
|
118 { |
|
119 public: |
|
120 TSgThreadTestInfo() : |
|
121 iDrawableId(KSgNullDrawableId), iImageInfo(), iTestCase(ESgresUndefinedTest), |
|
122 iSgDriver(NULL), iSgImage(NULL), iTestStep(NULL) |
|
123 {} |
|
124 TSgThreadTestInfo(TSgDrawableId aId, const TSgImageInfo& aImageInfo, TSgresTestCase aTestCase) : |
|
125 iDrawableId(aId), iImageInfo(aImageInfo), iTestCase(aTestCase), |
|
126 iSgDriver(NULL), iSgImage(NULL), iTestStep(NULL) |
|
127 {} |
|
128 TSgDrawableId iDrawableId; |
|
129 TSgImageInfo iImageInfo; |
|
130 TSgresTestCase iTestCase; |
|
131 RSgDriver* iSgDriver; |
|
132 RSgImage* iSgImage; |
|
133 CTTMSGraphicsStep* iTestStep; |
|
134 }; |
|
135 |
|
136 // Message queue name for inter-process communication |
|
137 _LIT(KSgTestMultiprocessMsgQ, "TestGraphicsResourceMultiprocessMsgQ"); |
|
138 |
|
139 #endif |