|
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 */ |
|
20 |
|
21 #ifndef __T_SIM_LOAD_UTILS_H__ |
|
22 #define __T_SIM_LOAD_UTILS_H__ |
|
23 |
|
24 #include <e32base.h> |
|
25 |
|
26 _LIT(KDefaultSectionName, "default"); |
|
27 |
|
28 class CTSimLoadAppUtils |
|
29 { |
|
30 public: |
|
31 /** |
|
32 * Read in sim load type parameter from configuration file |
|
33 * created by test step, and indicate whether the type is |
|
34 * static. |
|
35 * |
|
36 * @return ETrue if static load specified. |
|
37 EFalse if spiked load specified |
|
38 * @leave KErrAbort if the load type cannot be determined, |
|
39 otherwise a system error code. |
|
40 */ |
|
41 IMPORT_C static TBool IsStaticLoadL(); |
|
42 |
|
43 /** |
|
44 * Read in the simload (as a percentage) config parameter from |
|
45 * configuration file created by test step. |
|
46 * |
|
47 * @return The simulated load that the app (in |
|
48 * combination with 2 other apps) is to achieve. |
|
49 * @leave System error code. |
|
50 */ |
|
51 IMPORT_C static TInt SimLoadL(); |
|
52 |
|
53 /** |
|
54 * Given a load percentage, and seed value for delay, create a load that when |
|
55 * combined with 2 other sim load apps produce the load percentage passed in. |
|
56 * |
|
57 * @param aLoadPercentage The simulated load that the app (in |
|
58 * combination with 2 other apps) is to achieve. |
|
59 * @param aDelay Seed value which harmonises the load pattern. |
|
60 * @leave System wide error code |
|
61 */ |
|
62 IMPORT_C static void SimulateStaticLoadL(TInt aLoadPercentage, TInt aDelay); |
|
63 |
|
64 /** |
|
65 * Simulates a spiked load, e.g. 100% load for short period of time, at regular |
|
66 * spaced intervals, to simulate the load produced when for example a phone |
|
67 * call is received. |
|
68 */ |
|
69 IMPORT_C static void SimulateSpikedLoad(); |
|
70 |
|
71 private: |
|
72 CTSimLoadAppUtils() {} |
|
73 static void SimulateTestLoad(TInt, TInt); |
|
74 static TInt CalculateSimLoadL(TInt); |
|
75 }; |
|
76 |
|
77 #endif // __T_SIM_LOAD_UTILS_H__ |
|
78 |