sysstatemgmt/systemstatereferenceplugins/test/tclayer/src/tclayer_step_startersession.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".
   333 	TEST(starterSession.Handle() == SsmCmnWrapper::SsmStateManagerHandle());
   333 	TEST(starterSession.Handle() == SsmCmnWrapper::SsmStateManagerHandle());
   334 	
   334 	
   335 	INFO_PRINTF1(_L("Deleting splash screen property"));
   335 	INFO_PRINTF1(_L("Deleting splash screen property"));
   336 	ret = RProperty::Delete(KPSUidStartup, KPSSplashShutdown);
   336 	ret = RProperty::Delete(KPSUidStartup, KPSSplashShutdown);
   337 	TEST(ret == KErrNone || ret == KErrNotFound);
   337 	TEST(ret == KErrNone || ret == KErrNotFound);
       
   338 	INFO_PRINTF2(_L("ret val is : %d"), ret);
   338 		
   339 		
   339 	
   340 	
   340 	INFO_PRINTF1(_L("Ending splashscreen without defining property"));
   341 	INFO_PRINTF1(_L("Ending splashscreen without defining property"));
   341 	ret = starterSession.EndSplashScreen();
   342 	ret = starterSession.EndSplashScreen();
   342 	TEST(ret == KErrNotFound);
   343 	TEST(ret == KErrNotFound);
       
   344 	INFO_PRINTF2(_L("ret val is : %d"), ret);
   343 	
   345 	
   344 	INFO_PRINTF1(_L("Defining splash screen property"));
   346 	INFO_PRINTF1(_L("Defining splash screen property"));
   345 	// In a test enviroment we don't need to worry about protecting the property
   347 	// In a test enviroment we don't need to worry about protecting the property
   346 	// so allow anything to change it
   348 	// so allow anything to change it
   347 	_LIT_SECURITY_POLICY_PASS(KAllPass); //lint !e648 Suppress overflow in computing constant for operation
   349 	_LIT_SECURITY_POLICY_PASS(KAllPass); //lint !e648 Suppress overflow in computing constant for operation
   348 	ret = RProperty::Define(KPSUidStartup, KPSSplashShutdown, RProperty::EInt, KAllPass, KAllPass);
   350 	ret = RProperty::Define(KPSUidStartup, KPSSplashShutdown, RProperty::EInt, KAllPass, KAllPass);
   349 	TEST(ret == KErrNone);
   351 	INFO_PRINTF3(_L("KPSUidStartup = %x, KPSSplashShutdown = %x"), KPSUidStartup, KPSSplashShutdown);
       
   352 	TEST(ret == KErrNone);
       
   353 	INFO_PRINTF2(_L("ret val is : %d"), ret);
   350 	
   354 	
   351 	INFO_PRINTF1(_L("Ending splashscreen with property defined"));
   355 	INFO_PRINTF1(_L("Ending splashscreen with property defined"));
   352 	ret = starterSession.EndSplashScreen();
   356 	ret = starterSession.EndSplashScreen();
   353 	TEST(ret == KErrNone);
   357 	TEST(ret == KErrNone);
       
   358 	INFO_PRINTF2(_L("ret val is : %d"), ret);
   354 	
   359 	
   355 	INFO_PRINTF1(_L("Reading splash screen property"));
   360 	INFO_PRINTF1(_L("Reading splash screen property"));
   356 	TInt value;
   361 	TInt value;
   357 	ret = RProperty::Get(KPSUidStartup, KPSSplashShutdown, value);
   362 	ret = RProperty::Get(KPSUidStartup, KPSSplashShutdown, value);
   358 	TEST(ret == KErrNone);
   363 	TEST(ret == KErrNone);
       
   364 	INFO_PRINTF2(_L("ret val is : %d"), ret);
   359 	TEST(value == ESplashShutdown);
   365 	TEST(value == ESplashShutdown);
       
   366 	INFO_PRINTF3(_L("Property value is : %d .Expected : %d"), ret, ESplashShutdown);
   360 	
   367 	
   361 	INFO_PRINTF1(_L("Close on connected RStartSession"));
   368 	INFO_PRINTF1(_L("Close on connected RStartSession"));
   362 	starterSession.Close();
   369 	starterSession.Close();
   363 	TEST(starterSession.Handle() == KNullHandle);
   370 	TEST(starterSession.Handle() == KNullHandle);
   364 	
   371