sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysperformrfsactions.cpp
branchRCL_3
changeset 21 ccb4f6b3db21
parent 0 4e1aa6a622a0
child 22 8cb079868133
equal deleted inserted replaced
20:1ddbe54d0645 21:ccb4f6b3db21
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2007-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".
    20 */
    20 */
    21 
    21 
    22 #include "tcmd_step_coopsysperformrfsactions.h"
    22 #include "tcmd_step_coopsysperformrfsactions.h"
    23 #include "ssmcustomcmdfactory.h"
    23 #include "ssmcustomcmdfactory.h"
    24 #include "cmdcoopsysperformrfsactions.h"
    24 #include "cmdcoopsysperformrfsactions.h"
       
    25 #include <e32property.h>
       
    26 
       
    27 const TUint32 KStateAdaptationPluginPropertyKey = 0x2000D76A;
       
    28 const TUid KPropertyCategory={0x2000D75B};
    25 
    29 
    26 CCustomCmdTestCoopSysPerformRfsActions::~CCustomCmdTestCoopSysPerformRfsActions()
    30 CCustomCmdTestCoopSysPerformRfsActions::~CCustomCmdTestCoopSysPerformRfsActions()
    27 	{
    31 	{
    28 	}
    32 	}
    29 
    33 
    37 New Test CaseID 		DEVSRVS-SSREFPLUGINS-CUSTCMD-0003
    41 New Test CaseID 		DEVSRVS-SSREFPLUGINS-CUSTCMD-0003
    38  */
    42  */
    39 
    43 
    40 void CCustomCmdTestCoopSysPerformRfsActions::TestCustomCmdCoopSysPerformRfsActionsL()
    44 void CCustomCmdTestCoopSysPerformRfsActions::TestCustomCmdCoopSysPerformRfsActionsL()
    41 	{
    45 	{
       
    46 	// Setting the P and S key will route the request to the reference plugins instead of the actual plugins
       
    47     TInt err = RProperty::Define(KPropertyCategory, KStateAdaptationPluginPropertyKey, RProperty::EInt);
       
    48     TEST(KErrNone == err || KErrAlreadyExists == err);
       
    49     err = RProperty::Set(KPropertyCategory, KStateAdaptationPluginPropertyKey, 1);
       
    50     TEST(KErrNone == err);
    42 	_LIT(KTESTLOG, "TestCustomCmdCoopSysPerformRfsActionsL");
    51 	_LIT(KTESTLOG, "TestCustomCmdCoopSysPerformRfsActionsL");
    43 	INFO_PRINTF1(KTESTLOG);
    52 	INFO_PRINTF1(KTESTLOG);
    44 
    53 
    45 	MSsmCustomCommand* customCmdCoopSysPerformRfsActions = SsmCustomCmdFactory::CmdCcoopSysPerformRfsActionsNewL();
    54 	MSsmCustomCommand* customCmdCoopSysPerformRfsActions = SsmCustomCmdFactory::CmdCcoopSysPerformRfsActionsNewL();
    46 	CSsmCustomCommandEnv* cmdEnv = NULL;
    55 	CSsmCustomCommandEnv* cmdEnv = NULL;
    85 	//Close the command
    94 	//Close the command
    86 	customCmdCoopSysPerformRfsActions->Close();
    95 	customCmdCoopSysPerformRfsActions->Close();
    87 	
    96 	
    88 	//Releasing the comand will delete itself.
    97 	//Releasing the comand will delete itself.
    89 	customCmdCoopSysPerformRfsActions->Release();
    98 	customCmdCoopSysPerformRfsActions->Release();
       
    99 	err = RProperty::Delete(KPropertyCategory, KStateAdaptationPluginPropertyKey);
       
   100 	TEST(KErrNone == err);
    90 	}
   101 	}
    91 
   102 
    92 TVerdict CCustomCmdTestCoopSysPerformRfsActions::doTestStepL()
   103 TVerdict CCustomCmdTestCoopSysPerformRfsActions::doTestStepL()
    93 	{
   104 	{
    94 	__UHEAP_MARK;
   105 	__UHEAP_MARK;