os/persistentdata/loggingservices/eventlogger/test/tef/teflogengbur/src/testactive.cpp
Update contrib.
1 // Copyright (c) 2004-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.
14 // Implementation of test active object for log engine testing
15 // Identical implementation exists in common\syslibs\logeng\ongoing\test\src\test.cpp
24 #include "testactive.h"
26 CTestActive::CTestActive(TInt aPriority)
29 CActiveScheduler::Add(this);
33 CTestActive::~CTestActive()
38 void CTestActive::DoCancel()
40 TRequestStatus* s=&iStatus;
41 User::RequestComplete(s, KErrNone);
44 void CTestActive::Start()
46 iDelayCompletion=EFalse;
48 iStatus = KRequestPending;
52 void CTestActive::Start(TInt aDelay)
54 iDelayCompletion=ETrue;
56 iStatus = KRequestPending;
60 void CTestActive::RunL()
62 if(iDelayCompletion && iDelayTime)
64 // Wait for events in other threads to have a go....
65 User::After(iDelayTime);
67 iStoredStatus=iStatus;
69 TRequestStatus* s=&iStatus;
70 User::RequestComplete(s, KErrNone);
75 iStatus=iStoredStatus;
77 CActiveScheduler::Stop();