os/security/authorisation/userpromptservice/policies/test/tupspolicies/source/tupsplugins.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2007-2009 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 the License "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: 
    15 *
    16 */
    17 
    18 
    19 #ifndef TUPSPLUGINS_H
    20 #define TUPSPLUGINS_H
    21 
    22 #include <e32base.h>
    23 #include <e32cmn.h>
    24 #include <f32file.h>
    25 #include <test/tefunit.h>
    26 #include <ups/promptrequest.h>
    27 #include <ups/upsdb.h>
    28 #include <ups/dialogcreator.h>
    29 #include <ups/fingerprint.h>
    30 #include <ups/policyevaluator.h>
    31 
    32 #include "activewaiter.h"
    33 #include "pluginmanager.h"
    34 #include "policycache.h"
    35 #include "util.h"
    36 
    37 class CTestPlugins : public CActiveTestFixture, public MActiveWaiterObserver  
    38 	{
    39 public:
    40 	// From CTestFixture
    41 	void SetupL();
    42 	void TearDownL();
    43 	
    44 	// Implement MActiveWaiterObserver
    45 	void DoCancel();	
    46 
    47 	// Policy Evaluator Unit Test
    48 	void TestCacheL();
    49 	void TestPluginManagerL();
    50 	void TestLengthsL();
    51 	void TestOOML();
    52 	
    53 	// Create a suite of all the tests
    54 	static CTestSuite* CreateSuiteL(const TDesC& aName);
    55 	
    56 private:
    57 	class TExpectedValue
    58 		{
    59 	public:
    60 		TInt iFlags;
    61 		TInt iMajorVersion;
    62 		TInt iMinorVersion;
    63 		TInt iPolicyEvaluator;
    64 		TBool iSilent;
    65 		TBuf8<32> iClientEntity;
    66 		};	
    67 
    68 	TBool DoRequestL(const TExpectedValue& aExpected, const UserPromptService::CPromptRequest& aRequest);	
    69 	TBool DoOomRequestL(const TExpectedValue& aExpected, const UserPromptService::CPromptRequest& aRequest);
    70 	
    71 	UserPromptService::CPromptRequest* GetRequestParamsLC(const TDesC& aSection, const TDesC8& aClientEntity);
    72 	void GetResponseL(const TDesC& aSection);
    73 	TBool CheckPolicyL(const TExpectedValue& aExpected, const UserPromptService::CPolicy* aPolicy);
    74 	void GetExpectedValuesL(const TDesC& aSection);
    75 	void LoadTestDataL(TInt aNumRequests);
    76 
    77 	UserPromptService::CPolicy::TOptions iResponse;
    78 	UserPromptService::CDecisionRecord* iDecisionRecord;	
    79 	
    80 	CActiveWaiter* iActiveWaiter;
    81 	TInt iExpectedError;
    82 	RFs iFs;
    83 	RPointerArray<UserPromptService::CPromptRequest> iRequests;
    84 	RPointerArray<TExpectedValue> iExpectedValues;
    85 	TBool iOom;				///< Whether an OOM test is running
    86 	TBool iInteractive;		///< Whether to display the techview dialog
    87 	};
    88 
    89 #endif // TUPSPLUGINS_H
    90