Update contrib.
1 // Copyright (c) 2002-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 // e32test\power\t_switchoff.cpp
19 #include <e32event_private.h>
23 LOCAL_D RTest test(_L(" T_SWITCHOFF "));
25 void SetAbsoluteTimeout(RTimer& aTimer, TUint aUs, TRequestStatus& aStatus)
29 wakeup += TTimeIntervalMicroSeconds(aUs);
30 aTimer.At(aStatus, wakeup);
33 void SwittchOffTests()
35 test.Next(_L("test sending ESwitchOff event"));
37 for (int i = 0; i < 4; ++i)
39 test.Printf(_L(" %d "), i);
40 // Arm an absolute timer wakeup event after 5 sec
41 TRequestStatus absstatus;
43 TInt r = abstimer.CreateLocal();
45 SetAbsoluteTimeout(abstimer, 5000000, absstatus); // 5 sec
47 // Go to standby through sending a ESwitchOff event (uses domain manager)
49 e.Set(TRawEvent::ESwitchOff);
50 r = UserSvr::AddEvent(e);
52 User::WaitForRequest(absstatus);
55 test.Printf(_L(" OK\n"));
59 GLDEF_C TInt E32Main()
62 test.Start(_L("Testing"));