os/security/authorisation/userpromptservice/policies/test/tupspolicies/source/tupsplugins.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/authorisation/userpromptservice/policies/test/tupspolicies/source/tupsplugins.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,90 @@
     1.4 +/*
     1.5 +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef TUPSPLUGINS_H
    1.23 +#define TUPSPLUGINS_H
    1.24 +
    1.25 +#include <e32base.h>
    1.26 +#include <e32cmn.h>
    1.27 +#include <f32file.h>
    1.28 +#include <test/tefunit.h>
    1.29 +#include <ups/promptrequest.h>
    1.30 +#include <ups/upsdb.h>
    1.31 +#include <ups/dialogcreator.h>
    1.32 +#include <ups/fingerprint.h>
    1.33 +#include <ups/policyevaluator.h>
    1.34 +
    1.35 +#include "activewaiter.h"
    1.36 +#include "pluginmanager.h"
    1.37 +#include "policycache.h"
    1.38 +#include "util.h"
    1.39 +
    1.40 +class CTestPlugins : public CActiveTestFixture, public MActiveWaiterObserver  
    1.41 +	{
    1.42 +public:
    1.43 +	// From CTestFixture
    1.44 +	void SetupL();
    1.45 +	void TearDownL();
    1.46 +	
    1.47 +	// Implement MActiveWaiterObserver
    1.48 +	void DoCancel();	
    1.49 +
    1.50 +	// Policy Evaluator Unit Test
    1.51 +	void TestCacheL();
    1.52 +	void TestPluginManagerL();
    1.53 +	void TestLengthsL();
    1.54 +	void TestOOML();
    1.55 +	
    1.56 +	// Create a suite of all the tests
    1.57 +	static CTestSuite* CreateSuiteL(const TDesC& aName);
    1.58 +	
    1.59 +private:
    1.60 +	class TExpectedValue
    1.61 +		{
    1.62 +	public:
    1.63 +		TInt iFlags;
    1.64 +		TInt iMajorVersion;
    1.65 +		TInt iMinorVersion;
    1.66 +		TInt iPolicyEvaluator;
    1.67 +		TBool iSilent;
    1.68 +		TBuf8<32> iClientEntity;
    1.69 +		};	
    1.70 +
    1.71 +	TBool DoRequestL(const TExpectedValue& aExpected, const UserPromptService::CPromptRequest& aRequest);	
    1.72 +	TBool DoOomRequestL(const TExpectedValue& aExpected, const UserPromptService::CPromptRequest& aRequest);
    1.73 +	
    1.74 +	UserPromptService::CPromptRequest* GetRequestParamsLC(const TDesC& aSection, const TDesC8& aClientEntity);
    1.75 +	void GetResponseL(const TDesC& aSection);
    1.76 +	TBool CheckPolicyL(const TExpectedValue& aExpected, const UserPromptService::CPolicy* aPolicy);
    1.77 +	void GetExpectedValuesL(const TDesC& aSection);
    1.78 +	void LoadTestDataL(TInt aNumRequests);
    1.79 +
    1.80 +	UserPromptService::CPolicy::TOptions iResponse;
    1.81 +	UserPromptService::CDecisionRecord* iDecisionRecord;	
    1.82 +	
    1.83 +	CActiveWaiter* iActiveWaiter;
    1.84 +	TInt iExpectedError;
    1.85 +	RFs iFs;
    1.86 +	RPointerArray<UserPromptService::CPromptRequest> iRequests;
    1.87 +	RPointerArray<TExpectedValue> iExpectedValues;
    1.88 +	TBool iOom;				///< Whether an OOM test is running
    1.89 +	TBool iInteractive;		///< Whether to display the techview dialog
    1.90 +	};
    1.91 +
    1.92 +#endif // TUPSPLUGINS_H
    1.93 +