1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2009 - 2010 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 @test |
19 @test |
20 @internalComponent - Internal Symbian test code |
20 @internalComponent - Internal Symbian test code |
21 */ |
21 */ |
22 |
22 |
23 #include "tcmd_step_execute.h" |
23 #include "tcmd_step_execute.h" |
|
24 #include <e32property.h> |
|
25 const TUint32 KRtcAdaptationPluginPropertyKey = 0x2000D76C; |
|
26 const TUid KPropertyCategory={0x2000D75B}; |
24 |
27 |
25 /** |
28 /** |
26 This function is wrapped in Callback and used to stop the CActiveScheduler |
29 This function is wrapped in Callback and used to stop the CActiveScheduler |
27 when all other activities have been peformed |
30 when all other activities have been peformed |
28 */ |
31 */ |
82 Test CaseID DEVSRVS-SSREFPLUGINS-CUSTCMD-0028 |
85 Test CaseID DEVSRVS-SSREFPLUGINS-CUSTCMD-0028 |
83 */ |
86 */ |
84 void CTestCustomCmdExecute::TestCustomCmdValidateRTC() |
87 void CTestCustomCmdExecute::TestCustomCmdValidateRTC() |
85 { |
88 { |
86 INFO_PRINTF1(_L("TestCustomCmdValidateRTC started")); |
89 INFO_PRINTF1(_L("TestCustomCmdValidateRTC started")); |
|
90 // Setting the P and S key will route the request to the reference plugins instead of the actual plugins |
|
91 TInt err = RProperty::Define(KPropertyCategory, KRtcAdaptationPluginPropertyKey, RProperty::EInt); |
|
92 TEST(KErrNone == err || KErrAlreadyExists == err); |
|
93 err = RProperty::Set(KPropertyCategory, KRtcAdaptationPluginPropertyKey, 1); |
|
94 TEST(KErrNone == err); |
|
95 |
87 //Create ValidateRTC custom command |
96 //Create ValidateRTC custom command |
88 MSsmCustomCommand* customCmdValidateRTC = SsmCustomCmdFactory::CmdValidateRTCNewL(); |
97 MSsmCustomCommand* customCmdValidateRTC = SsmCustomCmdFactory::CmdValidateRTCNewL(); |
89 customCmdValidateRTC->Initialize(iCmdEnv); |
98 customCmdValidateRTC->Initialize(iCmdEnv); |
90 ExecuteCommand(customCmdValidateRTC); |
99 ExecuteCommand(customCmdValidateRTC); |
|
100 // In the reference plugins, the API completes with KErrNotSupported. Hence we check for the same |
91 TEST(KErrNotSupported == iStatus.Int()); |
101 TEST(KErrNotSupported == iStatus.Int()); |
92 ExecuteCommand(customCmdValidateRTC); |
102 ExecuteCommand(customCmdValidateRTC); |
93 customCmdValidateRTC->ExecuteCancel(); |
103 customCmdValidateRTC->ExecuteCancel(); |
|
104 // In the reference plugins, the API completes with KErrNotSupported. Hence we check for the same |
94 TEST(KErrNotSupported == iStatus.Int()); |
105 TEST(KErrNotSupported == iStatus.Int()); |
95 //Close the command |
106 //Close the command |
96 customCmdValidateRTC->Close(); |
107 customCmdValidateRTC->Close(); |
97 //Releasing the comand will delete itself. |
108 //Releasing the comand will delete itself. |
98 customCmdValidateRTC->Release(); |
109 customCmdValidateRTC->Release(); |
99 INFO_PRINTF3(_L("TestCustomCmdValidateRTC completed with %d Expected %d"),iStatus.Int(),KErrNotSupported); |
110 INFO_PRINTF3(_L("TestCustomCmdValidateRTC completed with %d Expected %d"),iStatus.Int(),KErrNone); |
|
111 err = RProperty::Delete(KPropertyCategory, KRtcAdaptationPluginPropertyKey); |
|
112 TEST(KErrNone == err); |
100 } |
113 } |
101 |
114 |
102 /** |
115 /** |
103 Test CaseID DEVSRVS-SSREFPLUGINS-CUSTCMD-0028 |
116 Test CaseID DEVSRVS-SSREFPLUGINS-CUSTCMD-0028 |
104 */ |
117 */ |