sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysstatechange.cpp
branchRCL_3
changeset 60 ccb4f6b3db21
parent 0 4e1aa6a622a0
child 61 8cb079868133
equal deleted inserted replaced
56:1ddbe54d0645 60: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_coopsysstatechange.h"
    22 #include "tcmd_step_coopsysstatechange.h"
    23 #include "ssmcustomcmdfactory.h"
    23 #include "ssmcustomcmdfactory.h"
    24 #include <ssm/ssmstate.h>
    24 #include <ssm/ssmstate.h>
       
    25 #include <e32property.h>
    25 #include "cmdcoopsysstatechange.h"
    26 #include "cmdcoopsysstatechange.h"
       
    27 const TUint32 KStateAdaptationPluginPropertyKey = 0x2000D76A;
       
    28 const TUid KPropertyCategory={0x2000D75B};
    26 
    29 
    27 CCustomCmdTestCoopSysStateChange::~CCustomCmdTestCoopSysStateChange()
    30 CCustomCmdTestCoopSysStateChange::~CCustomCmdTestCoopSysStateChange()
    28 	{
    31 	{
    29 	}
    32 	}
    30 
    33 
    38 New Test CaseID 		DEVSRVS-SSREFPLUGINS-CUSTCMD-0007
    41 New Test CaseID 		DEVSRVS-SSREFPLUGINS-CUSTCMD-0007
    39  */
    42  */
    40 
    43 
    41 void CCustomCmdTestCoopSysStateChange::TestCustomCmdCoopSysStateChangeL()
    44 void CCustomCmdTestCoopSysStateChange::TestCustomCmdCoopSysStateChangeL()
    42 	{
    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 	
    43 	_LIT(KTESTLOG, "TestCustomCmdCoopSysStateChangeL");
    52 	_LIT(KTESTLOG, "TestCustomCmdCoopSysStateChangeL");
    44 	INFO_PRINTF1(KTESTLOG);
    53 	INFO_PRINTF1(KTESTLOG);
    45 
    54 
    46 	MSsmCustomCommand* customCmdCoopSysStateChange = SsmCustomCmdFactory::CmdCoopSysStateChangeNewL();
    55 	MSsmCustomCommand* customCmdCoopSysStateChange = SsmCustomCmdFactory::CmdCoopSysStateChangeNewL();
    47 	CSsmCustomCommandEnv* cmdEnv = NULL;
    56 	CSsmCustomCommandEnv* cmdEnv = NULL;
    77 	//Close the command
    86 	//Close the command
    78 	customCmdCoopSysStateChange->Close();
    87 	customCmdCoopSysStateChange->Close();
    79 	
    88 	
    80 	//Releasing the comand will delete itself.
    89 	//Releasing the comand will delete itself.
    81 	customCmdCoopSysStateChange->Release();
    90 	customCmdCoopSysStateChange->Release();
       
    91 	err = RProperty::Delete(KPropertyCategory, KStateAdaptationPluginPropertyKey);
       
    92 	TEST(KErrNone == err);
    82 	}
    93 	}
    83 
    94 
    84 TVerdict CCustomCmdTestCoopSysStateChange::doTestStepL()
    95 TVerdict CCustomCmdTestCoopSysStateChange::doTestStepL()
    85 	{
    96 	{
    86 	__UHEAP_MARK;
    97 	__UHEAP_MARK;