os/graphics/graphicstest/graphicstestharness/inc/t_simloadutils.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/graphicstest/graphicstestharness/inc/t_simloadutils.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,78 @@
     1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +/**
    1.20 + @file
    1.21 + @test
    1.22 +*/
    1.23 +
    1.24 +#ifndef __T_SIM_LOAD_UTILS_H__
    1.25 +#define __T_SIM_LOAD_UTILS_H__
    1.26 +
    1.27 +#include <e32base.h>
    1.28 +
    1.29 + _LIT(KDefaultSectionName, "default");
    1.30 +
    1.31 +class CTSimLoadAppUtils
    1.32 +	{
    1.33 +public:
    1.34 +	/**
    1.35 +	* Read in sim load type parameter from configuration file
    1.36 +	* created by test step, and indicate whether the type is
    1.37 +	* static.
    1.38 +	*
    1.39 +	* @return   ETrue if static load specified.
    1.40 +				EFalse if spiked load specified
    1.41 +	* @leave	KErrAbort if the load type cannot be determined,
    1.42 +				otherwise a system error code.
    1.43 +	*/
    1.44 +	IMPORT_C static TBool IsStaticLoadL();
    1.45 +
    1.46 +	/**
    1.47 +	* Read in the simload (as a percentage) config parameter from
    1.48 +	* configuration file created by test step.
    1.49 +	*
    1.50 +	* @return	The simulated load that the app (in
    1.51 +	*			combination with 2 other apps) is to achieve.
    1.52 +	* @leave	System error code.
    1.53 +	*/
    1.54 +	IMPORT_C static TInt SimLoadL();
    1.55 +
    1.56 +	/**
    1.57 +	* Given a load percentage, and seed value for delay, create a load that when
    1.58 +	* combined with 2 other sim load apps produce the load percentage passed in.
    1.59 +	*
    1.60 +	* @param	aLoadPercentage The simulated load that the app (in
    1.61 +	*			combination with 2 other apps) is to achieve.
    1.62 +	* @param    aDelay Seed value which harmonises the load pattern.
    1.63 +	* @leave	System wide error code
    1.64 +	*/
    1.65 +	IMPORT_C static void SimulateStaticLoadL(TInt aLoadPercentage, TInt aDelay);
    1.66 +
    1.67 +	/**
    1.68 +	* Simulates a spiked load, e.g. 100% load for short period of time, at regular
    1.69 +	* spaced intervals, to simulate the load produced when for example a phone
    1.70 +	* call is received.
    1.71 +	*/
    1.72 +	IMPORT_C static void SimulateSpikedLoad();
    1.73 +
    1.74 +private:
    1.75 +	CTSimLoadAppUtils() {}
    1.76 +	static void SimulateTestLoad(TInt, TInt);
    1.77 +	static TInt CalculateSimLoadL(TInt);
    1.78 +	};
    1.79 +
    1.80 +#endif // __T_SIM_LOAD_UTILS_H__
    1.81 +