sysstatemgmt/systemstateplugins/test/tunitadptplugin/src/tstate_adaptationplugin_step.cpp
branchRCL_3
changeset 22 8cb079868133
parent 21 ccb4f6b3db21
equal deleted inserted replaced
21:ccb4f6b3db21 22:8cb079868133
     1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2007-2009 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 
    22 
    23 
    23 
    24 #include <s32mem.h>
    24 #include <s32mem.h>
    25 #include <e32property.h>
       
    26 #include <ssm/ssmadaptation.h>
    25 #include <ssm/ssmadaptation.h>
    27 #include "tstate_adaptationplugin_step.h"
    26 #include "tstate_adaptationplugin_step.h"
    28 
       
    29 const TUint32 KStateAdaptationPluginPropertyKey = 0x2000D76A;
       
    30 const TUid KPropertyCategory={0x2000D75B};
       
    31 
    27 
    32 typedef MStateAdaptation* (*TFuncNewL)();
    28 typedef MStateAdaptation* (*TFuncNewL)();
    33 
    29 
    34 CTestStateAdaptationPlugin::CTestStateAdaptationPlugin()
    30 CTestStateAdaptationPlugin::CTestStateAdaptationPlugin()
    35 	:CAdaptationTestBase(KTCTestStateAdaptationPlugin)
    31 	:CAdaptationTestBase(KTCTestStateAdaptationPlugin)
   183 	}
   179 	}
   184 
   180 
   185 //from CAdaptationTestBase
   181 //from CAdaptationTestBase
   186 TVerdict CTestStateAdaptationPlugin::doTestStepL()
   182 TVerdict CTestStateAdaptationPlugin::doTestStepL()
   187 	{
   183 	{
   188 	TInt err = RProperty::Define(KPropertyCategory, KStateAdaptationPluginPropertyKey, RProperty::EInt);
   184 	TInt err = KErrNone;
   189 	TEST((KErrNone == err) || (KErrAlreadyExists == err));
       
   190 	err = RProperty::Set(KPropertyCategory, KStateAdaptationPluginPropertyKey, 1);
       
   191 	TEST(KErrNone == err);
       
   192 	
   185 	
   193 	__UHEAP_MARK;
   186 	__UHEAP_MARK;
   194 	TRAP(err, TestRequestCoopSysStateChangeL());
   187 	TRAP(err, TestRequestCoopSysStateChangeL());
   195 	TEST(err == KErrNone);
   188 	TEST(err == KErrNone);
   196 	__UHEAP_MARKEND;
   189 	__UHEAP_MARKEND;
   261 	TestRequestCancel();
   254 	TestRequestCancel();
   262 	TEST(err == KErrNone);
   255 	TEST(err == KErrNone);
   263 
   256 
   264 	TestNotifyCancel();
   257 	TestNotifyCancel();
   265 	TEST(err == KErrNone);
   258 	TEST(err == KErrNone);
   266 	
   259 
   267 	err = RProperty::Delete(KPropertyCategory, KStateAdaptationPluginPropertyKey);
       
   268 	TEST(KErrNone == err);
       
   269 	return TestStepResult();
   260 	return TestStepResult();
   270 	}
   261 	}