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.
sl@0
     1
// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file
sl@0
    18
 @test
sl@0
    19
*/
sl@0
    20
sl@0
    21
#include "t_wservintegstepsurface.h"
sl@0
    22
#include "t_wservconsts.h"
sl@0
    23
#include <test/t_simload.h>
sl@0
    24
sl@0
    25
/**
sl@0
    26
 CT_WServIntegStepSurface constructor.
sl@0
    27
 @return N/A
sl@0
    28
 @pre None
sl@0
    29
 @post CT_WServIntegStepSurface 1st stage constructor
sl@0
    30
*/
sl@0
    31
CT_WServIntegStepSurface::CT_WServIntegStepSurface()
sl@0
    32
	{
sl@0
    33
	SetTestStepName(KT_WServIntegStepSurface);
sl@0
    34
	}
sl@0
    35
sl@0
    36
/**
sl@0
    37
Starts test step
sl@0
    38
@internalComponent
sl@0
    39
@return TVerdict pass / fail
sl@0
    40
@pre N/A
sl@0
    41
@post N/A
sl@0
    42
*/
sl@0
    43
enum TVerdict CT_WServIntegStepSurface::doTestStepL()
sl@0
    44
	{
sl@0
    45
	__UHEAP_MARK;
sl@0
    46
sl@0
    47
	PrintTestStepName();
sl@0
    48
sl@0
    49
	GetConfigDataL(KSimLoadData(), KSimLoadDataName());
sl@0
    50
	PrintConfigDataL(KSimLoadConfigFile());
sl@0
    51
	CreateSimLoadProcL();
sl@0
    52
	ClearConfigData();
sl@0
    53
sl@0
    54
	// Semaphore created here to maintain compatibility with DSA test use of t_app1
sl@0
    55
	RSemaphore dudSemaphore;
sl@0
    56
	User::LeaveIfError(dudSemaphore.CreateGlobal(KWservDsaSemaphoreName(), 0));
sl@0
    57
sl@0
    58
    GetConfigDataL(KTApp1Data(), KTApp1DataName());
sl@0
    59
	PrintConfigDataL(KWServTApp1ConfigFile());
sl@0
    60
	TInt err = CreateTestProcessL(KWServTApp1, EPriorityForeground);
sl@0
    61
	TEST(err==KErrNone);
sl@0
    62
	ClearConfigData();
sl@0
    63
sl@0
    64
	GetConfigDataL(KPseudoAppData(), KPseudoAppDataName());
sl@0
    65
	PrintConfigDataL(KWServPseudoAppConfigFile());
sl@0
    66
	CreatePseudoAppProcL();
sl@0
    67
	ClearConfigData();
sl@0
    68
sl@0
    69
	/***
sl@0
    70
	* Create a second process pseudoapp1.exe similar to pseudoapp.exe to test GCE
sl@0
    71
	* composing two independent surfaces at different frame rates
sl@0
    72
	*/
sl@0
    73
	TBool pseudoApp1=EFalse;
sl@0
    74
	if ( GetBoolFromConfig(ConfigSection(),KCreatePseudoApp1, pseudoApp1) )
sl@0
    75
		{
sl@0
    76
		if (pseudoApp1)
sl@0
    77
			{
sl@0
    78
			GetConfigDataL(KPseudoApp1Data(), KPseudoApp1DataName());
sl@0
    79
			PrintConfigDataL(KWServPseudoApp1ConfigFile());
sl@0
    80
			err=CreateTestProcessL(KWServPseudoApp1, EPriorityForeground);
sl@0
    81
			TEST(err==KErrNone);
sl@0
    82
			ClearConfigData();
sl@0
    83
sl@0
    84
			WaitForTestL(KWServPseudoApp1FinishFile());
sl@0
    85
sl@0
    86
			// retrieve results from pseudo app1
sl@0
    87
			CheckResultsL(KPseudoApp1ResultData(), KPseudoApp1ResultDataName(), KWServPseudoApp1ResultFile());
sl@0
    88
			PrintResultsL(KWServPseudoApp1ResultFile());
sl@0
    89
			}
sl@0
    90
		}
sl@0
    91
sl@0
    92
	WaitForTestL(KWServPseudoAppFinishFile());
sl@0
    93
sl@0
    94
	// retrieve results from pseudo app
sl@0
    95
	CheckResultsL(KPseudoAppResultData(), KPseudoAppResultDataName(), KWServPseudoAppResultFile());
sl@0
    96
	PrintResultsL(KWServPseudoAppResultFile());
sl@0
    97
sl@0
    98
	dudSemaphore.Close();
sl@0
    99
	CleanUp();
sl@0
   100
sl@0
   101
	__UHEAP_MARKEND;
sl@0
   102
sl@0
   103
	return TestStepResult();
sl@0
   104
	}
sl@0
   105
sl@0
   106
void CT_WServIntegStepSurface::CreateSimLoadProcL()
sl@0
   107
	{
sl@0
   108
	TInt simLoadAppErr = KErrNone;
sl@0
   109
	TInt index = 1;
sl@0
   110
	TBuf<KMaxTestExecuteCommandLength> tempStore;
sl@0
   111
sl@0
   112
	while (simLoadAppErr == KErrNone && index <= KNumSimLoadApps)
sl@0
   113
		{
sl@0
   114
		tempStore.Format(KSimLoadApp, index++);
sl@0
   115
sl@0
   116
		simLoadAppErr = CreateTestProcessL(tempStore, EPriorityHigh);
sl@0
   117
		}
sl@0
   118
	}
sl@0
   119
sl@0
   120
void CT_WServIntegStepSurface::CreatePseudoAppProcL()
sl@0
   121
	{
sl@0
   122
	TInt err;
sl@0
   123
	err = CreateTestProcessL(KWServPseudoApp, EPriorityForeground);
sl@0
   124
	TEST(err==KErrNone);
sl@0
   125
	}
sl@0
   126