|
1 /* |
|
2 * Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Test case class, user will create own test case class by |
|
15 * deriving from the class. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef C_CBCTESTAPPLICATION_H |
|
21 #define C_CBCTESTAPPLICATION_H |
|
22 |
|
23 #include <e32std.h> |
|
24 #include <e32base.h> |
|
25 |
|
26 #include "bctestlauncherdefs.h" |
|
27 |
|
28 class CEikonEnv; |
|
29 |
|
30 /** |
|
31 * Test Application, represent all bc test applications. |
|
32 */ |
|
33 class CBCTestApplication : public CBase |
|
34 { |
|
35 public: // constructor |
|
36 static CBCTestApplication* NewL( const TDesC& aName, |
|
37 TInt aAppUID, TInt aViewUID, |
|
38 TInt aTimeout = 1, TInt aVersion = 30 ); |
|
39 |
|
40 /** |
|
41 * C++ default constructor |
|
42 * @param aTimeout, in min |
|
43 */ |
|
44 CBCTestApplication( const TDesC& aName, TInt aAppUID, TInt aViewUID = 1, |
|
45 TInt aTimeout = 1, TInt aVersion = 30 ); |
|
46 |
|
47 /** |
|
48 * Destructor |
|
49 */ |
|
50 virtual ~CBCTestApplication(); |
|
51 |
|
52 // new funcs |
|
53 |
|
54 void RunL( TInt aCommand ); |
|
55 const TDesC& Name(){ return iName; } |
|
56 |
|
57 /** |
|
58 * select the application to run |
|
59 */ |
|
60 void Select(TBool aSelected = ETrue){ iSelected = aSelected; } |
|
61 |
|
62 private: |
|
63 void StartAutoTest(); |
|
64 void SetupL(); |
|
65 void TearDown(); |
|
66 void WatchDogL(); |
|
67 void KeyPress( TInt aCode, TInt aScanCode ); |
|
68 TInt GetFreeMem(); |
|
69 |
|
70 // data |
|
71 |
|
72 TBuf<KNameLength> iName; |
|
73 TInt iAppUID; |
|
74 TInt iViewUID; |
|
75 TInt iTimeout; // [min] |
|
76 TInt iVersion; // 30, 31, 32 |
|
77 TBool iSelected; |
|
78 |
|
79 /** |
|
80 * point to CEikonEnv, |
|
81 * not own. |
|
82 */ |
|
83 CEikonEnv* iEikEnv; |
|
84 }; |
|
85 |
|
86 #endif // C_CBCTESTAPPLICATION_H |