1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
19 @internalComponent - Internal Symbian test code |
19 @internalComponent - Internal Symbian test code |
20 */ |
20 */ |
21 #include "ti_adaptationplugin_stepbase.h" |
21 #include "ti_adaptationplugin_stepbase.h" |
22 |
22 |
23 #include <e32debug.h> |
23 #include <e32debug.h> |
24 #include <e32property.h> |
|
25 |
|
26 _LIT (KExeToDefineTestPS, "\\sys\\bin\\definetestps.exe"); |
|
27 |
24 |
28 static TInt StopScheduler(TAny* aTestAdaptStep) |
25 static TInt StopScheduler(TAny* aTestAdaptStep) |
29 { |
26 { |
30 // We would stop the sceduler once all the required transitions are completed |
27 // We would stop the sceduler once all the required transitions are completed |
31 RDebug::Print(_L("Inside Stop Scheduler...")); |
28 RDebug::Print(_L("Inside Stop Scheduler...")); |
52 iAdptTransitionCompleted = ETrue; |
49 iAdptTransitionCompleted = ETrue; |
53 } |
50 } |
54 |
51 |
55 TVerdict CTestAdaptStep::doTestStepPreambleL() |
52 TVerdict CTestAdaptStep::doTestStepPreambleL() |
56 { |
53 { |
57 RProcess processHandle; |
|
58 CleanupClosePushL(processHandle); |
|
59 |
|
60 //Start the test exe which defines property keys for loading reference plugins |
|
61 |
|
62 TInt err = processHandle.Create(KExeToDefineTestPS, KNullDesC); |
|
63 INFO_PRINTF2(_L("Process creation returned : %d"), err); |
|
64 User::LeaveIfError(err); |
|
65 processHandle.Resume(); |
|
66 |
|
67 // wait for the newly created process to rendezvous |
|
68 TRequestStatus status; |
|
69 processHandle.Rendezvous(status); |
|
70 User::WaitForRequest(status); |
|
71 TInt retVal = status.Int(); |
|
72 INFO_PRINTF2(_L("iStatus.Int() returned : %d"), retVal); |
|
73 TEST(KErrNone == retVal); |
|
74 CleanupStack::PopAndDestroy(); |
|
75 |
|
76 // Set all the property keys |
|
77 err = RProperty::Set(KPropertyCategory, KEmergencyCallRfAdaptationPluginPropertyKey, 1); |
|
78 TEST(KErrNone == err); |
|
79 |
|
80 err = RProperty::Set(KPropertyCategory, KStateAdaptationPluginPropertyKey, 1); |
|
81 TEST(KErrNone == err); |
|
82 |
|
83 err = RProperty::Set(KPropertyCategory, KRtcAdaptationPluginPropertyKey, 1); |
|
84 TEST(KErrNone == err); |
|
85 |
|
86 err = RProperty::Set(KPropertyCategory, KSimPluginPropertyKey, 1); |
|
87 TEST(KErrNone == err); |
|
88 |
|
89 err = RProperty::Set(KPropertyCategory, KMiscPluginPropertyKey, 1); |
|
90 TEST(KErrNone == err); |
|
91 |
|
92 INFO_PRINTF1(_L("Starting the scheduler in CTestEmergencyAdaptStep::doTestStepPreambleL ...")); |
54 INFO_PRINTF1(_L("Starting the scheduler in CTestEmergencyAdaptStep::doTestStepPreambleL ...")); |
93 iActiveScheduler = new(ELeave) CActiveScheduler; |
55 iActiveScheduler = new(ELeave) CActiveScheduler; |
94 CActiveScheduler::Install (iActiveScheduler); |
56 CActiveScheduler::Install (iActiveScheduler); |
95 |
57 |
96 iAsyncStopScheduler = new(ELeave) CAsyncCallBack(CActive::EPriorityIdle); |
58 iAsyncStopScheduler = new(ELeave) CAsyncCallBack(CActive::EPriorityIdle); |
101 } |
63 } |
102 |
64 |
103 /** */ |
65 /** */ |
104 TVerdict CTestAdaptStep::doTestStepPostambleL() |
66 TVerdict CTestAdaptStep::doTestStepPostambleL() |
105 { |
67 { |
106 //Unset all the PandS keys |
|
107 TInt err = RProperty::Set(KPropertyCategory, KEmergencyCallRfAdaptationPluginPropertyKey, 0); |
|
108 TEST(KErrNone == err); |
|
109 |
|
110 err = RProperty::Set(KPropertyCategory, KStateAdaptationPluginPropertyKey, 0); |
|
111 TEST(KErrNone == err); |
|
112 |
|
113 err = RProperty::Set(KPropertyCategory, KRtcAdaptationPluginPropertyKey, 0); |
|
114 TEST(KErrNone == err); |
|
115 |
|
116 err = RProperty::Set(KPropertyCategory, KSimPluginPropertyKey, 0); |
|
117 TEST(KErrNone == err); |
|
118 |
|
119 err = RProperty::Set(KPropertyCategory, KMiscPluginPropertyKey, 0); |
|
120 TEST(KErrNone == err); |
|
121 |
|
122 |
|
123 return CTestStep::doTestStepPostambleL(); |
68 return CTestStep::doTestStepPostambleL(); |
124 } |
69 } |