os/graphics/windowing/windowserver/test/t_integ/src/t_wservintegstepsurface.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2007-2010 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  @test
    19 */
    20 
    21 #include "t_wservintegstepsurface.h"
    22 #include "t_wservconsts.h"
    23 #include <test/t_simload.h>
    24 
    25 /**
    26  CT_WServIntegStepSurface constructor.
    27  @return N/A
    28  @pre None
    29  @post CT_WServIntegStepSurface 1st stage constructor
    30 */
    31 CT_WServIntegStepSurface::CT_WServIntegStepSurface()
    32 	{
    33 	SetTestStepName(KT_WServIntegStepSurface);
    34 	}
    35 
    36 /**
    37 Starts test step
    38 @internalComponent
    39 @return TVerdict pass / fail
    40 @pre N/A
    41 @post N/A
    42 */
    43 enum TVerdict CT_WServIntegStepSurface::doTestStepL()
    44 	{
    45 	__UHEAP_MARK;
    46 
    47 	PrintTestStepName();
    48 
    49 	GetConfigDataL(KSimLoadData(), KSimLoadDataName());
    50 	PrintConfigDataL(KSimLoadConfigFile());
    51 	CreateSimLoadProcL();
    52 	ClearConfigData();
    53 
    54 	// Semaphore created here to maintain compatibility with DSA test use of t_app1
    55 	RSemaphore dudSemaphore;
    56 	User::LeaveIfError(dudSemaphore.CreateGlobal(KWservDsaSemaphoreName(), 0));
    57 
    58     GetConfigDataL(KTApp1Data(), KTApp1DataName());
    59 	PrintConfigDataL(KWServTApp1ConfigFile());
    60 	TInt err = CreateTestProcessL(KWServTApp1, EPriorityForeground);
    61 	TEST(err==KErrNone);
    62 	ClearConfigData();
    63 
    64 	GetConfigDataL(KPseudoAppData(), KPseudoAppDataName());
    65 	PrintConfigDataL(KWServPseudoAppConfigFile());
    66 	CreatePseudoAppProcL();
    67 	ClearConfigData();
    68 
    69 	/***
    70 	* Create a second process pseudoapp1.exe similar to pseudoapp.exe to test GCE
    71 	* composing two independent surfaces at different frame rates
    72 	*/
    73 	TBool pseudoApp1=EFalse;
    74 	if ( GetBoolFromConfig(ConfigSection(),KCreatePseudoApp1, pseudoApp1) )
    75 		{
    76 		if (pseudoApp1)
    77 			{
    78 			GetConfigDataL(KPseudoApp1Data(), KPseudoApp1DataName());
    79 			PrintConfigDataL(KWServPseudoApp1ConfigFile());
    80 			err=CreateTestProcessL(KWServPseudoApp1, EPriorityForeground);
    81 			TEST(err==KErrNone);
    82 			ClearConfigData();
    83 
    84 			WaitForTestL(KWServPseudoApp1FinishFile());
    85 
    86 			// retrieve results from pseudo app1
    87 			CheckResultsL(KPseudoApp1ResultData(), KPseudoApp1ResultDataName(), KWServPseudoApp1ResultFile());
    88 			PrintResultsL(KWServPseudoApp1ResultFile());
    89 			}
    90 		}
    91 
    92 	WaitForTestL(KWServPseudoAppFinishFile());
    93 
    94 	// retrieve results from pseudo app
    95 	CheckResultsL(KPseudoAppResultData(), KPseudoAppResultDataName(), KWServPseudoAppResultFile());
    96 	PrintResultsL(KWServPseudoAppResultFile());
    97 
    98 	dudSemaphore.Close();
    99 	CleanUp();
   100 
   101 	__UHEAP_MARKEND;
   102 
   103 	return TestStepResult();
   104 	}
   105 
   106 void CT_WServIntegStepSurface::CreateSimLoadProcL()
   107 	{
   108 	TInt simLoadAppErr = KErrNone;
   109 	TInt index = 1;
   110 	TBuf<KMaxTestExecuteCommandLength> tempStore;
   111 
   112 	while (simLoadAppErr == KErrNone && index <= KNumSimLoadApps)
   113 		{
   114 		tempStore.Format(KSimLoadApp, index++);
   115 
   116 		simLoadAppErr = CreateTestProcessL(tempStore, EPriorityHigh);
   117 		}
   118 	}
   119 
   120 void CT_WServIntegStepSurface::CreatePseudoAppProcL()
   121 	{
   122 	TInt err;
   123 	err = CreateTestProcessL(KWServPseudoApp, EPriorityForeground);
   124 	TEST(err==KErrNone);
   125 	}
   126