sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysperformrestartactions.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_coopsysperformrestartactions.h"
    22 #include "tcmd_step_coopsysperformrestartactions.h"
    23 #include "ssmcustomcmdfactory.h"
    23 #include "ssmcustomcmdfactory.h"
    24 #include "cmdcoopsysperformrestartactions.h"
    24 #include "cmdcoopsysperformrestartactions.h"
       
    25 #include <e32property.h>
       
    26 
       
    27 const TUint32 KStateAdaptationPluginPropertyKey = 0x2000D76A;
       
    28 const TUid KPropertyCategory={0x2000D75B};
    25 
    29 
    26 CCustomCmdTestCoopSysPerformRestartActions::~CCustomCmdTestCoopSysPerformRestartActions()
    30 CCustomCmdTestCoopSysPerformRestartActions::~CCustomCmdTestCoopSysPerformRestartActions()
    27 	{
    31 	{
    28 	}
    32 	}
    29 
    33 
    37 New Test CaseID 		DEVSRVS-SSREFPLUGINS-CUSTCMD-0002
    41 New Test CaseID 		DEVSRVS-SSREFPLUGINS-CUSTCMD-0002
    38  */
    42  */
    39 
    43 
    40 void CCustomCmdTestCoopSysPerformRestartActions::TestCustomCmdCoopSysPerformRestartActionsL()
    44 void CCustomCmdTestCoopSysPerformRestartActions::TestCustomCmdCoopSysPerformRestartActionsL()
    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);
       
    51     
    42 	_LIT(KTESTLOG, "TestCustomCmdCoopSysPerformRestartActionsL");
    52 	_LIT(KTESTLOG, "TestCustomCmdCoopSysPerformRestartActionsL");
    43 	INFO_PRINTF1(KTESTLOG);
    53 	INFO_PRINTF1(KTESTLOG);
    44 
    54 
    45 	//Create command for Cooperative system perform restart actions
    55 	//Create command for Cooperative system perform restart actions
    46 	MSsmCustomCommand* customCmdCoopSysPerformRestartActions = SsmCustomCmdFactory::CmdCoopSysPerformRestartActionsNewL();
    56 	MSsmCustomCommand* customCmdCoopSysPerformRestartActions = SsmCustomCmdFactory::CmdCoopSysPerformRestartActionsNewL();
    78 	//Close the command
    88 	//Close the command
    79 	customCmdCoopSysPerformRestartActions->Close();
    89 	customCmdCoopSysPerformRestartActions->Close();
    80 	
    90 	
    81 	//Releasing the comand will delete itself.
    91 	//Releasing the comand will delete itself.
    82 	customCmdCoopSysPerformRestartActions->Release();
    92 	customCmdCoopSysPerformRestartActions->Release();
       
    93 	
       
    94 	err = RProperty::Delete(KPropertyCategory, KStateAdaptationPluginPropertyKey);
       
    95     TEST(KErrNone == err);
    83 	}
    96 	}
    84 
    97 
    85 TVerdict CCustomCmdTestCoopSysPerformRestartActions::doTestStepL()
    98 TVerdict CCustomCmdTestCoopSysPerformRestartActions::doTestStepL()
    86 	{
    99 	{
    87 	__UHEAP_MARK;
   100 	__UHEAP_MARK;