|
1 // Copyright (c) 2005-2009 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 /** |
|
17 @file |
|
18 @internalComponent - Internal Symbian test code |
|
19 */ |
|
20 |
|
21 #if (!defined __T_PROC_STEP_H__) |
|
22 #define __T_PROC_STEP_H__ |
|
23 |
|
24 #include <apacmdln.h> |
|
25 #include <apgcli.h> |
|
26 #include "apparctestserver.h" |
|
27 #include <apparc.h> |
|
28 |
|
29 _LIT(KT_ProcStep,"T_Proc"); |
|
30 _LIT(KParentExe, "ParentProcess"); |
|
31 _LIT(KChildOneExe, "ChildI"); |
|
32 _LIT(KChildTwoExe, "ChildII"); |
|
33 _LIT(KChildThreeExe, "ChildIII"); |
|
34 _LIT(KT_ParentProcessID,"ParentProcessID"); |
|
35 _LIT(KFilePath,"c:\\logs\\TestExecute\\Proc.txt"); |
|
36 _LIT8(KTResultPass, "PASS"); |
|
37 _LIT8(KTResultFail, "FAIL"); |
|
38 |
|
39 |
|
40 //! A CT_ProcStep test class. |
|
41 |
|
42 /** Checks for child process existence when its parent terminates. */ |
|
43 |
|
44 class CT_ProcStep : public CTestStep |
|
45 { |
|
46 public: |
|
47 CT_ProcStep(); |
|
48 ~CT_ProcStep(); |
|
49 virtual TVerdict doTestStepL(); |
|
50 private: |
|
51 void testChildExistsL(void); |
|
52 void testChildSetToTerminateL(void); |
|
53 void testChildSetToRemainL(void); |
|
54 void testTwoChildsOneToTerminateAndOtherToRemainL(void); |
|
55 void testParentWithoutAChildL(void); |
|
56 void testAllChildsSetToTerminateL(void); |
|
57 void testNoChildSetToTerminateL(void); |
|
58 void testIdAvailableToChildL(void); |
|
59 void testIdNotAvailableToChildL(void); |
|
60 }; |
|
61 |
|
62 |
|
63 //! A support class for CT_ProcStep test class. |
|
64 |
|
65 /** An active object which monitors the current status of child when its parent terminates. */ |
|
66 |
|
67 class CChildProcess : public CActive |
|
68 { |
|
69 public: |
|
70 static CChildProcess* NewL(RProcess& aParentProcess,TProcessId aChildProcessId); |
|
71 void RunL(); |
|
72 void DoCancel(); |
|
73 ~CChildProcess(); |
|
74 private: |
|
75 void ConstructL(); |
|
76 CChildProcess(RProcess& aParentProcess,TProcessId aChildProcessId); |
|
77 private: |
|
78 TProcessId iChildProcessId; |
|
79 RProcess iParentProcess; |
|
80 RProcess iChildProcess; |
|
81 TExitType iExitType; |
|
82 TInt iCount; |
|
83 }; |
|
84 |
|
85 #endif |