sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_execute.cpp
branchRCL_3
changeset 22 8cb079868133
parent 21 ccb4f6b3db21
equal deleted inserted replaced
21:ccb4f6b3db21 22:8cb079868133
     1 // Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 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  @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};
       
    27 
    24 
    28 /**
    25 /**
    29  This function is wrapped in  Callback and used to stop the CActiveScheduler
    26  This function is wrapped in  Callback and used to stop the CActiveScheduler
    30  when all other activities have been peformed
    27  when all other activities have been peformed
    31  */
    28  */
    85 Test CaseID         DEVSRVS-SSREFPLUGINS-CUSTCMD-0028
    82 Test CaseID         DEVSRVS-SSREFPLUGINS-CUSTCMD-0028
    86  */
    83  */
    87 void CTestCustomCmdExecute::TestCustomCmdValidateRTC()
    84 void CTestCustomCmdExecute::TestCustomCmdValidateRTC()
    88     {
    85     {
    89     INFO_PRINTF1(_L("TestCustomCmdValidateRTC started"));
    86     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     
       
    96     //Create ValidateRTC custom command
    87     //Create ValidateRTC custom command
    97     MSsmCustomCommand* customCmdValidateRTC = SsmCustomCmdFactory::CmdValidateRTCNewL();
    88     MSsmCustomCommand* customCmdValidateRTC = SsmCustomCmdFactory::CmdValidateRTCNewL();
    98     customCmdValidateRTC->Initialize(iCmdEnv);
    89     customCmdValidateRTC->Initialize(iCmdEnv);
    99     ExecuteCommand(customCmdValidateRTC);
    90     ExecuteCommand(customCmdValidateRTC);
   100     // In the reference plugins, the API completes with KErrNotSupported. Hence we check for the same
       
   101     TEST(KErrNotSupported == iStatus.Int());
    91     TEST(KErrNotSupported == iStatus.Int());
   102     ExecuteCommand(customCmdValidateRTC);
    92     ExecuteCommand(customCmdValidateRTC);
   103     customCmdValidateRTC->ExecuteCancel();
    93     customCmdValidateRTC->ExecuteCancel();
   104     // In the reference plugins, the API completes with KErrNotSupported. Hence we check for the same
       
   105     TEST(KErrNotSupported == iStatus.Int());
    94     TEST(KErrNotSupported == iStatus.Int());
   106     //Close the command
    95     //Close the command
   107     customCmdValidateRTC->Close();
    96     customCmdValidateRTC->Close();
   108     //Releasing the comand will delete itself.
    97     //Releasing the comand will delete itself.
   109     customCmdValidateRTC->Release();
    98     customCmdValidateRTC->Release();
   110     INFO_PRINTF3(_L("TestCustomCmdValidateRTC completed with %d Expected %d"),iStatus.Int(),KErrNone);
    99     INFO_PRINTF3(_L("TestCustomCmdValidateRTC completed with %d Expected %d"),iStatus.Int(),KErrNotSupported);
   111     err = RProperty::Delete(KPropertyCategory, KRtcAdaptationPluginPropertyKey);
       
   112     TEST(KErrNone == err);
       
   113     }
   100     }
   114 
   101 
   115 /**
   102 /**
   116 Test CaseID 		DEVSRVS-SSREFPLUGINS-CUSTCMD-0028
   103 Test CaseID 		DEVSRVS-SSREFPLUGINS-CUSTCMD-0028
   117  */
   104  */