Update contrib.
1 // Copyright (c) 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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef TESTGCEHARNESS_H
17 #define TESTGCEHARNESS_H
20 #include <graphics/surfaceupdateclient.h>
22 // The default processing delay for displaty and available events. Test specific delays can be set using
23 // SetBufferEventProcessingDelay().
24 static const TInt KDefaultDisplayedProcessingDelay = 2000;
25 static const TInt KDefaultAvailableProcessingDelay = 2000;
27 class CTestGCEHarness : public CBase
39 // The following functions are for use by the testframework test steps only
41 // Create global instance
42 static CTestGCEHarness* NewL(TInt aNumBuffers);
44 // Remove global instance - object must have ben closed first. Video Renderer destruction calls
45 // RSurfaceUpdateSession::Close() whihc in turn calls CTestGCEHarness::Close()
48 // Resets object to use the supplied number of buffers
49 static void ResetBuffersL(TInt aNumBuffers);
51 // Resets global pointer to NULL - used in test pre amble. Required because Panic tests leave the
52 // pointer hanging which if left causes the following test to crash.
53 static void ResetGlobalPointer();
55 // Allows delay to be set on a per test basis. If used before call to NewL() will fail silently.
56 static void SetBufferEventProcessingDelay(TRendererEvent aEventType, TTimeIntervalMicroSeconds32 aDelay);
58 // The following functions are for use by the test RSurfaceUpdateSession implementation only
60 // Returns pointer to global pointer - leaves if object has not been created previously
61 static CTestGCEHarness* RetrieveL();
63 // The following are called directly from same named functions in test RSurfaceUpdateSession implementation
66 void CancelAllNotifications();
67 TInt SubmitUpdate(TInt aBuffer);
68 void NotifyWhenAvailable(TRequestStatus& aStatus);
69 void NotifyWhenDisplayed(TRequestStatus& aStatus, TTimeStamp& aTimeStamp);
75 struct TBufferUpdateData
77 TTimeIntervalMicroSeconds32 iDisplayedProcessingDelay;
78 TTimeIntervalMicroSeconds32 iAvailableProcessingDelay;
79 TInt iDisplayedCompleteReason;
80 TInt iAvailableCompleteReason;
81 TBool iDisplayedInProgress;
82 TBool iAvailableInProgress;
83 CTestTimer* iDisplayedTimer;
84 CTestTimer* iAvailableTimer;
85 TRequestStatus *iStatusAvailable;
90 void ConstructL(TInt aNumBuffers);
92 TRequestStatus *iStatusAvailable;
93 TRequestStatus *iStatusDisplayed;
94 TTimeStamp* iTimeStamp;
95 RArray<TBufferUpdateData> iUpdateArray;
99 void OnTimer(TInt aBufferId, TRendererEvent aEvent);
101 class CTestTimer : public CTimer
104 static CTestTimer* NewL(CTestGCEHarness& aContainer, TInt aBufferId, TRendererEvent aEvent);
105 CTestTimer(CTestGCEHarness& aContainer, TInt aBufferId, TRendererEvent aEvent):CTimer(EPriorityStandard),iContainer(aContainer),iBufferId(aBufferId), iEvent(aEvent)
107 CActiveScheduler::Add(this);
112 iContainer.OnTimer(iBufferId, iEvent);
115 CTestGCEHarness& iContainer;
117 TRendererEvent iEvent;
121 #endif // TESTGCEHARNESS_H