|
1 // Copyright (c) 2007-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 @test |
|
19 @internalComponent - Internal Symbian test code |
|
20 */ |
|
21 |
|
22 #ifndef __TESTPROCGOODSESSION_H |
|
23 #define __TESTPROCGOODSESSION_H |
|
24 |
|
25 #include <e32std.h> |
|
26 #include <startup.hrh> |
|
27 #include "testapps.h" |
|
28 |
|
29 const TInt KProcPanic = -1234; //Random panic reason code |
|
30 /** If KTestProcGood is launched with this command line parameter, it will start a CServer2 */ |
|
31 _LIT(KLaunchServerCommandLineOption, "-server"); |
|
32 |
|
33 /** If KTestProcGood is launched with this command line parameter, it will not rendevouz */ |
|
34 _LIT(KTestProcGoodNoRendevouz, "-norv"); |
|
35 |
|
36 /** If KTestProcGood is launched with this command line parameter, it will exit with reason |
|
37 KErrAbort immediately after rendevouz */ |
|
38 _LIT(KFailAfterRendevouzCommandLineOption, "-failafterrv"); |
|
39 |
|
40 /** If KTestProcGood is launched with this command line parameter, it will panic with reason |
|
41 KProcPanic panic code*/ |
|
42 _LIT(KPanicCommandLineOption1, "-paniccode"); |
|
43 |
|
44 /** If KTestProcGood is launched with this command line parameter, it will panic with reason |
|
45 0*/ |
|
46 _LIT(KPanicCommandLineOption2, "-paniczero"); |
|
47 |
|
48 _LIT(KPanicFile, "c:\\panicfile.txt"); |
|
49 |
|
50 enum TMessages |
|
51 { |
|
52 EMonitorSelfWithStartupProp, |
|
53 EMonitorSelfWithSsmStartupProp, |
|
54 ECancelMonitor, |
|
55 EShutDown |
|
56 }; |
|
57 |
|
58 class RTestProcGoodSession : public RSessionBase |
|
59 { |
|
60 public: |
|
61 //from RSessionBase |
|
62 inline TInt Connect() |
|
63 { |
|
64 return RSessionBase::CreateSession(KTestProcGood, TVersion(0,0,0)); |
|
65 } |
|
66 inline TInt MonitorSelfWithStartupProp(TRecoveryMethod aRecoveryMethod) |
|
67 { |
|
68 return SendReceive(EMonitorSelfWithStartupProp, TIpcArgs((TInt)aRecoveryMethod)); |
|
69 } //lint !e1762 |
|
70 inline TInt MonitorSelfWithSsmStartupProp(TRecoveryMethod aRecoveryMethod) |
|
71 { |
|
72 return SendReceive(EMonitorSelfWithSsmStartupProp, TIpcArgs((TInt)aRecoveryMethod)); |
|
73 } //lint !e1762 |
|
74 inline TInt CancelMonitor() |
|
75 { |
|
76 return SendReceive(ECancelMonitor, TIpcArgs(TIpcArgs::ENothing)); |
|
77 } //lint !e1762 |
|
78 inline TInt ShutDown() |
|
79 { |
|
80 return SendReceive(EShutDown, TIpcArgs(TIpcArgs::ENothing)); |
|
81 } //lint !e1762 |
|
82 }; |
|
83 |
|
84 #endif // __TESTPROCGOODSESSION_H |