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