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