phonebookengines/contactsmodel/tsrc/Integration/PerfFuncSuite/inc/CRUDOOMStep.h
changeset 0 e686773b3f54
child 24 0ba2181d7c28
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /**
       
     2 * Copyright (c) 2006-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 "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 
       
    20 /**
       
    21  @file 
       
    22  @publishedAll
       
    23  @released
       
    24 */
       
    25 #if (!defined __CCRUDOOM_STEP_H__)
       
    26 #define __CCRUDOOM_STEP_H__
       
    27 #include <test/testexecutestepbase.h>
       
    28 #include <cntviewbase.h>
       
    29 #include "PerformanceFunctionalityBase.h"
       
    30 
       
    31 
       
    32 class CPerformanceFunctionalityTestsSuite;
       
    33 
       
    34 class CCRUDOOMStep : public CPerformanceFunctionalityBase, public MContactViewObserver
       
    35 	{
       
    36 class CDestroyView;
       
    37 friend class CDestroyView;
       
    38 public:
       
    39 	CCRUDOOMStep();
       
    40 	virtual TVerdict doTestStepL();
       
    41 
       
    42 private:
       
    43 	void ReadOOML(const TBool aClient);
       
    44 	void OpenOOML(const TBool aClient);
       
    45 	void DeleteOOML(const TBool aClient);
       
    46 	void AddContactOOML(const TBool aClient);
       
    47 	void CloseContactOOML(const TBool aClient);
       
    48 	void CommitContactOOML(const TBool aClient);
       
    49 	void UpdateContactOOML(const TBool aClient);
       
    50 	void PopulateFullViewL(const TBool aRemote, RContactViewSortOrder& aSortOrder);
       
    51 	void ViewOOMTestL(const TBool aRemote, const TBool aClient);
       
    52 
       
    53 //utility functions
       
    54 private:
       
    55 	void PreTestL();
       
    56 	void InitializeL();
       
    57 	void Cleanup();
       
    58 	void RunAllTestsL(const TBool aClient);
       
    59 	void StartHeapCheck(const TInt aFailAt, const TBool aClient);
       
    60 	TBool EndHeapCheckL(const TInt aErr, const TBool aClient);
       
    61 	void ErrorProcess(	const TInt aFailAt, const TInt aErr,
       
    62 						const TBool aClient, const TBool aCleanup);
       
    63 	void RecoverL(const TInt aErr);
       
    64 	
       
    65 //from MContactViewObserver
       
    66 private:
       
    67 	void HandleContactViewEvent(const CContactViewBase& aView,const TContactViewEvent& aEvent);
       
    68 
       
    69 private:
       
    70 	TContactViewEvent	 iEvent;
       
    71 	CContactViewBase 	*iView;
       
    72 	CDestroyView	 	*iDestroyView;
       
    73 	TInt				iError;
       
    74 
       
    75 
       
    76 private:		
       
    77 	class CDestroyView : public CActive
       
    78 		{
       
    79 		public:
       
    80 			CDestroyView(CCRUDOOMStep *aObserver) : CActive( EPriorityStandard ), iTest( aObserver )
       
    81 				{
       
    82 				}
       
    83 			void RunL();
       
    84 			void DoCancel();
       
    85 			void Activate();
       
    86 
       
    87 		private:
       
    88 			CCRUDOOMStep 	*iTest;
       
    89 			TBool 			iInitial;
       
    90 		};
       
    91 	};
       
    92 
       
    93 _LIT(KCRUDOOMStep,"CRUDOOMStep");
       
    94 
       
    95 
       
    96 #endif