|
1 // Copyright (c) 2007-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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // __ACTION_INFO_BEGIN__ |
|
15 // [Action Name] |
|
16 // ForwardSystemTime |
|
17 // [Action Parameters] |
|
18 // [Action Description] |
|
19 // Forward the system time |
|
20 // __ACTION_INFO_END__ |
|
21 // |
|
22 // |
|
23 |
|
24 // |
|
25 #include "CMtfTestActionForwardSystemTime.h" |
|
26 #include "CMtfTestCase.h" |
|
27 #include "CMtfTestActionParameters.h" |
|
28 |
|
29 |
|
30 CMtfTestAction* CMtfTestActionForwardSystemTime::NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters) |
|
31 { |
|
32 CMtfTestActionForwardSystemTime* self = new (ELeave) CMtfTestActionForwardSystemTime(aTestCase); |
|
33 CleanupStack::PushL(self); |
|
34 self->ConstructL(aActionParameters); |
|
35 CleanupStack::Pop(); |
|
36 return self; |
|
37 } |
|
38 |
|
39 |
|
40 CMtfTestActionForwardSystemTime::CMtfTestActionForwardSystemTime(CMtfTestCase& aTestCase) |
|
41 : CMtfSynchronousTestAction(aTestCase) |
|
42 { |
|
43 } |
|
44 |
|
45 |
|
46 CMtfTestActionForwardSystemTime::~CMtfTestActionForwardSystemTime() |
|
47 { |
|
48 } |
|
49 |
|
50 |
|
51 void CMtfTestActionForwardSystemTime::ExecuteActionL() |
|
52 { |
|
53 TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionForwardSystemTime); |
|
54 |
|
55 //Get the current system time |
|
56 TTime utcTime; |
|
57 utcTime.UniversalTime(); |
|
58 |
|
59 //Get value from Ini file |
|
60 TInt forwardTimeInMinutes = ObtainValueParameterL<TInt>(TestCase(),ActionParameters().Parameter(0)); |
|
61 |
|
62 //Forward the system time |
|
63 TTimeIntervalMinutes forwardMinutes(forwardTimeInMinutes); |
|
64 User::SetUTCTime(utcTime+forwardMinutes); |
|
65 |
|
66 TestCase().INFO_PRINTF2(_L("Test Action %S Passed..."), &KTestActionForwardSystemTime); |
|
67 TestCase().ActionCompletedL(*this); |
|
68 } |
|
69 |
|
70 |
|
71 |
|
72 |