|
20
|
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 |
/**
|
|
|
63 |
* test whether the application is selected
|
|
|
64 |
*/
|
|
|
65 |
TBool IsSelect(){ return iSelected; }
|
|
|
66 |
|
|
|
67 |
private:
|
|
|
68 |
void StartAutoTest();
|
|
|
69 |
void SetupL();
|
|
|
70 |
void TearDown();
|
|
|
71 |
void WatchDogL();
|
|
|
72 |
void KeyPress( TInt aCode, TInt aScanCode );
|
|
|
73 |
TInt GetFreeMem();
|
|
|
74 |
|
|
|
75 |
// data
|
|
|
76 |
|
|
|
77 |
TBuf<KNameLength> iName;
|
|
|
78 |
TInt iAppUID;
|
|
|
79 |
TInt iViewUID;
|
|
|
80 |
TInt iTimeout; // [min]
|
|
|
81 |
TInt iVersion; // 30, 31, 32
|
|
|
82 |
TBool iSelected;
|
|
|
83 |
|
|
|
84 |
/**
|
|
|
85 |
* point to CEikonEnv,
|
|
|
86 |
* not own.
|
|
|
87 |
*/
|
|
|
88 |
CEikonEnv* iEikEnv;
|
|
|
89 |
};
|
|
|
90 |
|
|
|
91 |
#endif // C_CBCTESTAPPLICATION_H
|