windowing/windowserver/test/tdynamicres/src/screenselect.cpp
changeset 103 2717213c588a
parent 0 5d03bc08d59c
equal deleted inserted replaced
98:bf7481649c98 103:2717213c588a
       
     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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18 */
       
    19 
       
    20 #include <e32std.h>
       
    21 #include <w32std.h>
       
    22 #include "teflogextensions.h"
       
    23 #include "screenselect.h"
       
    24 #include "globalsettings.h"
       
    25 
       
    26 //Note that this class now just acts as a stub to the CGlobalSettings::SetScreenNoL() method and data, so both are equivalent.
       
    27 
       
    28 CScreenSelect::CScreenSelect(TInt aScreenNumber, const TDesC& aStepName)
       
    29 	{
       
    30 	SetTestStepName(aStepName);
       
    31 	iScreenNumber = aScreenNumber;
       
    32 	}
       
    33 
       
    34 CScreenSelect::~CScreenSelect()
       
    35 	{
       
    36 	}
       
    37 
       
    38 
       
    39 TInt CScreenSelect::Number()
       
    40 	{
       
    41 	return	TGlobalSettings::Instance().iScreen;
       
    42 	}
       
    43 
       
    44 
       
    45 TVerdict CScreenSelect::doTestStepL()
       
    46 	{
       
    47 	SetTestStepError(EFail);
       
    48 
       
    49 	CGlobalSettings* globalSettings=new (ELeave) CGlobalSettings;
       
    50 	
       
    51 	globalSettings->SetLoggerL(Logger());
       
    52 	TRAPD(err,globalSettings->SetScreenNoL( iScreenNumber));
       
    53 	
       
    54 	if (err==KErrNone)
       
    55 		{
       
    56 		SetTestStepError(EPass);
       
    57 		return EPass;
       
    58 		}
       
    59 	else
       
    60 		{
       
    61 		return EFail;
       
    62 		}
       
    63 	}
       
    64