sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysperformrestartactions.cpp
branchRCL_3
changeset 21 ccb4f6b3db21
parent 0 4e1aa6a622a0
child 22 8cb079868133
--- a/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysperformrestartactions.cpp	Thu Aug 19 11:09:10 2010 +0300
+++ b/sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysperformrestartactions.cpp	Tue Aug 31 16:29:05 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -22,6 +22,10 @@
 #include "tcmd_step_coopsysperformrestartactions.h"
 #include "ssmcustomcmdfactory.h"
 #include "cmdcoopsysperformrestartactions.h"
+#include <e32property.h>
+
+const TUint32 KStateAdaptationPluginPropertyKey = 0x2000D76A;
+const TUid KPropertyCategory={0x2000D75B};
 
 CCustomCmdTestCoopSysPerformRestartActions::~CCustomCmdTestCoopSysPerformRestartActions()
 	{
@@ -39,6 +43,12 @@
 
 void CCustomCmdTestCoopSysPerformRestartActions::TestCustomCmdCoopSysPerformRestartActionsL()
 	{
+	// Setting the P and S key will route the request to the reference plugins instead of the actual plugins
+    TInt err = RProperty::Define(KPropertyCategory, KStateAdaptationPluginPropertyKey, RProperty::EInt);
+    TEST(KErrNone == err || KErrAlreadyExists == err);
+    err = RProperty::Set(KPropertyCategory, KStateAdaptationPluginPropertyKey, 1);
+    TEST(KErrNone == err);
+    
 	_LIT(KTESTLOG, "TestCustomCmdCoopSysPerformRestartActionsL");
 	INFO_PRINTF1(KTESTLOG);
 
@@ -80,6 +90,9 @@
 	
 	//Releasing the comand will delete itself.
 	customCmdCoopSysPerformRestartActions->Release();
+	
+	err = RProperty::Delete(KPropertyCategory, KStateAdaptationPluginPropertyKey);
+    TEST(KErrNone == err);
 	}
 
 TVerdict CCustomCmdTestCoopSysPerformRestartActions::doTestStepL()