1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/test/t_integ/src/t_wservintegstepsurface.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,126 @@
1.4 +// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @test
1.22 +*/
1.23 +
1.24 +#include "t_wservintegstepsurface.h"
1.25 +#include "t_wservconsts.h"
1.26 +#include <test/t_simload.h>
1.27 +
1.28 +/**
1.29 + CT_WServIntegStepSurface constructor.
1.30 + @return N/A
1.31 + @pre None
1.32 + @post CT_WServIntegStepSurface 1st stage constructor
1.33 +*/
1.34 +CT_WServIntegStepSurface::CT_WServIntegStepSurface()
1.35 + {
1.36 + SetTestStepName(KT_WServIntegStepSurface);
1.37 + }
1.38 +
1.39 +/**
1.40 +Starts test step
1.41 +@internalComponent
1.42 +@return TVerdict pass / fail
1.43 +@pre N/A
1.44 +@post N/A
1.45 +*/
1.46 +enum TVerdict CT_WServIntegStepSurface::doTestStepL()
1.47 + {
1.48 + __UHEAP_MARK;
1.49 +
1.50 + PrintTestStepName();
1.51 +
1.52 + GetConfigDataL(KSimLoadData(), KSimLoadDataName());
1.53 + PrintConfigDataL(KSimLoadConfigFile());
1.54 + CreateSimLoadProcL();
1.55 + ClearConfigData();
1.56 +
1.57 + // Semaphore created here to maintain compatibility with DSA test use of t_app1
1.58 + RSemaphore dudSemaphore;
1.59 + User::LeaveIfError(dudSemaphore.CreateGlobal(KWservDsaSemaphoreName(), 0));
1.60 +
1.61 + GetConfigDataL(KTApp1Data(), KTApp1DataName());
1.62 + PrintConfigDataL(KWServTApp1ConfigFile());
1.63 + TInt err = CreateTestProcessL(KWServTApp1, EPriorityForeground);
1.64 + TEST(err==KErrNone);
1.65 + ClearConfigData();
1.66 +
1.67 + GetConfigDataL(KPseudoAppData(), KPseudoAppDataName());
1.68 + PrintConfigDataL(KWServPseudoAppConfigFile());
1.69 + CreatePseudoAppProcL();
1.70 + ClearConfigData();
1.71 +
1.72 + /***
1.73 + * Create a second process pseudoapp1.exe similar to pseudoapp.exe to test GCE
1.74 + * composing two independent surfaces at different frame rates
1.75 + */
1.76 + TBool pseudoApp1=EFalse;
1.77 + if ( GetBoolFromConfig(ConfigSection(),KCreatePseudoApp1, pseudoApp1) )
1.78 + {
1.79 + if (pseudoApp1)
1.80 + {
1.81 + GetConfigDataL(KPseudoApp1Data(), KPseudoApp1DataName());
1.82 + PrintConfigDataL(KWServPseudoApp1ConfigFile());
1.83 + err=CreateTestProcessL(KWServPseudoApp1, EPriorityForeground);
1.84 + TEST(err==KErrNone);
1.85 + ClearConfigData();
1.86 +
1.87 + WaitForTestL(KWServPseudoApp1FinishFile());
1.88 +
1.89 + // retrieve results from pseudo app1
1.90 + CheckResultsL(KPseudoApp1ResultData(), KPseudoApp1ResultDataName(), KWServPseudoApp1ResultFile());
1.91 + PrintResultsL(KWServPseudoApp1ResultFile());
1.92 + }
1.93 + }
1.94 +
1.95 + WaitForTestL(KWServPseudoAppFinishFile());
1.96 +
1.97 + // retrieve results from pseudo app
1.98 + CheckResultsL(KPseudoAppResultData(), KPseudoAppResultDataName(), KWServPseudoAppResultFile());
1.99 + PrintResultsL(KWServPseudoAppResultFile());
1.100 +
1.101 + dudSemaphore.Close();
1.102 + CleanUp();
1.103 +
1.104 + __UHEAP_MARKEND;
1.105 +
1.106 + return TestStepResult();
1.107 + }
1.108 +
1.109 +void CT_WServIntegStepSurface::CreateSimLoadProcL()
1.110 + {
1.111 + TInt simLoadAppErr = KErrNone;
1.112 + TInt index = 1;
1.113 + TBuf<KMaxTestExecuteCommandLength> tempStore;
1.114 +
1.115 + while (simLoadAppErr == KErrNone && index <= KNumSimLoadApps)
1.116 + {
1.117 + tempStore.Format(KSimLoadApp, index++);
1.118 +
1.119 + simLoadAppErr = CreateTestProcessL(tempStore, EPriorityHigh);
1.120 + }
1.121 + }
1.122 +
1.123 +void CT_WServIntegStepSurface::CreatePseudoAppProcL()
1.124 + {
1.125 + TInt err;
1.126 + err = CreateTestProcessL(KWServPseudoApp, EPriorityForeground);
1.127 + TEST(err==KErrNone);
1.128 + }
1.129 +