First public contribution.
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Test class that allows a scriopt to set global values
18 #include "globalsettings.h"
19 #include <test/extendtef.h>
21 TGlobalSettings settings_instance={0,0};
22 const TGlobalSettings& TGlobalSettings::Instance()
24 return settings_instance;
27 // Create a suite of all the tests
28 CTestSuite* CGlobalSettings::CreateSuiteL(const TDesC& aName)
30 SUB_SUITE_OPT(CGlobalSettings,NULL);
32 ADD_TEST_STEP_PARAM_RANGE(SetScreenNoL,0,9);
33 ADD_TEST_STEP_PARAM_BOOL(ExpectDisconnectedScreenL);
38 void CGlobalSettings::SetScreenNoL(TInt aScreenNo)
41 ASSERT_EQUALS(session.Connect(), KErrNone);
42 TInt maxScreens=session.NumberOfScreens();
44 if (maxScreens>aScreenNo)
46 INFO_PRINTF2(_L("New screen number for all output selected: %i"),aScreenNo);
48 CWsScreenDevice screen(session);
49 screen.Construct(aScreenNo);
50 screen.SetCurrentRotations(0,CFbsBitGc::TGraphicsOrientation(0));
51 screen.SetScreenMode(0);
52 screen.SetAppScreenMode(0);
54 settings_instance.iScreen=aScreenNo;
60 INFO_PRINTF1(_L("**************************"));
62 INFO_PRINTF3(_L("Can't set screen output to %i. Only got %i screens"),aScreenNo,maxScreens);
63 INFO_PRINTF2(_L("Screen number for all output remains at: %i"),settings_instance.iScreen);
66 INFO_PRINTF1(_L("**************************"));
69 User::Leave(KErrTEFUnitFail);
73 void CGlobalSettings::ExpectDisconnectedScreenL(TBool aValue)
75 settings_instance.iDisconnected=aValue;