First public contribution.
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 the License "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 // USB Host Mass Storage
25 #include <e32property.h>
28 #include "ttestutils.h"
35 const TUid KMyPropertyCat = {0x10285B2E};
39 EMyPropertyServer = 2,
40 EMyPropertyConnectionStateEvent = 3
43 const TUid KUsbmanSvrSid = {0x101fe1db};
47 void TTestUtils::WaitForBusEventL()
50 _LIT_SECURITY_POLICY_PASS(KMsAllowAllPolicy);
51 _LIT_SECURITY_POLICY_S0(KMsWritePolicy, KUsbmanSvrSid.iUid);
54 User::LeaveIfError(evProp.Define(KMyPropertyCat,
60 TInt err = evProp.Attach(KMyPropertyCat, EMyPropertyEvent);
61 User::LeaveIfError(err);
63 TRequestStatus status;
64 evProp.Subscribe(status);
65 User::WaitForRequest(status);
67 // Notification complete, retrieve the counter value.
71 RProperty::Delete(EMyPropertyEvent);
75 TBool TTestUtils::WaitForConnectionStateEventL()
78 _LIT_SECURITY_POLICY_PASS(KMsAllowAllPolicy);
79 _LIT_SECURITY_POLICY_S0(KMsWritePolicy, KUsbmanSvrSid.iUid);
82 User::LeaveIfError(evProp.Define(KUsbmanSvrSid,
83 EMyPropertyConnectionStateEvent,
88 TInt err = evProp.Attach(KUsbmanSvrSid, EMyPropertyConnectionStateEvent);
89 User::LeaveIfError(err);
91 TRequestStatus status;
92 evProp.Subscribe(status);
93 User::WaitForRequest(status);
95 // Notification complete, retrieve the counter value.
99 RProperty::Delete(KUsbmanSvrSid, EMyPropertyConnectionStateEvent);
105 TTestTimer::TTestTimer()
110 void TTestTimer::Start()
115 void TTestTimer::End()
119 TTimeIntervalSeconds timeTaken;
120 iEnd.SecondsFrom(iStart, timeTaken);
121 TUint totalTime = timeTaken.Int();
122 test.Printf(_L("Time taken is %dHrs:%dmins:%dsecs\n"),
128 TTestTimer::~TTestTimer()