sl@0
|
1 |
// Copyright (c) 1996-2009 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 |
// Test Direct Screen Access
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
#include "tdirecta.h"
|
sl@0
|
19 |
|
sl@0
|
20 |
static TRect WinExt;
|
sl@0
|
21 |
static TInt WinCol=0;
|
sl@0
|
22 |
static TTimeIntervalMicroSeconds32 MoveInterval;
|
sl@0
|
23 |
static TTimeIntervalMicroSeconds32 ModeInterval;
|
sl@0
|
24 |
static TTimeIntervalMicroSeconds32 FlipInterval;
|
sl@0
|
25 |
static TBool ImmediateModeSwitch;
|
sl@0
|
26 |
#if defined(LOGGING)
|
sl@0
|
27 |
LOCAL_D TLogMessageText LogMessageText;
|
sl@0
|
28 |
#endif
|
sl@0
|
29 |
|
sl@0
|
30 |
_LIT(SemControl,"Control");
|
sl@0
|
31 |
_LIT(SemNextOp,"TrigerWindow");
|
sl@0
|
32 |
_LIT(FontName,"DejaVu Serif Condensed");
|
sl@0
|
33 |
_LIT(QueueControl,"Queue");
|
sl@0
|
34 |
|
sl@0
|
35 |
LOCAL_D TSize FullScreenModeSize;
|
sl@0
|
36 |
LOCAL_D TInt Copy2ndHalfOfScreen;
|
sl@0
|
37 |
|
sl@0
|
38 |
const TBool KRegionTrackingOnly = ETrue;
|
sl@0
|
39 |
const TBool KDrawingDsa = EFalse;
|
sl@0
|
40 |
|
sl@0
|
41 |
const TInt KPanicTestOrdinalPriority=65536;
|
sl@0
|
42 |
const TInt KMainTestOrdinalPriority=65535;
|
sl@0
|
43 |
const TInt KMainTestBaseWindow=KMainTestOrdinalPriority/3;
|
sl@0
|
44 |
const TInt KAboveMainTestBaseWindow = KMainTestBaseWindow +1;
|
sl@0
|
45 |
|
sl@0
|
46 |
const TInt KMaxIdlingTime = 25; //used for RegionTrackingOnly DSAs, it represents the maximum number of times the Idling function can be called
|
sl@0
|
47 |
//Ids of two RegionTrackingOnly DSAs
|
sl@0
|
48 |
const TInt KRegionTrackingOnlyDsaWaitingForAbortSignal = 25;
|
sl@0
|
49 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
|
sl@0
|
50 |
const TInt KRegionTrackingOnlyDsaNoAbortSignal = 26;
|
sl@0
|
51 |
#endif
|
sl@0
|
52 |
|
sl@0
|
53 |
const TInt KRegionTrackingOnlyDsaExistLast = 0;
|
sl@0
|
54 |
const TInt KDrawingDsaExistLast = 1;
|
sl@0
|
55 |
const TInt KShortDelay = 5000;
|
sl@0
|
56 |
#define SHORT_DELAY TTimeIntervalMicroSeconds32(KShortDelay)
|
sl@0
|
57 |
|
sl@0
|
58 |
_LIT(KSem_DefectFix_KAA_5J3BLW_Name, "DefectFix_KAA_5J3BLW");
|
sl@0
|
59 |
|
sl@0
|
60 |
GLDEF_C TInt ProcDirect(TAny *aScreenNumber)
|
sl@0
|
61 |
{
|
sl@0
|
62 |
CTrapCleanup* cleanupStack = NULL;
|
sl@0
|
63 |
User::LeaveIfNull(cleanupStack = CTrapCleanup::New());
|
sl@0
|
64 |
|
sl@0
|
65 |
#if defined(LOGGING)
|
sl@0
|
66 |
_LIT(KWindow,"Window Toggle Vis=");
|
sl@0
|
67 |
_LIT(KParams,"%d, Pos=(%d,%d,%d,%d), Col=%d");
|
sl@0
|
68 |
#endif
|
sl@0
|
69 |
RSemaphore controlSem;
|
sl@0
|
70 |
RSemaphore windowSem;
|
sl@0
|
71 |
User::LeaveIfError(controlSem.OpenGlobal(SemControl));
|
sl@0
|
72 |
User::LeaveIfError(windowSem.OpenGlobal(SemNextOp));
|
sl@0
|
73 |
RWsSession ws;
|
sl@0
|
74 |
User::LeaveIfError(ws.Connect());
|
sl@0
|
75 |
|
sl@0
|
76 |
// assign to the correct screen
|
sl@0
|
77 |
CWsScreenDevice* screen = NULL;
|
sl@0
|
78 |
TInt err;
|
sl@0
|
79 |
TRAP(err, screen = new (ELeave) CWsScreenDevice(ws));
|
sl@0
|
80 |
if (err!=KErrNone)
|
sl@0
|
81 |
return err;
|
sl@0
|
82 |
|
sl@0
|
83 |
if ((err=screen->Construct((TInt)aScreenNumber))!=KErrNone)
|
sl@0
|
84 |
{
|
sl@0
|
85 |
delete screen;
|
sl@0
|
86 |
return err;
|
sl@0
|
87 |
}
|
sl@0
|
88 |
|
sl@0
|
89 |
RWindowGroup group(ws);
|
sl@0
|
90 |
User::LeaveIfError(group.Construct(898));
|
sl@0
|
91 |
group.EnableReceiptOfFocus(EFalse);
|
sl@0
|
92 |
group.SetOrdinalPosition(0,KAboveMainTestBaseWindow );
|
sl@0
|
93 |
RBlankWindow window(ws);
|
sl@0
|
94 |
User::LeaveIfError(window.Construct(group,899));
|
sl@0
|
95 |
TBool vis=EFalse;
|
sl@0
|
96 |
window.SetVisible(vis);
|
sl@0
|
97 |
window.Activate();
|
sl@0
|
98 |
ws.Flush();
|
sl@0
|
99 |
controlSem.Signal();
|
sl@0
|
100 |
windowSem.Wait();
|
sl@0
|
101 |
RMsgQueueBase queue;
|
sl@0
|
102 |
TInt open = queue.OpenGlobal(QueueControl);
|
sl@0
|
103 |
TInt data;
|
sl@0
|
104 |
while (queue.Receive(&data,sizeof(TInt)) != KErrNone)
|
sl@0
|
105 |
{
|
sl@0
|
106 |
vis=!vis;
|
sl@0
|
107 |
if (vis)
|
sl@0
|
108 |
{
|
sl@0
|
109 |
window.SetColor(TRgb::Gray4(WinCol));
|
sl@0
|
110 |
window.SetExtent(WinExt.iTl,WinExt.Size());
|
sl@0
|
111 |
#if defined(LOGGING)
|
sl@0
|
112 |
LogMessageText.Copy(KWindow);
|
sl@0
|
113 |
LogMessageText.AppendFormat(KParams,vis,WinExt.iTl.iX,WinExt.iTl.iY,WinExt.iBr.iX,WinExt.iBr.iY,WinCol);
|
sl@0
|
114 |
ws.LogMessage(LogMessageText);
|
sl@0
|
115 |
#endif
|
sl@0
|
116 |
}
|
sl@0
|
117 |
window.SetVisible(vis);
|
sl@0
|
118 |
ws.Flush();
|
sl@0
|
119 |
windowSem.Wait();
|
sl@0
|
120 |
}
|
sl@0
|
121 |
queue.Close();
|
sl@0
|
122 |
|
sl@0
|
123 |
window.Close();
|
sl@0
|
124 |
group.Close();
|
sl@0
|
125 |
|
sl@0
|
126 |
delete screen;
|
sl@0
|
127 |
ws.Close();
|
sl@0
|
128 |
controlSem.Close();
|
sl@0
|
129 |
windowSem.Close();
|
sl@0
|
130 |
|
sl@0
|
131 |
delete cleanupStack;
|
sl@0
|
132 |
return(KErrNone);
|
sl@0
|
133 |
}
|
sl@0
|
134 |
|
sl@0
|
135 |
|
sl@0
|
136 |
/*CDirectScreenAccessOld*/
|
sl@0
|
137 |
|
sl@0
|
138 |
CDirectScreenAccessOld* CDirectScreenAccessOld::NewL(RWsSession& aWs,MAbortDirectScreenAccess& aAborter)
|
sl@0
|
139 |
{
|
sl@0
|
140 |
CDirectScreenAccessOld* self=new(ELeave) CDirectScreenAccessOld(aWs,aAborter);
|
sl@0
|
141 |
CleanupStack::PushL(self);
|
sl@0
|
142 |
self->ConstructL();
|
sl@0
|
143 |
CleanupStack::Pop(self);
|
sl@0
|
144 |
return self;
|
sl@0
|
145 |
}
|
sl@0
|
146 |
|
sl@0
|
147 |
CDirectScreenAccessOld::~CDirectScreenAccessOld()
|
sl@0
|
148 |
{
|
sl@0
|
149 |
__ASSERT_ALWAYS(!iAborting,AutoPanic(EAutoPanicDirect));
|
sl@0
|
150 |
Cancel();
|
sl@0
|
151 |
iDirectAccess.Close();
|
sl@0
|
152 |
}
|
sl@0
|
153 |
|
sl@0
|
154 |
void CDirectScreenAccessOld::ConstructL()
|
sl@0
|
155 |
{
|
sl@0
|
156 |
User::LeaveIfError(iDirectAccess.Construct());
|
sl@0
|
157 |
CActiveScheduler::Add(this);
|
sl@0
|
158 |
}
|
sl@0
|
159 |
|
sl@0
|
160 |
TInt CDirectScreenAccessOld::Request(RRegion*& aRegion, RWindowBase& aWindow)
|
sl@0
|
161 |
{
|
sl@0
|
162 |
TInt ret=iDirectAccess.Request(aRegion,iStatus,aWindow);
|
sl@0
|
163 |
if (ret==KErrNone)
|
sl@0
|
164 |
SetActive();
|
sl@0
|
165 |
return ret;
|
sl@0
|
166 |
}
|
sl@0
|
167 |
|
sl@0
|
168 |
void CDirectScreenAccessOld::DoCancel()
|
sl@0
|
169 |
{
|
sl@0
|
170 |
iDirectAccess.Cancel();
|
sl@0
|
171 |
}
|
sl@0
|
172 |
|
sl@0
|
173 |
void CDirectScreenAccessOld::RunL()
|
sl@0
|
174 |
{
|
sl@0
|
175 |
iAborting=ETrue;
|
sl@0
|
176 |
iAborter.AbortNow(REINTERPRET_CAST(RDirectScreenAccess::TTerminationReasons&,iStatus));
|
sl@0
|
177 |
iAborting=EFalse;
|
sl@0
|
178 |
iDirectAccess.Completed();
|
sl@0
|
179 |
}
|
sl@0
|
180 |
|
sl@0
|
181 |
|
sl@0
|
182 |
/*CColorAnimation*/
|
sl@0
|
183 |
|
sl@0
|
184 |
CColorAnimation* CColorAnimation::NewL(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack,CTWinBase& aParent,TRect aExtent,TBool aStart,TBool aRegionTrackingOnly)
|
sl@0
|
185 |
{
|
sl@0
|
186 |
CColorAnimation* self=new(ELeave) CColorAnimation(aScreenNumber,aId,aCallBack);
|
sl@0
|
187 |
CleanupStack::PushL(self);
|
sl@0
|
188 |
self->ConstructL(aParent,aExtent,aRegionTrackingOnly);
|
sl@0
|
189 |
if (aStart)
|
sl@0
|
190 |
self->StartL();
|
sl@0
|
191 |
CleanupStack::Pop(self);
|
sl@0
|
192 |
return self;
|
sl@0
|
193 |
}
|
sl@0
|
194 |
|
sl@0
|
195 |
CColorAnimation::~CColorAnimation()
|
sl@0
|
196 |
{
|
sl@0
|
197 |
delete iTimer;
|
sl@0
|
198 |
delete iDrawer;
|
sl@0
|
199 |
delete iWindow;
|
sl@0
|
200 |
delete iWindow2;
|
sl@0
|
201 |
TheClient->Flush();
|
sl@0
|
202 |
}
|
sl@0
|
203 |
|
sl@0
|
204 |
void CColorAnimation::ConstructL(CTWinBase& aParent,TRect aExtent,TBool aRegionTrackingOnly,TInt aTypeWindow/*=0*/,TInt aSingleWinForMultipleDSA/*=0*/)
|
sl@0
|
205 |
{
|
sl@0
|
206 |
iRegionTrackingOnly = aRegionTrackingOnly;
|
sl@0
|
207 |
// Make sure that the top right corner is not 0,0
|
sl@0
|
208 |
if (aTypeWindow && aExtent.iTl==TPoint(0,0))
|
sl@0
|
209 |
{
|
sl@0
|
210 |
aExtent.iTl=TPoint(10,10);
|
sl@0
|
211 |
}
|
sl@0
|
212 |
RWindowBase* win=NULL;
|
sl@0
|
213 |
iSingleWinForMultipleDSA=aSingleWinForMultipleDSA;
|
sl@0
|
214 |
if (aSingleWinForMultipleDSA)
|
sl@0
|
215 |
{
|
sl@0
|
216 |
win=iCallBack.iCallBackWin->BaseWin();
|
sl@0
|
217 |
iWinSize=TheClient->iScreen->SizeInPixels();
|
sl@0
|
218 |
}
|
sl@0
|
219 |
else
|
sl@0
|
220 |
{
|
sl@0
|
221 |
iWindow=new(ELeave) CTBlankWindow();
|
sl@0
|
222 |
iWinSize=aExtent.Size();
|
sl@0
|
223 |
iWindow->ConstructExtLD(aParent,aExtent.iTl,iWinSize);
|
sl@0
|
224 |
ChangeModeL(iCallBack.DisplayMode(iId));
|
sl@0
|
225 |
win=iWindow->BaseWin();
|
sl@0
|
226 |
win->SetShadowDisabled(ETrue);
|
sl@0
|
227 |
win->Activate();
|
sl@0
|
228 |
}
|
sl@0
|
229 |
if (!aTypeWindow)
|
sl@0
|
230 |
{
|
sl@0
|
231 |
if(iRegionTrackingOnly)
|
sl@0
|
232 |
{
|
sl@0
|
233 |
iDrawer=CDirectScreenAccess::NewL(TheClient->iWs,*TheClient->iScreen,*win,*this,iRegionTrackingOnly);
|
sl@0
|
234 |
}
|
sl@0
|
235 |
else
|
sl@0
|
236 |
{
|
sl@0
|
237 |
//needed for the non NGA case: only the old API is allowed to be used
|
sl@0
|
238 |
iDrawer=CDirectScreenAccess::NewL(TheClient->iWs,*TheClient->iScreen,*win,*this);
|
sl@0
|
239 |
}
|
sl@0
|
240 |
}
|
sl@0
|
241 |
else
|
sl@0
|
242 |
{
|
sl@0
|
243 |
TRect childRect(0,0,100,100);
|
sl@0
|
244 |
switch(aTypeWindow)
|
sl@0
|
245 |
{
|
sl@0
|
246 |
case 1:
|
sl@0
|
247 |
{
|
sl@0
|
248 |
// Create a Blank Window smaller than it's parent and its top left corner within the parent area and withn the screen area
|
sl@0
|
249 |
childRect.Shrink(10,10);
|
sl@0
|
250 |
break;
|
sl@0
|
251 |
}
|
sl@0
|
252 |
case 2:
|
sl@0
|
253 |
{
|
sl@0
|
254 |
// Create a Blank Window with its top left corner being left side of its parent
|
sl@0
|
255 |
childRect.Move(-10,0);
|
sl@0
|
256 |
break;
|
sl@0
|
257 |
}
|
sl@0
|
258 |
}
|
sl@0
|
259 |
iWindow2=new(ELeave) CTBlankWindow();
|
sl@0
|
260 |
iWindow2->ConstructExtLD(*iWindow,childRect.iTl,childRect.Size());
|
sl@0
|
261 |
// Finish constructing the window
|
sl@0
|
262 |
RWindowBase& win=*iWindow2->BaseWin();
|
sl@0
|
263 |
win.SetShadowDisabled(ETrue);
|
sl@0
|
264 |
win.Activate();
|
sl@0
|
265 |
// Create the Direct Screen Access object
|
sl@0
|
266 |
if(iRegionTrackingOnly)
|
sl@0
|
267 |
{
|
sl@0
|
268 |
iDrawer=CDirectScreenAccess::NewL(TheClient->iWs,*TheClient->iScreen,win,*this,iRegionTrackingOnly);
|
sl@0
|
269 |
}
|
sl@0
|
270 |
else
|
sl@0
|
271 |
{
|
sl@0
|
272 |
//needed for the non NGA case: only the old API is allowed to be used
|
sl@0
|
273 |
iDrawer=CDirectScreenAccess::NewL(TheClient->iWs,*TheClient->iScreen,win,*this);
|
sl@0
|
274 |
}
|
sl@0
|
275 |
}
|
sl@0
|
276 |
TheClient->Flush();
|
sl@0
|
277 |
if (iId == 4)
|
sl@0
|
278 |
{
|
sl@0
|
279 |
// This clause is needed to prevent sub-test 9 from taking an
|
sl@0
|
280 |
// exceedingly large amount of time. The CColorAnimation with iId 4 is
|
sl@0
|
281 |
// the one which controls when the test stops. This raise in
|
sl@0
|
282 |
// priority compared to the other CColorAnimations, allows it's
|
sl@0
|
283 |
// callbacks to get through when otherwise they would take much longer
|
sl@0
|
284 |
// due to the volume of callbacks generated by the other
|
sl@0
|
285 |
// CColorAnimations
|
sl@0
|
286 |
iTimer=CPeriodic::NewL(1);
|
sl@0
|
287 |
}
|
sl@0
|
288 |
else
|
sl@0
|
289 |
{
|
sl@0
|
290 |
iTimer=CPeriodic::NewL(0);
|
sl@0
|
291 |
}
|
sl@0
|
292 |
}
|
sl@0
|
293 |
|
sl@0
|
294 |
TPoint CColorAnimation::AbsoluteWindowPosition(TInt aWindowId/*=0*/)
|
sl@0
|
295 |
{
|
sl@0
|
296 |
if (iSingleWinForMultipleDSA)
|
sl@0
|
297 |
{
|
sl@0
|
298 |
return iCallBack.iCallBackWin->BaseWin()->AbsPosition();
|
sl@0
|
299 |
}
|
sl@0
|
300 |
if (!aWindowId)
|
sl@0
|
301 |
{
|
sl@0
|
302 |
// Return the absolute position of iWindow, if Color Animation is not for Position Relative to Screen test.
|
sl@0
|
303 |
return iWindow->BaseWin()->AbsPosition();
|
sl@0
|
304 |
}
|
sl@0
|
305 |
else
|
sl@0
|
306 |
{
|
sl@0
|
307 |
// Return the absolute position of iWindow2, if it is for Position Relative to Screen test.
|
sl@0
|
308 |
return iWindow2->BaseWin()->AbsPosition();
|
sl@0
|
309 |
}
|
sl@0
|
310 |
}
|
sl@0
|
311 |
|
sl@0
|
312 |
TInt CColorAnimation::DrawColorL(TAny* aAnimation)
|
sl@0
|
313 |
{
|
sl@0
|
314 |
STATIC_CAST(CColorAnimation*,aAnimation)->DrawColorL();
|
sl@0
|
315 |
return(KErrNone);
|
sl@0
|
316 |
}
|
sl@0
|
317 |
|
sl@0
|
318 |
TInt CColorAnimation::IdlingL(TAny* aAnimation)
|
sl@0
|
319 |
{
|
sl@0
|
320 |
(static_cast<CColorAnimation*>(aAnimation))->IdlingL();
|
sl@0
|
321 |
return(KErrNone);
|
sl@0
|
322 |
}
|
sl@0
|
323 |
|
sl@0
|
324 |
void CColorAnimation::StartL(TBool aChildWindow/*=EFalse*/)
|
sl@0
|
325 |
{
|
sl@0
|
326 |
iDrawer->StartL();
|
sl@0
|
327 |
TRect bounding=iDrawer->DrawingRegion()->BoundingRect();
|
sl@0
|
328 |
TRect window;
|
sl@0
|
329 |
if (aChildWindow)
|
sl@0
|
330 |
{
|
sl@0
|
331 |
window.SetRect(AbsoluteWindowPosition(1),iWinSize);
|
sl@0
|
332 |
}
|
sl@0
|
333 |
else
|
sl@0
|
334 |
{
|
sl@0
|
335 |
window.SetRect(AbsoluteWindowPosition(),iWinSize);
|
sl@0
|
336 |
}
|
sl@0
|
337 |
// Check that the window contains the bounding area (a bounding rect of (0,0,0,0) shouldn't fail the test)
|
sl@0
|
338 |
if (!(window.Contains(bounding.iTl) && window.Contains(bounding.iBr-TPoint(1,1))) && bounding.Size()!=TSize(0,0))
|
sl@0
|
339 |
{
|
sl@0
|
340 |
iCallBack.Fail();
|
sl@0
|
341 |
// iDrawer->Cancel();
|
sl@0
|
342 |
// iDrawer->StartL();
|
sl@0
|
343 |
// bounding=iDrawer->DrawingRegion()->BoundingRect();
|
sl@0
|
344 |
}
|
sl@0
|
345 |
if(!iRegionTrackingOnly)
|
sl@0
|
346 |
{
|
sl@0
|
347 |
iTimer->Start(0,iCallBack.TimerInterval(iId),TCallBack(CColorAnimation::DrawColorL,this));
|
sl@0
|
348 |
iDrawer->Gc()->SetPenStyle(CGraphicsContext::ENullPen);
|
sl@0
|
349 |
iDrawer->Gc()->SetBrushStyle(CGraphicsContext::ESolidBrush);
|
sl@0
|
350 |
}
|
sl@0
|
351 |
else
|
sl@0
|
352 |
{
|
sl@0
|
353 |
iTimer->Start(0,iCallBack.TimerInterval(iId),TCallBack(CColorAnimation::IdlingL,this));
|
sl@0
|
354 |
}
|
sl@0
|
355 |
}
|
sl@0
|
356 |
|
sl@0
|
357 |
void CColorAnimation::StartOrPanic()
|
sl@0
|
358 |
{
|
sl@0
|
359 |
TRAPD(err,StartL());
|
sl@0
|
360 |
if (err!=KErrNone)
|
sl@0
|
361 |
{
|
sl@0
|
362 |
iCallBack.LogLeave(err);
|
sl@0
|
363 |
iCallBack.Fail();
|
sl@0
|
364 |
}
|
sl@0
|
365 |
}
|
sl@0
|
366 |
|
sl@0
|
367 |
void CColorAnimation::Stop()
|
sl@0
|
368 |
{
|
sl@0
|
369 |
iTimer->Cancel();
|
sl@0
|
370 |
iDrawer->Cancel();
|
sl@0
|
371 |
}
|
sl@0
|
372 |
|
sl@0
|
373 |
void CColorAnimation::BringWindowToFront()
|
sl@0
|
374 |
{
|
sl@0
|
375 |
iWindow->WinTreeNode()->SetOrdinalPosition(0);
|
sl@0
|
376 |
}
|
sl@0
|
377 |
|
sl@0
|
378 |
void CColorAnimation::ChangeModeL(TDisplayMode aMode)
|
sl@0
|
379 |
{
|
sl@0
|
380 |
User::LeaveIfError(iWindow->BaseWin()->SetRequiredDisplayMode(aMode));
|
sl@0
|
381 |
TheClient->Flush();
|
sl@0
|
382 |
}
|
sl@0
|
383 |
|
sl@0
|
384 |
void CColorAnimation::FinishTest()
|
sl@0
|
385 |
{
|
sl@0
|
386 |
iCallBack.Finished(iId);
|
sl@0
|
387 |
}
|
sl@0
|
388 |
|
sl@0
|
389 |
inline CDirectScreenAccess* CColorAnimation::GetDrawer()
|
sl@0
|
390 |
{
|
sl@0
|
391 |
return iDrawer;
|
sl@0
|
392 |
}
|
sl@0
|
393 |
|
sl@0
|
394 |
void CColorAnimation::DrawColorL()
|
sl@0
|
395 |
{
|
sl@0
|
396 |
TBool aFinished;
|
sl@0
|
397 |
iDrawer->Gc()->SetBrushColor(iCallBack.BrushColorL(iId,iColor,aFinished));
|
sl@0
|
398 |
if (iSingleWinForMultipleDSA==1)
|
sl@0
|
399 |
{
|
sl@0
|
400 |
iDrawer->Gc()->DrawRect(iWinSize-TSize(iWinSize.iWidth/2,iWinSize.iHeight/2));
|
sl@0
|
401 |
}
|
sl@0
|
402 |
else if (iSingleWinForMultipleDSA==2)
|
sl@0
|
403 |
{
|
sl@0
|
404 |
iDrawer->Gc()->DrawRect(TRect(TPoint(iWinSize.iWidth/2,iWinSize.iHeight/2),TSize(iWinSize.iWidth/2,iWinSize.iHeight/2)));
|
sl@0
|
405 |
}
|
sl@0
|
406 |
else
|
sl@0
|
407 |
{
|
sl@0
|
408 |
iDrawer->Gc()->DrawRect(iWinSize);
|
sl@0
|
409 |
}
|
sl@0
|
410 |
iDrawer->ScreenDevice()->Update();
|
sl@0
|
411 |
if (aFinished)
|
sl@0
|
412 |
{
|
sl@0
|
413 |
if (iId==1)
|
sl@0
|
414 |
{
|
sl@0
|
415 |
iWindow->SetSize(TSize(48,52));
|
sl@0
|
416 |
TheClient->Flush();
|
sl@0
|
417 |
}
|
sl@0
|
418 |
if (aFinished==1)
|
sl@0
|
419 |
Stop();
|
sl@0
|
420 |
iCallBack.Finished(iId);
|
sl@0
|
421 |
}
|
sl@0
|
422 |
}
|
sl@0
|
423 |
|
sl@0
|
424 |
void CColorAnimation::IdlingL()
|
sl@0
|
425 |
{
|
sl@0
|
426 |
iIdling++;
|
sl@0
|
427 |
if(iIdling == KMaxIdlingTime)
|
sl@0
|
428 |
{
|
sl@0
|
429 |
Stop();
|
sl@0
|
430 |
iIdling = 0;
|
sl@0
|
431 |
if (iId == KRegionTrackingOnlyDsaWaitingForAbortSignal)
|
sl@0
|
432 |
{
|
sl@0
|
433 |
_LIT(KErrorAbortNotReceived,"DSA didn't get an abort signal even though the window was opened in front");
|
sl@0
|
434 |
CallBack().Log((TText8*)__FILE__,__LINE__, ESevrErr,KErrorAbortNotReceived);
|
sl@0
|
435 |
CallBack().Fail();
|
sl@0
|
436 |
}
|
sl@0
|
437 |
iCallBack.Finished(iId);
|
sl@0
|
438 |
}
|
sl@0
|
439 |
}
|
sl@0
|
440 |
|
sl@0
|
441 |
void CColorAnimation::AbortNow(RDirectScreenAccess::TTerminationReasons /*aReason*/)
|
sl@0
|
442 |
{
|
sl@0
|
443 |
TInt slow=iCallBack.SlowStopping(iId,iCount);
|
sl@0
|
444 |
switch (slow)
|
sl@0
|
445 |
{
|
sl@0
|
446 |
case eAbortAll:
|
sl@0
|
447 |
iCallBack.Finished(iId);
|
sl@0
|
448 |
case eAbort:
|
sl@0
|
449 |
Stop();
|
sl@0
|
450 |
return;
|
sl@0
|
451 |
case eStopDelayed:
|
sl@0
|
452 |
User::After(750000); //0.75 secs
|
sl@0
|
453 |
break;
|
sl@0
|
454 |
default:;
|
sl@0
|
455 |
}
|
sl@0
|
456 |
++iCount;
|
sl@0
|
457 |
iTimer->Cancel();
|
sl@0
|
458 |
}
|
sl@0
|
459 |
|
sl@0
|
460 |
void CColorAnimation::Restart(RDirectScreenAccess::TTerminationReasons /*aReason*/)
|
sl@0
|
461 |
{
|
sl@0
|
462 |
TRAPD(err,StartL());
|
sl@0
|
463 |
if (err!=KErrNone)
|
sl@0
|
464 |
iCallBack.FailedReStart(iId,err);
|
sl@0
|
465 |
}
|
sl@0
|
466 |
|
sl@0
|
467 |
|
sl@0
|
468 |
/*CScrollingTextDrawer*/
|
sl@0
|
469 |
|
sl@0
|
470 |
CScrollingTextDrawer* CScrollingTextDrawer::NewL(TInt aScreenNumber,CFbsScreenDevice*& aDevice,CFbsBitGc& aGc)
|
sl@0
|
471 |
{
|
sl@0
|
472 |
CScrollingTextDrawer* self=new(ELeave) CScrollingTextDrawer(aDevice,aGc);
|
sl@0
|
473 |
CleanupStack::PushL(self);
|
sl@0
|
474 |
self->ConstructL(aScreenNumber);
|
sl@0
|
475 |
CleanupStack::Pop(self);
|
sl@0
|
476 |
return self;
|
sl@0
|
477 |
}
|
sl@0
|
478 |
|
sl@0
|
479 |
CScrollingTextDrawer::~CScrollingTextDrawer()
|
sl@0
|
480 |
{
|
sl@0
|
481 |
if(iFontDevice)
|
sl@0
|
482 |
{
|
sl@0
|
483 |
iFontDevice->ReleaseFont(iFont);
|
sl@0
|
484 |
delete iFontDevice;
|
sl@0
|
485 |
}
|
sl@0
|
486 |
}
|
sl@0
|
487 |
|
sl@0
|
488 |
void CScrollingTextDrawer::ConstructL(TInt aScreenNumber)
|
sl@0
|
489 |
{
|
sl@0
|
490 |
iFontDevice=CFbsScreenDevice::NewL(aScreenNumber,iDevice->DisplayMode());
|
sl@0
|
491 |
_LIT(text,"ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
sl@0
|
492 |
iText=text;
|
sl@0
|
493 |
CreateFontL();
|
sl@0
|
494 |
//iFirstChar=0;
|
sl@0
|
495 |
iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
|
sl@0
|
496 |
#if defined(LOGGING)
|
sl@0
|
497 |
iWs.Connect();
|
sl@0
|
498 |
// point to correct screen
|
sl@0
|
499 |
CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(iWs);
|
sl@0
|
500 |
CleanupStack::PushL(screen);
|
sl@0
|
501 |
User::LeaveIfError(screen->Construct(aScreenNumber));
|
sl@0
|
502 |
CleanupStack::Pop(screen);
|
sl@0
|
503 |
|
sl@0
|
504 |
_LIT(KConstTextDrawer,"Constructed Text Drawer");
|
sl@0
|
505 |
LogMessageText.Copy(KConstTextDrawer);
|
sl@0
|
506 |
iWs.LogMessage(LogMessageText);
|
sl@0
|
507 |
iWs.Flush();
|
sl@0
|
508 |
|
sl@0
|
509 |
delete screen;
|
sl@0
|
510 |
iWs.Close();
|
sl@0
|
511 |
#endif
|
sl@0
|
512 |
}
|
sl@0
|
513 |
|
sl@0
|
514 |
void CScrollingTextDrawer::CreateFontL()
|
sl@0
|
515 |
{
|
sl@0
|
516 |
TInt screenHeight=iDevice->SizeInPixels().iHeight;
|
sl@0
|
517 |
TFontSpec fontSpec(FontName,screenHeight);
|
sl@0
|
518 |
User::LeaveIfError(iFontDevice->GetNearestFontToDesignHeightInPixels(iFont,fontSpec));
|
sl@0
|
519 |
iGc->UseFont(iFont);
|
sl@0
|
520 |
TInt fontHeight=iFont->HeightInPixels();
|
sl@0
|
521 |
iDrawRect.iTl.iY=(screenHeight-fontHeight)/2;
|
sl@0
|
522 |
iDrawRect.iBr.iY=iDrawRect.iTl.iY+fontHeight;
|
sl@0
|
523 |
iDrawHeight=iFont->AscentInPixels();
|
sl@0
|
524 |
iCharWidth=iFont->CharWidthInPixels(iText[iFirstChar]);
|
sl@0
|
525 |
iDrawRect.iBr.iX=Max(iDevice->SizeInPixels().iWidth,iDevice->SizeInPixels().iHeight);
|
sl@0
|
526 |
iDrawRect.iTl.iX=iDrawRect.iBr.iX-iCharWidth;
|
sl@0
|
527 |
}
|
sl@0
|
528 |
|
sl@0
|
529 |
void CScrollingTextDrawer::SetBottomOfTest(TInt aBottom)
|
sl@0
|
530 |
{
|
sl@0
|
531 |
if (iDrawRect.iBr.iY>aBottom)
|
sl@0
|
532 |
{
|
sl@0
|
533 |
iDrawRect.iTl.iY-=iDrawRect.iBr.iY-aBottom;
|
sl@0
|
534 |
iDrawRect.iBr.iY=aBottom;
|
sl@0
|
535 |
}
|
sl@0
|
536 |
}
|
sl@0
|
537 |
|
sl@0
|
538 |
void CScrollingTextDrawer::Scroll()
|
sl@0
|
539 |
{
|
sl@0
|
540 |
iCharWidth=iFont->CharWidthInPixels(iText[iFirstChar]);
|
sl@0
|
541 |
iDrawRect.iTl.iX-=iJump;
|
sl@0
|
542 |
iGc->DrawText(iText.Mid(iFirstChar),iDrawRect,iDrawHeight);
|
sl@0
|
543 |
iDevice->Update();
|
sl@0
|
544 |
if (iDrawRect.iTl.iX<-iCharWidth)
|
sl@0
|
545 |
{
|
sl@0
|
546 |
if (++iFirstChar==iText.Length())
|
sl@0
|
547 |
{
|
sl@0
|
548 |
iFirstChar=0;
|
sl@0
|
549 |
iDrawRect.iTl.iX=iDevice->SizeInPixels().iWidth;
|
sl@0
|
550 |
}
|
sl@0
|
551 |
else
|
sl@0
|
552 |
iDrawRect.iTl.iX+=iCharWidth;
|
sl@0
|
553 |
iCharWidth=iFont->CharWidthInPixels(iText[iFirstChar]);
|
sl@0
|
554 |
}
|
sl@0
|
555 |
}
|
sl@0
|
556 |
|
sl@0
|
557 |
|
sl@0
|
558 |
/*CScrollText*/
|
sl@0
|
559 |
|
sl@0
|
560 |
TInt CScrollText::DrawText(TAny* aAnimation)
|
sl@0
|
561 |
{
|
sl@0
|
562 |
STATIC_CAST(CScrollText*,aAnimation)->ScrollText();
|
sl@0
|
563 |
return(KErrNone);
|
sl@0
|
564 |
}
|
sl@0
|
565 |
|
sl@0
|
566 |
CScrollText* CScrollText::NewL(TInt aScreenNumber,TInt aId,CTWindowGroup& aParent,TInt aScrollJump,TBool aStart/*=EFalse*/)
|
sl@0
|
567 |
{
|
sl@0
|
568 |
CScrollText* self=new(ELeave) CScrollText(aId,aScrollJump,aScreenNumber);
|
sl@0
|
569 |
CleanupStack::PushL(self);
|
sl@0
|
570 |
self->ConstructL(aParent);
|
sl@0
|
571 |
if (aStart)
|
sl@0
|
572 |
self->StartL();
|
sl@0
|
573 |
CleanupStack::Pop(self);
|
sl@0
|
574 |
return self;
|
sl@0
|
575 |
}
|
sl@0
|
576 |
|
sl@0
|
577 |
CScrollText::~CScrollText()
|
sl@0
|
578 |
{
|
sl@0
|
579 |
delete iTimer;
|
sl@0
|
580 |
delete iTextDraw;
|
sl@0
|
581 |
iTextDraw=NULL;
|
sl@0
|
582 |
delete iDrawer;
|
sl@0
|
583 |
delete iWindow;
|
sl@0
|
584 |
TheClient->Flush();
|
sl@0
|
585 |
}
|
sl@0
|
586 |
|
sl@0
|
587 |
void CScrollText::ConstructL(CTWindowGroup& aParent)
|
sl@0
|
588 |
{
|
sl@0
|
589 |
iWindow=new(ELeave) CTBlankWindow();
|
sl@0
|
590 |
iWindow->ConstructL(aParent);
|
sl@0
|
591 |
RWindowBase& win=*iWindow->BaseWin();
|
sl@0
|
592 |
win.Activate();
|
sl@0
|
593 |
iDrawer=CDirectScreenAccess::NewL(TheClient->iWs,*TheClient->iScreen,win,*this);
|
sl@0
|
594 |
TheClient->Flush();
|
sl@0
|
595 |
iTimer=CPeriodic::NewL(0);
|
sl@0
|
596 |
}
|
sl@0
|
597 |
|
sl@0
|
598 |
void CScrollText::StartL()
|
sl@0
|
599 |
{
|
sl@0
|
600 |
DoContinueL();
|
sl@0
|
601 |
iDrawer->Gc()->SetBrushStyle(CGraphicsContext::ESolidBrush);
|
sl@0
|
602 |
if (!iTextDraw)
|
sl@0
|
603 |
{
|
sl@0
|
604 |
iTextDraw=CScrollingTextDrawer::NewL(iScreenNumber,iDrawer->ScreenDevice(),*iDrawer->Gc());
|
sl@0
|
605 |
iTextDraw->SetScrollJump(iScrollJump);
|
sl@0
|
606 |
}
|
sl@0
|
607 |
}
|
sl@0
|
608 |
|
sl@0
|
609 |
void CScrollText::ContinueL()
|
sl@0
|
610 |
{
|
sl@0
|
611 |
DoContinueL();
|
sl@0
|
612 |
}
|
sl@0
|
613 |
|
sl@0
|
614 |
void CScrollText::DoContinueL()
|
sl@0
|
615 |
{
|
sl@0
|
616 |
iTimer->Start(0,10000,TCallBack(CScrollText::DrawText,this));
|
sl@0
|
617 |
|
sl@0
|
618 |
//0.01secs
|
sl@0
|
619 |
iDrawer->StartL();
|
sl@0
|
620 |
TRect bounding=iDrawer->DrawingRegion()->BoundingRect();
|
sl@0
|
621 |
#if defined(LOGGING)
|
sl@0
|
622 |
_LIT(KBoundRect,"Continue Scroll Text Rect=(%d,%d,%d,%d)");
|
sl@0
|
623 |
LogMessageText.Zero();
|
sl@0
|
624 |
LogMessageText.AppendFormat(KBoundRect,bounding.iTl.iX,bounding.iTl.iY,bounding.iBr.iX,bounding.iBr.iY);
|
sl@0
|
625 |
TheClient->iWs.LogMessage(LogMessageText);
|
sl@0
|
626 |
TheClient->Flush();
|
sl@0
|
627 |
#endif
|
sl@0
|
628 |
TRect window=TRect(iWindow->BaseWin()->AbsPosition(),iWindow->Size());
|
sl@0
|
629 |
if (!window.Contains(bounding.iTl) || !window.Contains(bounding.iBr-TPoint(1,1)))
|
sl@0
|
630 |
AutoPanic(EAutoPanicTestFailed);
|
sl@0
|
631 |
}
|
sl@0
|
632 |
|
sl@0
|
633 |
void CScrollText::Stop()
|
sl@0
|
634 |
{
|
sl@0
|
635 |
iTimer->Cancel();
|
sl@0
|
636 |
iDrawer->Cancel();
|
sl@0
|
637 |
}
|
sl@0
|
638 |
|
sl@0
|
639 |
void CScrollText::ScrollText()
|
sl@0
|
640 |
{
|
sl@0
|
641 |
iTextDraw->Scroll();
|
sl@0
|
642 |
}
|
sl@0
|
643 |
|
sl@0
|
644 |
void CScrollText::AbortNow(RDirectScreenAccess::TTerminationReasons aReason)
|
sl@0
|
645 |
{
|
sl@0
|
646 |
iTimer->Cancel();
|
sl@0
|
647 |
if (!iCounting)
|
sl@0
|
648 |
return;
|
sl@0
|
649 |
if (iAbortCountDown>0)
|
sl@0
|
650 |
--iAbortCountDown;
|
sl@0
|
651 |
else
|
sl@0
|
652 |
{
|
sl@0
|
653 |
if (aReason==RDirectScreenAccess::ETerminateRegion)
|
sl@0
|
654 |
{
|
sl@0
|
655 |
User::After(1500000); //1.5secs
|
sl@0
|
656 |
iAbortCountDown=7;
|
sl@0
|
657 |
}
|
sl@0
|
658 |
}
|
sl@0
|
659 |
}
|
sl@0
|
660 |
|
sl@0
|
661 |
void CScrollText::Restart(RDirectScreenAccess::TTerminationReasons /*aReason*/)
|
sl@0
|
662 |
//This function is pure virtual and so cannot have an 'L' at the end of it's name
|
sl@0
|
663 |
{
|
sl@0
|
664 |
ContinueL();
|
sl@0
|
665 |
}
|
sl@0
|
666 |
|
sl@0
|
667 |
/*CWindowWithChild*/
|
sl@0
|
668 |
|
sl@0
|
669 |
CWindowWithChild* CWindowWithChild::NewL(TInt aScreenNumber, CTWindowGroup& aParent,TBool aStart/*=EFalse*/)
|
sl@0
|
670 |
{
|
sl@0
|
671 |
CWindowWithChild* self=new(ELeave) CWindowWithChild(aScreenNumber);
|
sl@0
|
672 |
CleanupStack::PushL(self);
|
sl@0
|
673 |
self->ConstructL(aParent);
|
sl@0
|
674 |
if (aStart)
|
sl@0
|
675 |
self->StartL();
|
sl@0
|
676 |
CleanupStack::Pop(self);
|
sl@0
|
677 |
return self;
|
sl@0
|
678 |
}
|
sl@0
|
679 |
|
sl@0
|
680 |
CWindowWithChild::~CWindowWithChild()
|
sl@0
|
681 |
{
|
sl@0
|
682 |
delete iDrawer;
|
sl@0
|
683 |
delete iChildWindow;
|
sl@0
|
684 |
delete iWindow;
|
sl@0
|
685 |
TheClient->Flush();
|
sl@0
|
686 |
}
|
sl@0
|
687 |
|
sl@0
|
688 |
void CWindowWithChild::ConstructL(CTWindowGroup& aParent)
|
sl@0
|
689 |
{
|
sl@0
|
690 |
iWindow=new(ELeave) CTBlankWindow();
|
sl@0
|
691 |
iWindow->ConstructL(aParent);
|
sl@0
|
692 |
|
sl@0
|
693 |
iChildWindow = new(ELeave) CTWin();
|
sl@0
|
694 |
iChildWindow->ConstructWin(*iWindow);
|
sl@0
|
695 |
|
sl@0
|
696 |
iChildWindow->SetExt(TPoint(0,0), TSize(4,4));
|
sl@0
|
697 |
RWindowBase& cwin=*iChildWindow->BaseWin();
|
sl@0
|
698 |
cwin.Activate();
|
sl@0
|
699 |
|
sl@0
|
700 |
RWindowBase& win=*iWindow->BaseWin();
|
sl@0
|
701 |
win.Activate();
|
sl@0
|
702 |
|
sl@0
|
703 |
iDrawer=CDirectScreenAccess::NewL(TheClient->iWs,*TheClient->iScreen,win,*this);
|
sl@0
|
704 |
|
sl@0
|
705 |
TheClient->Flush();
|
sl@0
|
706 |
}
|
sl@0
|
707 |
|
sl@0
|
708 |
void CWindowWithChild::StartL()
|
sl@0
|
709 |
{
|
sl@0
|
710 |
DoContinueL();
|
sl@0
|
711 |
}
|
sl@0
|
712 |
|
sl@0
|
713 |
void CWindowWithChild::ContinueL()
|
sl@0
|
714 |
{
|
sl@0
|
715 |
DoContinueL();
|
sl@0
|
716 |
}
|
sl@0
|
717 |
|
sl@0
|
718 |
void CWindowWithChild::DoContinueL()
|
sl@0
|
719 |
{
|
sl@0
|
720 |
iDrawer->StartL();
|
sl@0
|
721 |
iRunning = ETrue;
|
sl@0
|
722 |
}
|
sl@0
|
723 |
|
sl@0
|
724 |
void CWindowWithChild::Stop()
|
sl@0
|
725 |
{
|
sl@0
|
726 |
iDrawer->Cancel();
|
sl@0
|
727 |
}
|
sl@0
|
728 |
|
sl@0
|
729 |
void CWindowWithChild::AbortNow(RDirectScreenAccess::TTerminationReasons /*aReason*/)
|
sl@0
|
730 |
{
|
sl@0
|
731 |
iRunning = EFalse;
|
sl@0
|
732 |
}
|
sl@0
|
733 |
|
sl@0
|
734 |
void CWindowWithChild::Restart(RDirectScreenAccess::TTerminationReasons /*aReason*/)
|
sl@0
|
735 |
//This function is pure virtual and so cannot have an 'L' at the end of it's name
|
sl@0
|
736 |
{
|
sl@0
|
737 |
ContinueL();
|
sl@0
|
738 |
}
|
sl@0
|
739 |
|
sl@0
|
740 |
void CWindowWithChild::PerformCoverageCalls()
|
sl@0
|
741 |
{
|
sl@0
|
742 |
//add coverage to commands with no/partial coverage
|
sl@0
|
743 |
RWindow& cwin=*iChildWindow->Win();
|
sl@0
|
744 |
TInt priority = 0;
|
sl@0
|
745 |
|
sl@0
|
746 |
cwin.SetPointerCapturePriority(priority);
|
sl@0
|
747 |
__ASSERT_ALWAYS(cwin.GetPointerCapturePriority()==priority, User::Invariant());
|
sl@0
|
748 |
cwin.ClaimPointerGrab(EFalse);
|
sl@0
|
749 |
cwin.EnableBackup(0);
|
sl@0
|
750 |
__ASSERT_ALWAYS(cwin.PrevSibling()==0, User::Invariant());
|
sl@0
|
751 |
cwin.Invalidate(TRect(0, 0, 10, 10));
|
sl@0
|
752 |
cwin.FadeBehind(ETrue);
|
sl@0
|
753 |
TheClient->Flush();
|
sl@0
|
754 |
// cover (empty) False condition in CWsWindow::SetFadeBehind
|
sl@0
|
755 |
cwin.FadeBehind(ETrue);
|
sl@0
|
756 |
TheClient->Flush();
|
sl@0
|
757 |
}
|
sl@0
|
758 |
|
sl@0
|
759 |
/*CWsBase*/
|
sl@0
|
760 |
|
sl@0
|
761 |
void CWsBase::ConstructL(TInt aScreenNumber, TInt aHandle)
|
sl@0
|
762 |
{
|
sl@0
|
763 |
User::LeaveIfError(iWs.Connect());
|
sl@0
|
764 |
iScrDev=new(ELeave) CWsScreenDevice(iWs);
|
sl@0
|
765 |
User::LeaveIfError(iScrDev->Construct(aScreenNumber));
|
sl@0
|
766 |
iGroup=RWindowGroup(iWs);
|
sl@0
|
767 |
User::LeaveIfError(iGroup.Construct(aHandle,EFalse));
|
sl@0
|
768 |
iGroup.SetOrdinalPosition(0,KMainTestBaseWindow);
|
sl@0
|
769 |
}
|
sl@0
|
770 |
|
sl@0
|
771 |
void CWsBase::CreateBlankWindowL(RBlankWindow& iWin,TInt aHandle)
|
sl@0
|
772 |
{
|
sl@0
|
773 |
iWin=RBlankWindow(iWs);
|
sl@0
|
774 |
User::LeaveIfError(iWin.Construct(iGroup,aHandle));
|
sl@0
|
775 |
}
|
sl@0
|
776 |
|
sl@0
|
777 |
CWsBase::~CWsBase()
|
sl@0
|
778 |
{
|
sl@0
|
779 |
iGroup.Close();
|
sl@0
|
780 |
delete iScrDev;
|
sl@0
|
781 |
iWs.Close();
|
sl@0
|
782 |
}
|
sl@0
|
783 |
|
sl@0
|
784 |
|
sl@0
|
785 |
/*CAnimating*/
|
sl@0
|
786 |
|
sl@0
|
787 |
TInt CAnimating::StartLC(TAny* aScreenNumber)
|
sl@0
|
788 |
{
|
sl@0
|
789 |
CAnimating* self=new(ELeave) CAnimating();
|
sl@0
|
790 |
CleanupStack::PushL(self);
|
sl@0
|
791 |
self->ConstructL((TInt)aScreenNumber);
|
sl@0
|
792 |
return KErrNone;
|
sl@0
|
793 |
}
|
sl@0
|
794 |
|
sl@0
|
795 |
void CAnimating::ConstructL(TInt aScreenNumber)
|
sl@0
|
796 |
{
|
sl@0
|
797 |
CWsBase::ConstructL(aScreenNumber,798);
|
sl@0
|
798 |
#if defined(LOGGING)
|
sl@0
|
799 |
_LIT(KAnimate1,"Constructed CWsBase");
|
sl@0
|
800 |
LogMessageText.Copy(KAnimate1);
|
sl@0
|
801 |
iWs.LogMessage(LogMessageText);
|
sl@0
|
802 |
iWs.Flush();
|
sl@0
|
803 |
#endif
|
sl@0
|
804 |
iGroup.EnableReceiptOfFocus(EFalse);
|
sl@0
|
805 |
CreateBlankWindowL(iWindow,799);
|
sl@0
|
806 |
User::LeaveIfError(iWindow.SetRequiredDisplayMode(EGray16));
|
sl@0
|
807 |
iWindow.Activate();
|
sl@0
|
808 |
#if defined(LOGGING)
|
sl@0
|
809 |
_LIT(KAnimate2,"Set up Windows");
|
sl@0
|
810 |
LogMessageText.Copy(KAnimate2);
|
sl@0
|
811 |
iWs.LogMessage(LogMessageText);
|
sl@0
|
812 |
#endif
|
sl@0
|
813 |
iWs.Flush();
|
sl@0
|
814 |
TDisplayMode displayMode=CWsBase::iScrDev->DisplayMode();
|
sl@0
|
815 |
if (displayMode<EGray16)
|
sl@0
|
816 |
displayMode=EGray16;
|
sl@0
|
817 |
iScrDev=CFbsScreenDevice::NewL(aScreenNumber,displayMode);
|
sl@0
|
818 |
User::LeaveIfError(iScrDev->CreateContext(iGc));
|
sl@0
|
819 |
#if defined(LOGGING)
|
sl@0
|
820 |
_LIT(KAnimate3,"Created Screen Device");
|
sl@0
|
821 |
LogMessageText.Copy(KAnimate3);
|
sl@0
|
822 |
iWs.LogMessage(LogMessageText);
|
sl@0
|
823 |
iWs.Flush();
|
sl@0
|
824 |
#endif
|
sl@0
|
825 |
iDirect=CDirectScreenAccessOld::NewL(iWs,*this);
|
sl@0
|
826 |
iTimer=CPeriodic::NewL(0);
|
sl@0
|
827 |
User::LeaveIfError(iControlSem.OpenGlobal(SemControl,EOwnerThread)); //Must be thread relative, since it won't get cleaned up when the thread is killed otherwise
|
sl@0
|
828 |
User::LeaveIfError(iControlQueue.OpenGlobal(QueueControl,EOwnerThread)); //Must be thread relative, since it won't get cleaned up when the thread is killed otherwise
|
sl@0
|
829 |
iSemCreated=ETrue;
|
sl@0
|
830 |
#if defined(LOGGING)
|
sl@0
|
831 |
_LIT(KAnimate5,"Created Direct, Timer and Semaphore");
|
sl@0
|
832 |
LogMessageText.Copy(KAnimate5);
|
sl@0
|
833 |
iWs.LogMessage(LogMessageText);
|
sl@0
|
834 |
iWs.Flush();
|
sl@0
|
835 |
#endif
|
sl@0
|
836 |
iScrSize=iScrDev->SizeInPixels();
|
sl@0
|
837 |
iGc->SetPenStyle(CGraphicsContext::ENullPen);
|
sl@0
|
838 |
iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
|
sl@0
|
839 |
StartAnimatingL();
|
sl@0
|
840 |
#if defined(LOGGING)
|
sl@0
|
841 |
_LIT(KAnimate6,"Started Animation");
|
sl@0
|
842 |
LogMessageText.Copy(KAnimate6);
|
sl@0
|
843 |
iWs.LogMessage(LogMessageText);
|
sl@0
|
844 |
iWs.Flush();
|
sl@0
|
845 |
#endif
|
sl@0
|
846 |
}
|
sl@0
|
847 |
|
sl@0
|
848 |
CAnimating::~CAnimating()
|
sl@0
|
849 |
//This function should never actually get run in practice
|
sl@0
|
850 |
{
|
sl@0
|
851 |
if (iSemCreated)
|
sl@0
|
852 |
{
|
sl@0
|
853 |
iControlSem.Close();
|
sl@0
|
854 |
iControlQueue.Close();
|
sl@0
|
855 |
}
|
sl@0
|
856 |
if (iDrawingRegion)
|
sl@0
|
857 |
iDrawingRegion->Destroy();
|
sl@0
|
858 |
delete iTimer;
|
sl@0
|
859 |
delete iDirect;
|
sl@0
|
860 |
delete iGc;
|
sl@0
|
861 |
delete iScrDev;
|
sl@0
|
862 |
iWindow.Close();
|
sl@0
|
863 |
}
|
sl@0
|
864 |
|
sl@0
|
865 |
void CAnimating::AbortNow(RDirectScreenAccess::TTerminationReasons /*aReason*/)
|
sl@0
|
866 |
{
|
sl@0
|
867 |
iTimer->Cancel();
|
sl@0
|
868 |
iControlSem.Signal();
|
sl@0
|
869 |
TInt data = 2;
|
sl@0
|
870 |
iControlQueue.Send(&data,sizeof(TInt));
|
sl@0
|
871 |
User::After(10000000); //10 secs
|
sl@0
|
872 |
}
|
sl@0
|
873 |
|
sl@0
|
874 |
TInt NextColor(TAny* aAnimation)
|
sl@0
|
875 |
{
|
sl@0
|
876 |
STATIC_CAST(CAnimating*,aAnimation)->DrawFrame();
|
sl@0
|
877 |
return(KErrNone);
|
sl@0
|
878 |
}
|
sl@0
|
879 |
|
sl@0
|
880 |
void CAnimating::DrawFrame()
|
sl@0
|
881 |
{
|
sl@0
|
882 |
iColor=(iColor+3)%16;
|
sl@0
|
883 |
iGc->SetBrushColor(TRgb::Gray16(iColor));
|
sl@0
|
884 |
iGc->DrawRect(iScrSize);
|
sl@0
|
885 |
iScrDev->Update();
|
sl@0
|
886 |
if (iColor==2)
|
sl@0
|
887 |
{
|
sl@0
|
888 |
iControlSem.Signal();
|
sl@0
|
889 |
TInt data = 1;
|
sl@0
|
890 |
iControlQueue.Send(&data,sizeof(TInt));
|
sl@0
|
891 |
}
|
sl@0
|
892 |
}
|
sl@0
|
893 |
|
sl@0
|
894 |
void CAnimating::StartAnimatingL()
|
sl@0
|
895 |
{
|
sl@0
|
896 |
iTimer->Start(0,150000,TCallBack(NextColor,this)); //0.15 secs
|
sl@0
|
897 |
|
sl@0
|
898 |
User::LeaveIfError(iDirect->Request(iDrawingRegion,iWindow));
|
sl@0
|
899 |
iGc->SetClippingRegion(iDrawingRegion);
|
sl@0
|
900 |
}
|
sl@0
|
901 |
|
sl@0
|
902 |
|
sl@0
|
903 |
/*CMoveWindow*/
|
sl@0
|
904 |
|
sl@0
|
905 |
TInt CMoveWindow::StartLC(TAny* aScreenNumber)
|
sl@0
|
906 |
{
|
sl@0
|
907 |
CMoveWindow* self=new(ELeave) CMoveWindow();
|
sl@0
|
908 |
CleanupStack::PushL(self);
|
sl@0
|
909 |
self->ConstructL((TInt)aScreenNumber);
|
sl@0
|
910 |
return KErrNone;
|
sl@0
|
911 |
}
|
sl@0
|
912 |
|
sl@0
|
913 |
TInt CMoveWindow::FlipChange(TAny* aMoveWin)
|
sl@0
|
914 |
{
|
sl@0
|
915 |
Cast(aMoveWin)->FlipChange();
|
sl@0
|
916 |
return(KErrNone);
|
sl@0
|
917 |
}
|
sl@0
|
918 |
|
sl@0
|
919 |
TInt CMoveWindow::StateChange(TAny* aMoveWin)
|
sl@0
|
920 |
{
|
sl@0
|
921 |
Cast(aMoveWin)->StateChange();
|
sl@0
|
922 |
return(KErrNone);
|
sl@0
|
923 |
}
|
sl@0
|
924 |
|
sl@0
|
925 |
CMoveWindow::~CMoveWindow()
|
sl@0
|
926 |
{
|
sl@0
|
927 |
delete iStateTimer;
|
sl@0
|
928 |
delete iTimer;
|
sl@0
|
929 |
iWindow.Close();
|
sl@0
|
930 |
iBackUpWin.Close();
|
sl@0
|
931 |
delete iGc;
|
sl@0
|
932 |
}
|
sl@0
|
933 |
|
sl@0
|
934 |
TInt MoveWin(TAny* aMoveWin)
|
sl@0
|
935 |
{
|
sl@0
|
936 |
STATIC_CAST(CMoveWindow*,aMoveWin)->MoveWindow();
|
sl@0
|
937 |
return(KErrNone);
|
sl@0
|
938 |
}
|
sl@0
|
939 |
|
sl@0
|
940 |
void CMoveWindow::ConstructL(TInt aScreenNumber)
|
sl@0
|
941 |
{
|
sl@0
|
942 |
CWsBase::ConstructL(aScreenNumber,898);
|
sl@0
|
943 |
iBounceArea=TRect(iScrDev->SizeInPixels());
|
sl@0
|
944 |
iSize.iHeight=iBounceArea.iBr.iY/5;
|
sl@0
|
945 |
iSize.iWidth=iBounceArea.iBr.iX/5;
|
sl@0
|
946 |
iBounceArea.iTl.iX=iBounceArea.iBr.iX/6;
|
sl@0
|
947 |
iBounceArea.iBr.iX=5*iBounceArea.iBr.iX/6;
|
sl@0
|
948 |
iBounceArea.iTl.iY=iBounceArea.iBr.iY/4;
|
sl@0
|
949 |
iBounceArea.iBr.iY=3*iBounceArea.iBr.iY/4;
|
sl@0
|
950 |
iDelta=TSize(3,3);
|
sl@0
|
951 |
iTl=iBounceArea.iTl;
|
sl@0
|
952 |
CreateBlankWindowL(iWindow,899);
|
sl@0
|
953 |
iWindow.SetExtent(iTl,iSize);
|
sl@0
|
954 |
iWindow.SetShadowDisabled(ETrue);
|
sl@0
|
955 |
iWindow.SetColor(TRgb::Gray4(2));
|
sl@0
|
956 |
iWindow.Activate();
|
sl@0
|
957 |
iBackUpWin=RBackedUpWindow(iWs);
|
sl@0
|
958 |
User::LeaveIfError(iBackUpWin.Construct(iGroup,EGray4,698));
|
sl@0
|
959 |
User::LeaveIfError(iBackUpWin.SetSizeErr(TSize(2,2)));
|
sl@0
|
960 |
iGc=new(ELeave) CWindowGc(iScrDev);
|
sl@0
|
961 |
User::LeaveIfError(iGc->Construct());
|
sl@0
|
962 |
iDisplayMode=EGray4;
|
sl@0
|
963 |
if (MoveInterval>TTimeIntervalMicroSeconds32(0))
|
sl@0
|
964 |
CreateTimerL();
|
sl@0
|
965 |
if (ModeInterval>TTimeIntervalMicroSeconds32(0))
|
sl@0
|
966 |
{
|
sl@0
|
967 |
iStateTimer=CPeriodic::NewL(0);
|
sl@0
|
968 |
iStateTimer->Start(ModeInterval,ModeInterval,TCallBack(CMoveWindow::StateChange,this));
|
sl@0
|
969 |
}
|
sl@0
|
970 |
if (FlipInterval>TTimeIntervalMicroSeconds32(0))
|
sl@0
|
971 |
{
|
sl@0
|
972 |
iDevice=new(ELeave) CWsScreenDevice(iWs);
|
sl@0
|
973 |
User::LeaveIfError(iDevice->Construct(aScreenNumber));
|
sl@0
|
974 |
iNumOfModes=iDevice->NumScreenModes();
|
sl@0
|
975 |
if (iNumOfModes>1)
|
sl@0
|
976 |
{
|
sl@0
|
977 |
iFlipTimer=CPeriodic::NewL(0);
|
sl@0
|
978 |
iFlipTimer->Start(FlipInterval,FlipInterval,TCallBack(CMoveWindow::FlipChange,this));
|
sl@0
|
979 |
}
|
sl@0
|
980 |
}
|
sl@0
|
981 |
iStateCountDown=0;
|
sl@0
|
982 |
}
|
sl@0
|
983 |
|
sl@0
|
984 |
void CMoveWindow::CreateTimerL()
|
sl@0
|
985 |
{
|
sl@0
|
986 |
iTimer=CPeriodic::NewL(0);
|
sl@0
|
987 |
iTimer->Start(0,MoveInterval,TCallBack(MoveWin,this));
|
sl@0
|
988 |
|
sl@0
|
989 |
}
|
sl@0
|
990 |
|
sl@0
|
991 |
void CMoveWindow::MoveWindow()
|
sl@0
|
992 |
{
|
sl@0
|
993 |
if (--iStateCountDown>=0)
|
sl@0
|
994 |
{
|
sl@0
|
995 |
if (iStateCountDown==2)
|
sl@0
|
996 |
ToggleDisplayMode();
|
sl@0
|
997 |
return;
|
sl@0
|
998 |
}
|
sl@0
|
999 |
TPoint iBr=iTl+iSize;
|
sl@0
|
1000 |
TSize iDeltaSize;
|
sl@0
|
1001 |
if ((iDelta.iHeight<0 && iTl.iY<=iBounceArea.iTl.iY) || (iDelta.iHeight>0 && iBr.iY>=iBounceArea.iBr.iY))
|
sl@0
|
1002 |
{
|
sl@0
|
1003 |
iDelta.iHeight=-iDelta.iHeight;
|
sl@0
|
1004 |
iDeltaSize.iWidth=2;
|
sl@0
|
1005 |
}
|
sl@0
|
1006 |
if ((iDelta.iWidth<0 && iTl.iX<=iBounceArea.iTl.iX) || (iDelta.iWidth>0 && iBr.iX>=iBounceArea.iBr.iX))
|
sl@0
|
1007 |
{
|
sl@0
|
1008 |
iDelta.iWidth=-iDelta.iWidth;
|
sl@0
|
1009 |
if (iDeltaSize.iWidth==0)
|
sl@0
|
1010 |
iDeltaSize.iHeight=2;
|
sl@0
|
1011 |
else
|
sl@0
|
1012 |
iDeltaSize.iWidth=0;
|
sl@0
|
1013 |
}
|
sl@0
|
1014 |
iTl+=iDelta;
|
sl@0
|
1015 |
iSize+=iDeltaSize;
|
sl@0
|
1016 |
iWindow.SetExtent(iTl,iSize);
|
sl@0
|
1017 |
iWs.Flush();
|
sl@0
|
1018 |
}
|
sl@0
|
1019 |
|
sl@0
|
1020 |
void CMoveWindow::StateChange()
|
sl@0
|
1021 |
{
|
sl@0
|
1022 |
if (ImmediateModeSwitch>1)
|
sl@0
|
1023 |
{
|
sl@0
|
1024 |
if (MoveInterval>TTimeIntervalMicroSeconds32(0) && iTimer==NULL)
|
sl@0
|
1025 |
{
|
sl@0
|
1026 |
TRAPD(err,CreateTimerL());
|
sl@0
|
1027 |
if (err==KErrNone)
|
sl@0
|
1028 |
ImmediateModeSwitch=ETrue;
|
sl@0
|
1029 |
}
|
sl@0
|
1030 |
}
|
sl@0
|
1031 |
if (ImmediateModeSwitch || MoveInterval==TTimeIntervalMicroSeconds32(0))
|
sl@0
|
1032 |
ToggleDisplayMode();
|
sl@0
|
1033 |
else
|
sl@0
|
1034 |
{
|
sl@0
|
1035 |
if (iStateCountDown<-8)
|
sl@0
|
1036 |
iStateCountDown=6;
|
sl@0
|
1037 |
}
|
sl@0
|
1038 |
}
|
sl@0
|
1039 |
|
sl@0
|
1040 |
void CMoveWindow::ToggleDisplayMode()
|
sl@0
|
1041 |
{
|
sl@0
|
1042 |
if(iDisplayMode==EColor16MU)
|
sl@0
|
1043 |
{
|
sl@0
|
1044 |
return; //Test probably doesn't work with mode EColor16MU
|
sl@0
|
1045 |
}
|
sl@0
|
1046 |
iDisplayMode=(iDisplayMode==EColor16M ? EGray4:EColor16M);
|
sl@0
|
1047 |
#if defined(LOGGING)
|
sl@0
|
1048 |
TInt newMode=
|
sl@0
|
1049 |
#endif
|
sl@0
|
1050 |
iWindow.SetRequiredDisplayMode(iDisplayMode);
|
sl@0
|
1051 |
iGc->Activate(iBackUpWin);
|
sl@0
|
1052 |
iBackUpWin.SetPosition(iDisplayMode==EColor16M ? TPoint(1,0):TPoint(0,1));
|
sl@0
|
1053 |
#if defined(LOGGING)
|
sl@0
|
1054 |
TDisplayMode curentMode=iScrDev->DisplayMode();
|
sl@0
|
1055 |
_LIT(KToggleMode,"Toggle Display Mode Mode=%d Window=%d Actual=%d");
|
sl@0
|
1056 |
LogMessageText.Zero();
|
sl@0
|
1057 |
LogMessageText.AppendFormat(KToggleMode,(TInt&)iDisplayMode,newMode,(TInt&)curentMode);
|
sl@0
|
1058 |
iWs.LogMessage(LogMessageText);
|
sl@0
|
1059 |
//iWs.LogCommand(RWsSession::ELoggingStatusDump);
|
sl@0
|
1060 |
#endif
|
sl@0
|
1061 |
iWs.Flush();
|
sl@0
|
1062 |
iGc->Deactivate();
|
sl@0
|
1063 |
}
|
sl@0
|
1064 |
|
sl@0
|
1065 |
void CMoveWindow::FlipChange()
|
sl@0
|
1066 |
{
|
sl@0
|
1067 |
if (++iCurrentMode==2) //flip between modes 0 and 1
|
sl@0
|
1068 |
iCurrentMode=0;
|
sl@0
|
1069 |
iDevice->SetScreenMode(iCurrentMode);
|
sl@0
|
1070 |
iWs.Flush();
|
sl@0
|
1071 |
}
|
sl@0
|
1072 |
|
sl@0
|
1073 |
//
|
sl@0
|
1074 |
// CBugFixColorAnimation
|
sl@0
|
1075 |
//
|
sl@0
|
1076 |
// This class is used for reproducing a defect found on 6.1: KAA-5J3BLW "Unnecessary Wserv's DSA abort".
|
sl@0
|
1077 |
// The problem was that a direct screen access client was getting an unnecessary abort notification
|
sl@0
|
1078 |
// when a new window (or window group) was created but not visible.
|
sl@0
|
1079 |
// This class will simulate the direct screen access client and it will check whether the first DSA abort
|
sl@0
|
1080 |
// is not caused by just creating a window.
|
sl@0
|
1081 |
|
sl@0
|
1082 |
CBugFixColorAnimation* CBugFixColorAnimation::NewL(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack,CTWindowGroup& aParent,TRect aExtent,TBool aStart)
|
sl@0
|
1083 |
{
|
sl@0
|
1084 |
CBugFixColorAnimation* self=new(ELeave) CBugFixColorAnimation(aScreenNumber, aId,aCallBack);
|
sl@0
|
1085 |
CleanupStack::PushL(self);
|
sl@0
|
1086 |
self->ConstructL(aParent,aExtent);
|
sl@0
|
1087 |
if (aStart)
|
sl@0
|
1088 |
{
|
sl@0
|
1089 |
self->StartL();
|
sl@0
|
1090 |
self->Started();
|
sl@0
|
1091 |
}
|
sl@0
|
1092 |
CleanupStack::Pop(self);
|
sl@0
|
1093 |
return self;
|
sl@0
|
1094 |
}
|
sl@0
|
1095 |
|
sl@0
|
1096 |
CBugFixColorAnimation::CBugFixColorAnimation(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack)
|
sl@0
|
1097 |
: CColorAnimation(aScreenNumber, aId, aCallBack)
|
sl@0
|
1098 |
{
|
sl@0
|
1099 |
iThreadParam.iScreenNumber = aScreenNumber;
|
sl@0
|
1100 |
}
|
sl@0
|
1101 |
|
sl@0
|
1102 |
CBugFixColorAnimation::~CBugFixColorAnimation()
|
sl@0
|
1103 |
{
|
sl@0
|
1104 |
iSem.Close();
|
sl@0
|
1105 |
if(iThread)
|
sl@0
|
1106 |
{
|
sl@0
|
1107 |
TRequestStatus status;
|
sl@0
|
1108 |
iThread->Logon(status);
|
sl@0
|
1109 |
if (iThread->StillAlive())
|
sl@0
|
1110 |
{
|
sl@0
|
1111 |
iThread->Terminate(KErrNone);
|
sl@0
|
1112 |
User::WaitForRequest(status);
|
sl@0
|
1113 |
}
|
sl@0
|
1114 |
delete iThread;
|
sl@0
|
1115 |
}
|
sl@0
|
1116 |
iTestFailed->Cancel();
|
sl@0
|
1117 |
delete iTestFailed;
|
sl@0
|
1118 |
}
|
sl@0
|
1119 |
|
sl@0
|
1120 |
|
sl@0
|
1121 |
LOCAL_D TInt TestFailed(TAny* aAnimation)
|
sl@0
|
1122 |
{
|
sl@0
|
1123 |
CBugFixColorAnimation* anim=reinterpret_cast<CBugFixColorAnimation*>(aAnimation);
|
sl@0
|
1124 |
TRAP_IGNORE(
|
sl@0
|
1125 |
anim->Stop();
|
sl@0
|
1126 |
anim->CallBack().Fail();
|
sl@0
|
1127 |
anim->FinishTest();
|
sl@0
|
1128 |
);
|
sl@0
|
1129 |
return KErrNone;
|
sl@0
|
1130 |
}
|
sl@0
|
1131 |
|
sl@0
|
1132 |
LOCAL_D TInt CreateNewWindowGroup(TAny* aParam)
|
sl@0
|
1133 |
{
|
sl@0
|
1134 |
TDirectThreadParam* param = (TDirectThreadParam*)aParam;
|
sl@0
|
1135 |
TRect rect = param->iRect;
|
sl@0
|
1136 |
TBool isInFront = param->iIsInFront;
|
sl@0
|
1137 |
RWsSession ws;
|
sl@0
|
1138 |
TInt error=ws.Connect();
|
sl@0
|
1139 |
|
sl@0
|
1140 |
CWsScreenDevice* screen = NULL;
|
sl@0
|
1141 |
TRAP(error, screen = new (ELeave) CWsScreenDevice(ws));
|
sl@0
|
1142 |
if (error!=KErrNone)
|
sl@0
|
1143 |
{
|
sl@0
|
1144 |
ws.Close();
|
sl@0
|
1145 |
RThread::Rendezvous(error);
|
sl@0
|
1146 |
return error;
|
sl@0
|
1147 |
}
|
sl@0
|
1148 |
|
sl@0
|
1149 |
if ((error=screen->Construct(param->iScreenNumber))!=KErrNone)
|
sl@0
|
1150 |
{
|
sl@0
|
1151 |
delete screen;
|
sl@0
|
1152 |
ws.Close();
|
sl@0
|
1153 |
RThread::Rendezvous(error);
|
sl@0
|
1154 |
return error;
|
sl@0
|
1155 |
}
|
sl@0
|
1156 |
RSemaphore sem;
|
sl@0
|
1157 |
error = sem.OpenGlobal(KSem_DefectFix_KAA_5J3BLW_Name, EOwnerThread);
|
sl@0
|
1158 |
if (error!=KErrNone)
|
sl@0
|
1159 |
{
|
sl@0
|
1160 |
ws.Close();
|
sl@0
|
1161 |
RThread::Rendezvous(error);
|
sl@0
|
1162 |
return error;
|
sl@0
|
1163 |
}
|
sl@0
|
1164 |
|
sl@0
|
1165 |
RThread::Rendezvous(KErrNone);
|
sl@0
|
1166 |
|
sl@0
|
1167 |
// wait for the dsa to start before creating the new window group
|
sl@0
|
1168 |
sem.Wait();
|
sl@0
|
1169 |
sem.Close();
|
sl@0
|
1170 |
|
sl@0
|
1171 |
|
sl@0
|
1172 |
RWindowGroup group(ws);
|
sl@0
|
1173 |
group.Construct(431,EFalse);
|
sl@0
|
1174 |
if(isInFront)
|
sl@0
|
1175 |
{
|
sl@0
|
1176 |
group.SetOrdinalPosition(0,KAboveMainTestBaseWindow);
|
sl@0
|
1177 |
}
|
sl@0
|
1178 |
else
|
sl@0
|
1179 |
{
|
sl@0
|
1180 |
group.SetOrdinalPosition(2);
|
sl@0
|
1181 |
}
|
sl@0
|
1182 |
RWindow window(ws);
|
sl@0
|
1183 |
error=window.Construct(group, 432);
|
sl@0
|
1184 |
if (error==KErrNone)
|
sl@0
|
1185 |
{
|
sl@0
|
1186 |
window.SetExtentErr(rect.iTl, rect.Size());
|
sl@0
|
1187 |
window.SetOrdinalPosition(0,0);
|
sl@0
|
1188 |
ws.Flush();
|
sl@0
|
1189 |
window.Activate();
|
sl@0
|
1190 |
ws.Flush();
|
sl@0
|
1191 |
if(!isInFront)
|
sl@0
|
1192 |
{
|
sl@0
|
1193 |
group.SetOrdinalPosition(-1);
|
sl@0
|
1194 |
}
|
sl@0
|
1195 |
ws.Flush();
|
sl@0
|
1196 |
//Wait for wserv to render new window on top of the existing DSA region.
|
sl@0
|
1197 |
ws.Finish();
|
sl@0
|
1198 |
//Now the window has been rendered (and DSA should have been aborted).
|
sl@0
|
1199 |
window.Close();
|
sl@0
|
1200 |
}
|
sl@0
|
1201 |
|
sl@0
|
1202 |
group.Close();
|
sl@0
|
1203 |
delete screen;
|
sl@0
|
1204 |
ws.Close();
|
sl@0
|
1205 |
return error;
|
sl@0
|
1206 |
}
|
sl@0
|
1207 |
|
sl@0
|
1208 |
void CBugFixColorAnimation::ConstructL(CTWindowGroup& aParent,TRect aExtent)
|
sl@0
|
1209 |
{
|
sl@0
|
1210 |
CColorAnimation::ConstructL(aParent, aExtent,KDrawingDsa);
|
sl@0
|
1211 |
_LIT(ThreadName,"Create new Window");
|
sl@0
|
1212 |
iAnimRect=aExtent;
|
sl@0
|
1213 |
TInt error=iSem.CreateGlobal(KSem_DefectFix_KAA_5J3BLW_Name, 0);
|
sl@0
|
1214 |
if (error==KErrNone)
|
sl@0
|
1215 |
{
|
sl@0
|
1216 |
iThreadParam.iRect = iAnimRect;
|
sl@0
|
1217 |
iThreadParam.iIsInFront = EFalse;
|
sl@0
|
1218 |
TThreadStartUp function=TThreadStartUp(CreateNewWindowGroup, &iThreadParam);
|
sl@0
|
1219 |
TRequestStatus status;
|
sl@0
|
1220 |
iThread=CProcess::NewThreadRendezvousL(ThreadName,&function, status);
|
sl@0
|
1221 |
User::WaitForRequest(status);
|
sl@0
|
1222 |
if (status != KErrNone)
|
sl@0
|
1223 |
{
|
sl@0
|
1224 |
RDebug::Printf("the request status is returned to be non KErrNone: %d", status.Int());
|
sl@0
|
1225 |
TestFailed(this);
|
sl@0
|
1226 |
}
|
sl@0
|
1227 |
iTestFailed = CIdle::NewL(0);
|
sl@0
|
1228 |
}
|
sl@0
|
1229 |
else
|
sl@0
|
1230 |
{
|
sl@0
|
1231 |
TestFailed(this);
|
sl@0
|
1232 |
}
|
sl@0
|
1233 |
}
|
sl@0
|
1234 |
|
sl@0
|
1235 |
void CBugFixColorAnimation::AbortNow(RDirectScreenAccess::TTerminationReasons /*aReason*/)
|
sl@0
|
1236 |
{
|
sl@0
|
1237 |
Stop();
|
sl@0
|
1238 |
if (!iTestFailed->IsActive())
|
sl@0
|
1239 |
{
|
sl@0
|
1240 |
iTestFailed->Start(TCallBack(TestFailed,this));
|
sl@0
|
1241 |
}
|
sl@0
|
1242 |
}
|
sl@0
|
1243 |
|
sl@0
|
1244 |
void CBugFixColorAnimation::Restart(RDirectScreenAccess::TTerminationReasons aReason)
|
sl@0
|
1245 |
{
|
sl@0
|
1246 |
AbortNow(aReason);
|
sl@0
|
1247 |
}
|
sl@0
|
1248 |
|
sl@0
|
1249 |
TInt CPanicDirect::DoTestOnNewSchedulerL(TInt aInt, TAny* aPtr)
|
sl@0
|
1250 |
{
|
sl@0
|
1251 |
CActiveScheduler* activeScheduler=new(ELeave) CActiveScheduler;
|
sl@0
|
1252 |
CActiveScheduler::Install(activeScheduler);
|
sl@0
|
1253 |
CleanupStack::PushL(activeScheduler);
|
sl@0
|
1254 |
DoTestNowL(aInt,aPtr);
|
sl@0
|
1255 |
CleanupStack::PopAndDestroy(activeScheduler);
|
sl@0
|
1256 |
return(EWsExitReasonBad); //calls to this method currently all ignore the return code anyway.
|
sl@0
|
1257 |
}
|
sl@0
|
1258 |
|
sl@0
|
1259 |
TInt CPanicDirect::DoTestOnNewScheduler(TInt aInt, TAny* aPtr)
|
sl@0
|
1260 |
{
|
sl@0
|
1261 |
TInt rv=EWsExitReasonBad;
|
sl@0
|
1262 |
TRAP_IGNORE(rv=DoTestOnNewSchedulerL(aInt,aPtr));
|
sl@0
|
1263 |
return(rv); //calls to this method currently all ignore the return code anyway.
|
sl@0
|
1264 |
}
|
sl@0
|
1265 |
|
sl@0
|
1266 |
void CPanicDirect::DoTestNowL(TInt aInt, TAny* aPtr)
|
sl@0
|
1267 |
{
|
sl@0
|
1268 |
CPanicDirect* self=new(ELeave) CPanicDirect();
|
sl@0
|
1269 |
CleanupStack::PushL(self);
|
sl@0
|
1270 |
self->ConstructL((TInt)aPtr, aInt);
|
sl@0
|
1271 |
self->TestL();
|
sl@0
|
1272 |
CleanupStack::PopAndDestroy(self);
|
sl@0
|
1273 |
}
|
sl@0
|
1274 |
|
sl@0
|
1275 |
void CPanicDirect::ConstructL(TInt aScreenNumber, TInt aInt)
|
sl@0
|
1276 |
{
|
sl@0
|
1277 |
iScreenNumber = aScreenNumber;
|
sl@0
|
1278 |
|
sl@0
|
1279 |
User::LeaveIfError(iTimer.CreateLocal());
|
sl@0
|
1280 |
User::LeaveIfError(iWs.Connect());
|
sl@0
|
1281 |
iWsScrDev=new(ELeave) CWsScreenDevice(iWs);
|
sl@0
|
1282 |
User::LeaveIfError(iWsScrDev->Construct(iScreenNumber));
|
sl@0
|
1283 |
|
sl@0
|
1284 |
#if defined(LOGGING)
|
sl@0
|
1285 |
_LIT(KPanicThead1,"PanicThread: Into ConstructL");
|
sl@0
|
1286 |
LogMessageText.Copy(KPanicThead1);
|
sl@0
|
1287 |
iWs.LogMessage(LogMessageText);
|
sl@0
|
1288 |
iWs.Flush();
|
sl@0
|
1289 |
#endif
|
sl@0
|
1290 |
iGroup=RWindowGroup(iWs);
|
sl@0
|
1291 |
User::LeaveIfError(iGroup.Construct(2200+aInt,EFalse));
|
sl@0
|
1292 |
iGroup.SetOrdinalPosition(0,KPanicTestOrdinalPriority);
|
sl@0
|
1293 |
iBlankWin=RBlankWindow(iWs);
|
sl@0
|
1294 |
User::LeaveIfError(iBlankWin.Construct(iGroup,2300+aInt));
|
sl@0
|
1295 |
iBlankWin.Activate();
|
sl@0
|
1296 |
iDirect=RDirectScreenAccess(iWs);
|
sl@0
|
1297 |
User::LeaveIfError(iDirect.Construct());
|
sl@0
|
1298 |
iDisplayMode=iWsScrDev->DisplayMode();
|
sl@0
|
1299 |
#if defined(LOGGING)
|
sl@0
|
1300 |
_LIT(KPanicThead2,"PanicThread: Creating Screen Device, Mode=%d");
|
sl@0
|
1301 |
LogMessageText.Format(KPanicThead2,iDisplayMode);
|
sl@0
|
1302 |
iWs.LogMessage(LogMessageText);
|
sl@0
|
1303 |
iWs.Flush();
|
sl@0
|
1304 |
#endif
|
sl@0
|
1305 |
iScreenDevice=CFbsScreenDevice::NewL(aScreenNumber,iDisplayMode);
|
sl@0
|
1306 |
#if defined(LOGGING)
|
sl@0
|
1307 |
_LIT(KPanicThead3,"PanicThread: Created Device");
|
sl@0
|
1308 |
LogMessageText.Copy(KPanicThead3);
|
sl@0
|
1309 |
iWs.LogMessage(LogMessageText);
|
sl@0
|
1310 |
iWs.Flush();
|
sl@0
|
1311 |
#endif
|
sl@0
|
1312 |
User::LeaveIfError(iScreenDevice->CreateContext(iGc));
|
sl@0
|
1313 |
#if defined(LOGGING)
|
sl@0
|
1314 |
_LIT(KPanicThead4,"PanicThread: Created Context");
|
sl@0
|
1315 |
LogMessageText.Copy(KPanicThead4);
|
sl@0
|
1316 |
iWs.LogMessage(LogMessageText);
|
sl@0
|
1317 |
iWs.Flush();
|
sl@0
|
1318 |
#endif
|
sl@0
|
1319 |
iTextDraw=CScrollingTextDrawer::NewL(iScreenNumber,iScreenDevice,*iGc);
|
sl@0
|
1320 |
#if defined(LOGGING)
|
sl@0
|
1321 |
_LIT(KPanicThead5,"PanicThread: Created ScrollDrawer");
|
sl@0
|
1322 |
LogMessageText.Copy(KPanicThead5);
|
sl@0
|
1323 |
iWs.LogMessage(LogMessageText);
|
sl@0
|
1324 |
iWs.Flush();
|
sl@0
|
1325 |
#endif
|
sl@0
|
1326 |
iTextDraw->SetScrollJump(4);
|
sl@0
|
1327 |
#if defined(LOGGING)
|
sl@0
|
1328 |
_LIT(KCreatedDrawer,"PanicThread: CreatedDrawer");
|
sl@0
|
1329 |
LogMessageText.Copy(KCreatedDrawer);
|
sl@0
|
1330 |
iWs.LogMessage(LogMessageText);
|
sl@0
|
1331 |
iWs.Flush();
|
sl@0
|
1332 |
#endif
|
sl@0
|
1333 |
iTestNo=aInt;
|
sl@0
|
1334 |
}
|
sl@0
|
1335 |
|
sl@0
|
1336 |
CPanicDirect::~CPanicDirect()
|
sl@0
|
1337 |
{
|
sl@0
|
1338 |
iDirect.Close();
|
sl@0
|
1339 |
delete iGc;
|
sl@0
|
1340 |
delete iScreenDevice;
|
sl@0
|
1341 |
delete iTextDraw;
|
sl@0
|
1342 |
iBlankWin.Close();
|
sl@0
|
1343 |
iGroup.Close();
|
sl@0
|
1344 |
delete iWsScrDev;
|
sl@0
|
1345 |
iWs.Close();
|
sl@0
|
1346 |
if (iRegion)
|
sl@0
|
1347 |
iRegion->Close();
|
sl@0
|
1348 |
iTimer.Close();
|
sl@0
|
1349 |
}
|
sl@0
|
1350 |
|
sl@0
|
1351 |
void CPanicDirect::TestL()
|
sl@0
|
1352 |
{
|
sl@0
|
1353 |
if (iTestNo==2)
|
sl@0
|
1354 |
{
|
sl@0
|
1355 |
iDirect.Completed();
|
sl@0
|
1356 |
return;
|
sl@0
|
1357 |
}
|
sl@0
|
1358 |
TInt err=iDirect.Request(iRegion,iDirectStatus,iBlankWin);
|
sl@0
|
1359 |
if (err!=KErrNone || !iRegion)
|
sl@0
|
1360 |
return;
|
sl@0
|
1361 |
TRect screen(iScreenDevice->SizeInPixels());
|
sl@0
|
1362 |
TRect bounding=iRegion->BoundingRect();
|
sl@0
|
1363 |
if (!screen.Contains(bounding.iTl) || !screen.Contains(bounding.iBr-TPoint(1,1)))
|
sl@0
|
1364 |
goto Cancel;
|
sl@0
|
1365 |
iGc->SetClippingRegion(iRegion);
|
sl@0
|
1366 |
iDrawingAllowed=ETrue;
|
sl@0
|
1367 |
iTimer.After(iTimerStatus,50000); //0.05secs
|
sl@0
|
1368 |
FOREVER
|
sl@0
|
1369 |
{
|
sl@0
|
1370 |
User::WaitForRequest(iDirectStatus,iTimerStatus);
|
sl@0
|
1371 |
if (iDirectStatus!=KRequestPending)
|
sl@0
|
1372 |
iDrawingAllowed=EFalse;
|
sl@0
|
1373 |
else if (iTimerStatus!=KRequestPending)
|
sl@0
|
1374 |
{
|
sl@0
|
1375 |
if (iDrawingAllowed)
|
sl@0
|
1376 |
DoDrawingL();
|
sl@0
|
1377 |
iTimer.After(iTimerStatus,50000); //0.05secs
|
sl@0
|
1378 |
}
|
sl@0
|
1379 |
else
|
sl@0
|
1380 |
{
|
sl@0
|
1381 |
Cancel:
|
sl@0
|
1382 |
iDirect.Cancel();
|
sl@0
|
1383 |
return;
|
sl@0
|
1384 |
}
|
sl@0
|
1385 |
}
|
sl@0
|
1386 |
}
|
sl@0
|
1387 |
|
sl@0
|
1388 |
void CPanicDirect::DoDrawingL()
|
sl@0
|
1389 |
{
|
sl@0
|
1390 |
++iCount;
|
sl@0
|
1391 |
iTextDraw->Scroll();
|
sl@0
|
1392 |
if (iTestNo==1 && iCount==8)
|
sl@0
|
1393 |
{
|
sl@0
|
1394 |
iDirect.Request(iRegion,iDirectStatus,iBlankWin);
|
sl@0
|
1395 |
return;
|
sl@0
|
1396 |
}
|
sl@0
|
1397 |
if (iTestNo==3 && iCount==12)
|
sl@0
|
1398 |
{
|
sl@0
|
1399 |
iDirect.Completed();
|
sl@0
|
1400 |
iDirect.Completed();
|
sl@0
|
1401 |
return;
|
sl@0
|
1402 |
}
|
sl@0
|
1403 |
if (iTestNo==4 && iCount==16)
|
sl@0
|
1404 |
{
|
sl@0
|
1405 |
iBlankWin.SetSize(TSize(20,25));
|
sl@0
|
1406 |
delete iRegion;
|
sl@0
|
1407 |
User::LeaveIfError(iDirect.Request(iRegion,iDirectStatus,iBlankWin));
|
sl@0
|
1408 |
return;
|
sl@0
|
1409 |
}
|
sl@0
|
1410 |
if (iTestNo==5 && iCount==19)
|
sl@0
|
1411 |
{
|
sl@0
|
1412 |
iWs.Close();
|
sl@0
|
1413 |
return;
|
sl@0
|
1414 |
}
|
sl@0
|
1415 |
}
|
sl@0
|
1416 |
|
sl@0
|
1417 |
|
sl@0
|
1418 |
/*CTDirect*/
|
sl@0
|
1419 |
|
sl@0
|
1420 |
CTDirect::CTDirect(CTestStep* aStep):
|
sl@0
|
1421 |
CTWsGraphicsBase(aStep)
|
sl@0
|
1422 |
{
|
sl@0
|
1423 |
iState = 0;
|
sl@0
|
1424 |
iNextFrameFinished = ETrue;
|
sl@0
|
1425 |
iPackagingFinished = EFalse;
|
sl@0
|
1426 |
iTimerRunning = EFalse;
|
sl@0
|
1427 |
}
|
sl@0
|
1428 |
|
sl@0
|
1429 |
CTDirect::~CTDirect()
|
sl@0
|
1430 |
{
|
sl@0
|
1431 |
DeleteMoveWindow();
|
sl@0
|
1432 |
DeleteScroll();
|
sl@0
|
1433 |
|
sl@0
|
1434 |
delete iAnim;
|
sl@0
|
1435 |
TheClient->WaitForRedrawsToFinish();
|
sl@0
|
1436 |
delete iCallBackWin;
|
sl@0
|
1437 |
// put focus back to current screen as this test changed the focus screen to primary screen
|
sl@0
|
1438 |
TheClient->iWs.SetFocusScreen(iTest->iScreenNumber);
|
sl@0
|
1439 |
}
|
sl@0
|
1440 |
|
sl@0
|
1441 |
void CTDirect::ConstructL()
|
sl@0
|
1442 |
{
|
sl@0
|
1443 |
_LIT(KCTDirectConstructL,"AUTO Construct Direct Test");
|
sl@0
|
1444 |
LOG_MESSAGE(KCTDirectConstructL);
|
sl@0
|
1445 |
FullScreenModeSize=TheClient->iScreen->SizeInPixels();
|
sl@0
|
1446 |
iIsScalingSupported=CheckScalingSupportedOrNot();
|
sl@0
|
1447 |
iNumOfCallBack=0;
|
sl@0
|
1448 |
iCallBackWin=new(ELeave) CTBlankWindow;
|
sl@0
|
1449 |
iCallBackWin->ConstructL(*TheClient->iGroup);
|
sl@0
|
1450 |
User::LeaveIfError(iCallBackWin->BaseWin()->SetRequiredDisplayMode(EColor256));
|
sl@0
|
1451 |
iCallBackWin->SetExt(TPoint(),TheClient->iScreen->SizeInPixels());
|
sl@0
|
1452 |
iCallBackWin->SetVisible(EFalse);
|
sl@0
|
1453 |
iCallBackWin->Activate();
|
sl@0
|
1454 |
// the following line makes sure that a console object hidden outside of
|
sl@0
|
1455 |
// screens range doesn't affect test results being on top of tested objects
|
sl@0
|
1456 |
TheClient->iGroup->GroupWin()->SetOrdinalPosition(0, KMainTestBaseWindow);
|
sl@0
|
1457 |
}
|
sl@0
|
1458 |
|
sl@0
|
1459 |
void CTDirect::ConstrucBlankWindowL()
|
sl@0
|
1460 |
{
|
sl@0
|
1461 |
delete iWin;
|
sl@0
|
1462 |
iWin=new(ELeave) CTBlankWindow;
|
sl@0
|
1463 |
iWin->ConstructL(*TheClient->iGroup);
|
sl@0
|
1464 |
iWin->BaseWin()->SetShadowDisabled(ETrue);
|
sl@0
|
1465 |
iWin->BaseWin()->Activate();
|
sl@0
|
1466 |
TheClient->Flush();
|
sl@0
|
1467 |
}
|
sl@0
|
1468 |
|
sl@0
|
1469 |
void CTDirect::InitialiseAnimationL()
|
sl@0
|
1470 |
{
|
sl@0
|
1471 |
ConstrucBlankWindowL();
|
sl@0
|
1472 |
TInt colors,greys;
|
sl@0
|
1473 |
TDisplayMode dispMode=TheClient->iWs.GetDefModeMaxNumColors(colors,greys);
|
sl@0
|
1474 |
iScrDev=CFbsScreenDevice::NewL(iTest->iScreenNumber,dispMode);
|
sl@0
|
1475 |
User::LeaveIfError(iScrDev->CreateContext(iGc));
|
sl@0
|
1476 |
INFO_PRINTF1(_L(" Constructed Screen Device"));
|
sl@0
|
1477 |
iScrSize=iScrDev->SizeInPixels();
|
sl@0
|
1478 |
TFontSpec fontSpec(FontName,iScrSize.iHeight);
|
sl@0
|
1479 |
fontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
|
sl@0
|
1480 |
User::LeaveIfError(iScrDev->GetNearestFontToDesignHeightInPixels(iFont,fontSpec));
|
sl@0
|
1481 |
iGc->UseFont(iFont);
|
sl@0
|
1482 |
iFlags|=eFontSet;
|
sl@0
|
1483 |
iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
|
sl@0
|
1484 |
TInt fontHeight=iFont->HeightInPixels();
|
sl@0
|
1485 |
iDrawRect.iTl.iY=(iScrSize.iHeight-fontHeight)/2;
|
sl@0
|
1486 |
iDrawRect.SetHeight(fontHeight);
|
sl@0
|
1487 |
iDrawHeight=iFont->AscentInPixels();
|
sl@0
|
1488 |
TSize winSize(25,20);
|
sl@0
|
1489 |
iWin2=new(ELeave) CTBlankWindow;
|
sl@0
|
1490 |
iWin2->ConstructL(*TheClient->iGroup);
|
sl@0
|
1491 |
iWin2->SetExt(TPoint((iScrSize.iWidth-winSize.iWidth)/2,(iScrSize.iHeight-winSize.iHeight)/2),winSize);
|
sl@0
|
1492 |
iWin2->SetColor(TRgb::Gray4(2));
|
sl@0
|
1493 |
iWin2->BaseWin()->Activate();
|
sl@0
|
1494 |
INFO_PRINTF1(_L(" Setup Window"));
|
sl@0
|
1495 |
iScrDev->Update();
|
sl@0
|
1496 |
TheClient->iWs.Finish();
|
sl@0
|
1497 |
|
sl@0
|
1498 |
User::LeaveIfError(iControlSem.CreateGlobal(SemControl,0,KOwnerType));
|
sl@0
|
1499 |
User::LeaveIfError(iControlQueue.CreateGlobal(QueueControl,1,sizeof(TInt),KOwnerType));
|
sl@0
|
1500 |
|
sl@0
|
1501 |
iFlags|=eDirectControlSem;
|
sl@0
|
1502 |
User::LeaveIfError(iWinSem.CreateGlobal(SemNextOp,0,KOwnerType));
|
sl@0
|
1503 |
iFlags|=eDirectWindowSem;
|
sl@0
|
1504 |
iProcess=CProcess::NewTL(CProcess::eProcessDirectTest,iTest->iScreenNumber,&iThreadStatus);
|
sl@0
|
1505 |
INFO_PRINTF1(_L(" Constructed Semaphores & Thread"));
|
sl@0
|
1506 |
iControlSem.Wait();
|
sl@0
|
1507 |
|
sl@0
|
1508 |
iTimer=CPeriodic::NewL(iTest->EAutoTestPriority);
|
sl@0
|
1509 |
iRestart=CIdle::NewL(iTest->EAutoTestPriority+5);
|
sl@0
|
1510 |
iDirect=CDirectScreenAccessOld::NewL(TheClient->iWs,*this);
|
sl@0
|
1511 |
}
|
sl@0
|
1512 |
|
sl@0
|
1513 |
void CTDirect::DestroyAnimation()
|
sl@0
|
1514 |
{
|
sl@0
|
1515 |
ResetScreenSizeMode();
|
sl@0
|
1516 |
if(iProcess && iProcess->StillAlive())
|
sl@0
|
1517 |
{
|
sl@0
|
1518 |
if (iFlags&eDirectControlSem)
|
sl@0
|
1519 |
{
|
sl@0
|
1520 |
iControlSem.Signal();
|
sl@0
|
1521 |
TInt data = 3;
|
sl@0
|
1522 |
iControlQueue.Send(&data,sizeof(TInt));
|
sl@0
|
1523 |
}
|
sl@0
|
1524 |
if (iFlags&eDirectWindowSem)
|
sl@0
|
1525 |
iWinSem.Signal();
|
sl@0
|
1526 |
}
|
sl@0
|
1527 |
|
sl@0
|
1528 |
delete iTimer;
|
sl@0
|
1529 |
iTimer=NULL;
|
sl@0
|
1530 |
delete iRestart;
|
sl@0
|
1531 |
iRestart=NULL;
|
sl@0
|
1532 |
delete iDirect;
|
sl@0
|
1533 |
iDirect=NULL;
|
sl@0
|
1534 |
delete iChangeScreenModeTimer;
|
sl@0
|
1535 |
iChangeScreenModeTimer=NULL;
|
sl@0
|
1536 |
delete iScreenModeTimer;
|
sl@0
|
1537 |
iScreenModeTimer=NULL;
|
sl@0
|
1538 |
|
sl@0
|
1539 |
if (iFlags&eFontSet)
|
sl@0
|
1540 |
{
|
sl@0
|
1541 |
iGc->DiscardFont();
|
sl@0
|
1542 |
iScrDev->ReleaseFont(iFont);
|
sl@0
|
1543 |
}
|
sl@0
|
1544 |
delete iGc;
|
sl@0
|
1545 |
if (iDrawingRegion)
|
sl@0
|
1546 |
iDrawingRegion->Destroy();
|
sl@0
|
1547 |
delete iScrDev;
|
sl@0
|
1548 |
delete iWin;
|
sl@0
|
1549 |
delete iWin2;
|
sl@0
|
1550 |
if (iProcess)
|
sl@0
|
1551 |
{
|
sl@0
|
1552 |
User::WaitForRequest(iThreadStatus);
|
sl@0
|
1553 |
delete iProcess;
|
sl@0
|
1554 |
iProcess = NULL;
|
sl@0
|
1555 |
}
|
sl@0
|
1556 |
if (iFlags&eDirectControlSem)
|
sl@0
|
1557 |
{
|
sl@0
|
1558 |
iControlSem.Close();
|
sl@0
|
1559 |
iControlQueue.Close();
|
sl@0
|
1560 |
}
|
sl@0
|
1561 |
if (iFlags&eDirectWindowSem)
|
sl@0
|
1562 |
iWinSem.Close();
|
sl@0
|
1563 |
}
|
sl@0
|
1564 |
|
sl@0
|
1565 |
void CTDirect::ResetScreenSizeMode()
|
sl@0
|
1566 |
{
|
sl@0
|
1567 |
if (iModeBackup!=ESizeEnforcementNone)
|
sl@0
|
1568 |
{
|
sl@0
|
1569 |
TheClient->iScreen->SetScreenModeEnforcement(ESizeEnforcementNone);
|
sl@0
|
1570 |
iModeBackup=ESizeEnforcementNone;
|
sl@0
|
1571 |
}
|
sl@0
|
1572 |
TheClient->iScreen->SetCurrentRotations(0,CFbsBitGc::EGraphicsOrientationNormal);
|
sl@0
|
1573 |
TheClient->iScreen->SetScreenMode(0);
|
sl@0
|
1574 |
TPixelsAndRotation pixelsAndRotation;
|
sl@0
|
1575 |
TheClient->iScreen->GetDefaultScreenSizeAndRotation(pixelsAndRotation);
|
sl@0
|
1576 |
TheClient->iScreen->SetScreenSizeAndRotation(pixelsAndRotation);
|
sl@0
|
1577 |
User::After(350000); //0.35secs
|
sl@0
|
1578 |
}
|
sl@0
|
1579 |
|
sl@0
|
1580 |
void CTDirect::ScanTypeFacesL()
|
sl@0
|
1581 |
{
|
sl@0
|
1582 |
CFbsScreenDevice* scrdev=CFbsScreenDevice::NewL(iTest->iScreenNumber,EGray4);
|
sl@0
|
1583 |
TTypefaceSupport typeFace;
|
sl@0
|
1584 |
TInt numFaces=scrdev->NumTypefaces();
|
sl@0
|
1585 |
TInt ii;
|
sl@0
|
1586 |
for (ii=0;ii<numFaces;++ii)
|
sl@0
|
1587 |
{
|
sl@0
|
1588 |
scrdev->TypefaceSupport(typeFace,ii);
|
sl@0
|
1589 |
}
|
sl@0
|
1590 |
delete scrdev;
|
sl@0
|
1591 |
}
|
sl@0
|
1592 |
|
sl@0
|
1593 |
TInt RestartAnimation(TAny* aTest)
|
sl@0
|
1594 |
{
|
sl@0
|
1595 |
STATIC_CAST(CTDirect*,aTest)->Restart();
|
sl@0
|
1596 |
return(KErrNone);
|
sl@0
|
1597 |
}
|
sl@0
|
1598 |
|
sl@0
|
1599 |
TInt NextFrame(TAny* aTest)
|
sl@0
|
1600 |
{
|
sl@0
|
1601 |
STATIC_CAST(CTDirect*,aTest)->DrawFrame();
|
sl@0
|
1602 |
return(KErrNone);
|
sl@0
|
1603 |
}
|
sl@0
|
1604 |
|
sl@0
|
1605 |
void CTDirect::AbortNow(RDirectScreenAccess::TTerminationReasons aReason)
|
sl@0
|
1606 |
{
|
sl@0
|
1607 |
TEST(aReason==RDirectScreenAccess::ETerminateRegion);
|
sl@0
|
1608 |
|
sl@0
|
1609 |
if (iDelay)
|
sl@0
|
1610 |
User::After(2000000); //2 secs
|
sl@0
|
1611 |
if (iCancelNext)
|
sl@0
|
1612 |
{
|
sl@0
|
1613 |
iFrameNo=eDirectNumFrames;
|
sl@0
|
1614 |
iTimer->Cancel();
|
sl@0
|
1615 |
iDirect->Cancel();
|
sl@0
|
1616 |
TheClient->Flush();
|
sl@0
|
1617 |
iNextFrameFinished = ETrue;
|
sl@0
|
1618 |
iState++;
|
sl@0
|
1619 |
return;
|
sl@0
|
1620 |
}
|
sl@0
|
1621 |
iRestart->Start(TCallBack(RestartAnimation,this));
|
sl@0
|
1622 |
}
|
sl@0
|
1623 |
|
sl@0
|
1624 |
TBool CTDirect::Restart()
|
sl@0
|
1625 |
{
|
sl@0
|
1626 |
StartDirect();
|
sl@0
|
1627 |
return ETrue;
|
sl@0
|
1628 |
}
|
sl@0
|
1629 |
|
sl@0
|
1630 |
#pragma warning( disable : 4244 ) //conversion from 'int' to 'unsigned short', possible loss of data
|
sl@0
|
1631 |
TBool CTDirect::DrawFrame()
|
sl@0
|
1632 |
{
|
sl@0
|
1633 |
if (iFrameNo==eDirectNumFrames)
|
sl@0
|
1634 |
{
|
sl@0
|
1635 |
iState++;
|
sl@0
|
1636 |
iTimer->Cancel();
|
sl@0
|
1637 |
if (iFrameNo==eDirectNumFrames)
|
sl@0
|
1638 |
iDirect->Cancel();
|
sl@0
|
1639 |
iNextFrameFinished = ETrue;
|
sl@0
|
1640 |
return EFalse;
|
sl@0
|
1641 |
}
|
sl@0
|
1642 |
_LIT(Text,"A0");
|
sl@0
|
1643 |
TBuf<2> iString(Text); //_LIT(Text,"ABCabc123");
|
sl@0
|
1644 |
iString[0]+=iFrameNo;
|
sl@0
|
1645 |
iString[1]+=iFrameNo;
|
sl@0
|
1646 |
TInt textWidth=iFont->TextWidthInPixels(iString);
|
sl@0
|
1647 |
TInt maxTextWidth=Max(textWidth,iLastTextWidth);
|
sl@0
|
1648 |
iLastTextWidth=textWidth;
|
sl@0
|
1649 |
if (iLastMaxTextWidth!=maxTextWidth)
|
sl@0
|
1650 |
{
|
sl@0
|
1651 |
iLastMaxTextWidth=maxTextWidth;
|
sl@0
|
1652 |
iDrawRect.iTl.iX=(iScrSize.iWidth-iLastMaxTextWidth)/2;
|
sl@0
|
1653 |
iDrawRect.SetWidth(iLastMaxTextWidth);
|
sl@0
|
1654 |
}
|
sl@0
|
1655 |
TInt colorOffset=iFrameNo%2;
|
sl@0
|
1656 |
iGc->SetPenColor(TRgb::Gray4(colorOffset));
|
sl@0
|
1657 |
iGc->DrawText(iString,iDrawRect,iDrawHeight,CGraphicsContext::ECenter);
|
sl@0
|
1658 |
iGc->SetPenColor(TRgb::Gray4(1+colorOffset));
|
sl@0
|
1659 |
iGc->DrawLine(TPoint(),iScrSize.AsPoint());
|
sl@0
|
1660 |
iGc->DrawLine(TPoint(iScrSize.iWidth,0),TPoint(0,iScrSize.iHeight));
|
sl@0
|
1661 |
iGc->DrawLine(TPoint(iScrSize.iWidth/2,0),TPoint(iScrSize.iWidth/2,iScrSize.iHeight));
|
sl@0
|
1662 |
iGc->DrawLine(TPoint(0,iScrSize.iHeight/2),TPoint(iScrSize.iWidth,iScrSize.iHeight/2));
|
sl@0
|
1663 |
iScrDev->Update();
|
sl@0
|
1664 |
++iFrameNo;
|
sl@0
|
1665 |
if (iFrameNo==iFrameToSignalAfter)
|
sl@0
|
1666 |
SignalWindow();
|
sl@0
|
1667 |
return ETrue;
|
sl@0
|
1668 |
}
|
sl@0
|
1669 |
#pragma warning( default : 4244 )
|
sl@0
|
1670 |
|
sl@0
|
1671 |
void CTDirect::SignalWindow()
|
sl@0
|
1672 |
{
|
sl@0
|
1673 |
switch(iState)
|
sl@0
|
1674 |
{
|
sl@0
|
1675 |
case 0:
|
sl@0
|
1676 |
switch(iFrameNo)
|
sl@0
|
1677 |
{
|
sl@0
|
1678 |
case 0:
|
sl@0
|
1679 |
iFrameToSignalAfter=0;
|
sl@0
|
1680 |
}
|
sl@0
|
1681 |
return;
|
sl@0
|
1682 |
case 1:
|
sl@0
|
1683 |
case 3:
|
sl@0
|
1684 |
switch(iFrameNo)
|
sl@0
|
1685 |
{
|
sl@0
|
1686 |
case 0:
|
sl@0
|
1687 |
iFrameToSignalAfter=3;
|
sl@0
|
1688 |
iDelay=(iState==3);
|
sl@0
|
1689 |
return;
|
sl@0
|
1690 |
case 3:
|
sl@0
|
1691 |
WinExt.SetSize(TSize(iScrSize.iWidth/2-5,iScrSize.iHeight/2+30));
|
sl@0
|
1692 |
iFrameToSignalAfter=5;
|
sl@0
|
1693 |
break;
|
sl@0
|
1694 |
case 5:
|
sl@0
|
1695 |
iFrameToSignalAfter=7;
|
sl@0
|
1696 |
break;
|
sl@0
|
1697 |
case 7:
|
sl@0
|
1698 |
WinExt.SetSize(TSize(iScrSize.iWidth/2+30,iScrSize.iHeight/2-5));
|
sl@0
|
1699 |
WinCol=1;
|
sl@0
|
1700 |
iFrameToSignalAfter=8;
|
sl@0
|
1701 |
break;
|
sl@0
|
1702 |
case 8:
|
sl@0
|
1703 |
iFrameToSignalAfter=0;
|
sl@0
|
1704 |
iDelay=EFalse;
|
sl@0
|
1705 |
break;
|
sl@0
|
1706 |
}
|
sl@0
|
1707 |
break;
|
sl@0
|
1708 |
case 2:
|
sl@0
|
1709 |
switch(iFrameNo)
|
sl@0
|
1710 |
{
|
sl@0
|
1711 |
case 0:
|
sl@0
|
1712 |
iFrameToSignalAfter=2;
|
sl@0
|
1713 |
return;
|
sl@0
|
1714 |
case 2:
|
sl@0
|
1715 |
WinExt.SetRect(TPoint(iScrSize.iWidth/2-15,iScrSize.iHeight/2-20),TSize(iScrSize.iWidth/3,iScrSize.iHeight/3));
|
sl@0
|
1716 |
WinCol=2;
|
sl@0
|
1717 |
iFrameToSignalAfter=5;
|
sl@0
|
1718 |
break;
|
sl@0
|
1719 |
case 5:
|
sl@0
|
1720 |
iFrameToSignalAfter=6;
|
sl@0
|
1721 |
break;
|
sl@0
|
1722 |
case 6:
|
sl@0
|
1723 |
WinExt.SetRect(TPoint(iScrSize.iWidth/2-50,iScrSize.iHeight/3),TSize(iScrSize.iWidth/4,iScrSize.iHeight/3));
|
sl@0
|
1724 |
WinCol=3;
|
sl@0
|
1725 |
iFrameToSignalAfter=8;
|
sl@0
|
1726 |
break;
|
sl@0
|
1727 |
case 8:
|
sl@0
|
1728 |
iFrameToSignalAfter=0;
|
sl@0
|
1729 |
break;
|
sl@0
|
1730 |
}
|
sl@0
|
1731 |
break;
|
sl@0
|
1732 |
case 4:
|
sl@0
|
1733 |
switch(iFrameNo)
|
sl@0
|
1734 |
{
|
sl@0
|
1735 |
case 0:
|
sl@0
|
1736 |
iFrameToSignalAfter=3;
|
sl@0
|
1737 |
return;
|
sl@0
|
1738 |
case 3:
|
sl@0
|
1739 |
iFrameToSignalAfter=6;
|
sl@0
|
1740 |
iWin2->SetVisible(EFalse);
|
sl@0
|
1741 |
TheClient->Flush();
|
sl@0
|
1742 |
return;
|
sl@0
|
1743 |
case 6:
|
sl@0
|
1744 |
iFrameToSignalAfter=0;
|
sl@0
|
1745 |
iWin2->SetVisible(ETrue);
|
sl@0
|
1746 |
TheClient->Flush();
|
sl@0
|
1747 |
return;
|
sl@0
|
1748 |
}
|
sl@0
|
1749 |
break;
|
sl@0
|
1750 |
case 5:
|
sl@0
|
1751 |
switch(iFrameNo)
|
sl@0
|
1752 |
{
|
sl@0
|
1753 |
case 0:
|
sl@0
|
1754 |
iFrameToSignalAfter=6;
|
sl@0
|
1755 |
return;
|
sl@0
|
1756 |
case 6:
|
sl@0
|
1757 |
iFrameToSignalAfter=0;
|
sl@0
|
1758 |
WinExt.SetRect(10,10,20,20);
|
sl@0
|
1759 |
iCancelNext=ETrue;
|
sl@0
|
1760 |
break;
|
sl@0
|
1761 |
}
|
sl@0
|
1762 |
break;
|
sl@0
|
1763 |
case 6:
|
sl@0
|
1764 |
switch(iFrameNo)
|
sl@0
|
1765 |
{
|
sl@0
|
1766 |
case 0:
|
sl@0
|
1767 |
iFrameToSignalAfter=7;
|
sl@0
|
1768 |
iCancelNext=EFalse;
|
sl@0
|
1769 |
return;
|
sl@0
|
1770 |
case 7:
|
sl@0
|
1771 |
iFrameToSignalAfter=0;
|
sl@0
|
1772 |
delete iWin;
|
sl@0
|
1773 |
TheClient->Flush();
|
sl@0
|
1774 |
iWin=NULL;
|
sl@0
|
1775 |
iWindowDead=ETrue;
|
sl@0
|
1776 |
return;
|
sl@0
|
1777 |
}
|
sl@0
|
1778 |
break;
|
sl@0
|
1779 |
}
|
sl@0
|
1780 |
#if defined(LOGGING)
|
sl@0
|
1781 |
_LIT(KSignal,"Signaling Move Window");
|
sl@0
|
1782 |
LogMessageText.Copy(KSignal);
|
sl@0
|
1783 |
TheClient->iWs.LogMessage(LogMessageText);
|
sl@0
|
1784 |
TheClient->Flush();
|
sl@0
|
1785 |
#endif
|
sl@0
|
1786 |
iWinSem.Signal();
|
sl@0
|
1787 |
}
|
sl@0
|
1788 |
|
sl@0
|
1789 |
void CTDirect::StartDirect()
|
sl@0
|
1790 |
{
|
sl@0
|
1791 |
if (iWin==NULL)
|
sl@0
|
1792 |
{
|
sl@0
|
1793 |
TEST(iWindowDead);
|
sl@0
|
1794 |
if (!iWindowDead)
|
sl@0
|
1795 |
INFO_PRINTF3(_L("iWindowDead - Expected: %d, Actual: %d"), ETrue, iWindowDead);
|
sl@0
|
1796 |
|
sl@0
|
1797 |
iFrameNo=eDirectNumFrames;
|
sl@0
|
1798 |
return;
|
sl@0
|
1799 |
}
|
sl@0
|
1800 |
TEST(!iWindowDead);
|
sl@0
|
1801 |
if (iWindowDead)
|
sl@0
|
1802 |
INFO_PRINTF3(_L("iWindowDead - Expected: %d, Actual: %d"), EFalse, iWindowDead);
|
sl@0
|
1803 |
|
sl@0
|
1804 |
if (iDrawingRegion)
|
sl@0
|
1805 |
iDrawingRegion->Destroy();
|
sl@0
|
1806 |
TInt retVal = iDirect->Request(iDrawingRegion,*iWin->BaseWin());
|
sl@0
|
1807 |
TEST(retVal==KErrNone);
|
sl@0
|
1808 |
if (retVal!=KErrNone)
|
sl@0
|
1809 |
INFO_PRINTF3(_L("iDirect->Request(iDrawingRegion,*iWin->BaseWin()) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
|
sl@0
|
1810 |
|
sl@0
|
1811 |
iGc->SetClippingRegion(iDrawingRegion);
|
sl@0
|
1812 |
}
|
sl@0
|
1813 |
|
sl@0
|
1814 |
void CTDirect::LogLeave(TInt aErr)
|
sl@0
|
1815 |
{
|
sl@0
|
1816 |
iTest->LogLeave(aErr);
|
sl@0
|
1817 |
}
|
sl@0
|
1818 |
|
sl@0
|
1819 |
void CTDirect::Fail()
|
sl@0
|
1820 |
{
|
sl@0
|
1821 |
TEST(EFalse);
|
sl@0
|
1822 |
}
|
sl@0
|
1823 |
|
sl@0
|
1824 |
void CTDirect::Finished(TInt aId)
|
sl@0
|
1825 |
{
|
sl@0
|
1826 |
//aId refers to the animation, it is not the test number
|
sl@0
|
1827 |
_LIT(KCTDirectFinished,"Destroying animation number %d");
|
sl@0
|
1828 |
LOG_MESSAGE2(KCTDirectFinished,aId);
|
sl@0
|
1829 |
switch (aId)
|
sl@0
|
1830 |
{
|
sl@0
|
1831 |
case 10:
|
sl@0
|
1832 |
case 11:
|
sl@0
|
1833 |
ResetScreenSizeMode();
|
sl@0
|
1834 |
case 9:
|
sl@0
|
1835 |
iPackagingFinished = ETrue;
|
sl@0
|
1836 |
case 8:
|
sl@0
|
1837 |
DeleteMoveWindow();
|
sl@0
|
1838 |
//iPackagingFinished = ETrue;
|
sl@0
|
1839 |
if (iScroll)
|
sl@0
|
1840 |
{
|
sl@0
|
1841 |
DeleteScroll();
|
sl@0
|
1842 |
#if defined(LOGGING)
|
sl@0
|
1843 |
_LIT(KDeleteScroll,"Deleting Scroll Text Id=%d TimerActive=%d");
|
sl@0
|
1844 |
LogMessageText.Zero();
|
sl@0
|
1845 |
LogMessageText.AppendFormat(KDeleteScroll,aId,iAnim->IsTimerActive());
|
sl@0
|
1846 |
TheClient->iWs.LogMessage(LogMessageText);
|
sl@0
|
1847 |
TheClient->Flush();
|
sl@0
|
1848 |
#endif
|
sl@0
|
1849 |
}
|
sl@0
|
1850 |
if (aId==8 && iAnim->IsTimerActive())
|
sl@0
|
1851 |
return;
|
sl@0
|
1852 |
case 1:
|
sl@0
|
1853 |
case 12:
|
sl@0
|
1854 |
case 25: //case DSA using Region tracking Only (abort signal expceted)
|
sl@0
|
1855 |
case 26: //case DSA using Region tracking Only (abort signal not expceted)
|
sl@0
|
1856 |
{
|
sl@0
|
1857 |
iPackagingFinished = ETrue;
|
sl@0
|
1858 |
delete iAnim;
|
sl@0
|
1859 |
iAnim=NULL;
|
sl@0
|
1860 |
CHECKHANDLES:
|
sl@0
|
1861 |
TInt numProcessHandles;
|
sl@0
|
1862 |
TInt numThreadHandles;
|
sl@0
|
1863 |
RThread().HandleCount(numProcessHandles,numThreadHandles);
|
sl@0
|
1864 |
TEST(Abs(numThreadHandles-iNumThreadHandles)<2);
|
sl@0
|
1865 |
if (Abs(numThreadHandles-iNumThreadHandles)>=2)
|
sl@0
|
1866 |
INFO_PRINTF3(_L("Abs(numThreadHandles-iNumThreadHandles)<2 - Expected: %d or less, Actual: %d"), 2, Abs(numThreadHandles-iNumThreadHandles));
|
sl@0
|
1867 |
}
|
sl@0
|
1868 |
break;
|
sl@0
|
1869 |
case 16:
|
sl@0
|
1870 |
case 15:
|
sl@0
|
1871 |
{
|
sl@0
|
1872 |
// Stop the animation and delete it, but make sure that you don't increment iState and call Rquest()
|
sl@0
|
1873 |
// until this is the second call i.e. one of aId = 15 or aId = 16 has already been finished.
|
sl@0
|
1874 |
TInt index = aId-15;
|
sl@0
|
1875 |
iAnims[index]->Stop();
|
sl@0
|
1876 |
delete iAnims[index];
|
sl@0
|
1877 |
iAnims[index]=NULL;
|
sl@0
|
1878 |
// This test creates two animations iAnims[0] and iAnims[1].
|
sl@0
|
1879 |
// Use (index ^ 1 ) = Toggle the Index, to get the index of other animation.
|
sl@0
|
1880 |
// If iAnims [ index ^ 1] is NULL then this is the second Call and test is finished.
|
sl@0
|
1881 |
if (iAnims[index ^ 1] != NULL)
|
sl@0
|
1882 |
{
|
sl@0
|
1883 |
return;
|
sl@0
|
1884 |
}
|
sl@0
|
1885 |
iPackagingFinished = ETrue;
|
sl@0
|
1886 |
goto CHECKHANDLES;
|
sl@0
|
1887 |
}
|
sl@0
|
1888 |
case 13:
|
sl@0
|
1889 |
{
|
sl@0
|
1890 |
iPackagingFinished = ETrue;
|
sl@0
|
1891 |
delete iBlankTopClientWin1;
|
sl@0
|
1892 |
// delete iBlankTopClientWin2;
|
sl@0
|
1893 |
TInt jj;
|
sl@0
|
1894 |
for (jj=0;jj<4;++jj)
|
sl@0
|
1895 |
iAnims[jj]->Stop();
|
sl@0
|
1896 |
for (jj=0;jj<4;++jj)
|
sl@0
|
1897 |
delete iAnims[jj];
|
sl@0
|
1898 |
break;
|
sl@0
|
1899 |
}
|
sl@0
|
1900 |
case 14:
|
sl@0
|
1901 |
{
|
sl@0
|
1902 |
iPackagingFinished = ETrue;
|
sl@0
|
1903 |
iAnims[0]->Stop();
|
sl@0
|
1904 |
delete iAnims[0];
|
sl@0
|
1905 |
if (iNumOfModes==iCurrentMode)
|
sl@0
|
1906 |
{
|
sl@0
|
1907 |
ResetScreenSizeMode();
|
sl@0
|
1908 |
iCallBackWin->SetVisible(EFalse);
|
sl@0
|
1909 |
break;
|
sl@0
|
1910 |
}
|
sl@0
|
1911 |
break;
|
sl@0
|
1912 |
}
|
sl@0
|
1913 |
case 18:
|
sl@0
|
1914 |
case 17:
|
sl@0
|
1915 |
{
|
sl@0
|
1916 |
// Stop the animation and delete it, but make sure that you don't increment iState and call Rquest()
|
sl@0
|
1917 |
// until this is the second call i.e. one of aId = 17 or aId = 18 has already been finished.
|
sl@0
|
1918 |
TInt ii = 0;
|
sl@0
|
1919 |
TBool finished = ETrue;
|
sl@0
|
1920 |
if (aId == 17)
|
sl@0
|
1921 |
{
|
sl@0
|
1922 |
iAnims[0]->Stop();
|
sl@0
|
1923 |
delete iAnims[0];
|
sl@0
|
1924 |
iAnims[0] = NULL;
|
sl@0
|
1925 |
for (ii=1;ii<=iNumAnimation;++ii)
|
sl@0
|
1926 |
{
|
sl@0
|
1927 |
if (iAnims[ii])
|
sl@0
|
1928 |
{
|
sl@0
|
1929 |
finished = EFalse;
|
sl@0
|
1930 |
break;
|
sl@0
|
1931 |
}
|
sl@0
|
1932 |
}
|
sl@0
|
1933 |
}
|
sl@0
|
1934 |
else // aId == 18
|
sl@0
|
1935 |
{
|
sl@0
|
1936 |
for (ii=1;ii<=iNumAnimation;++ii)
|
sl@0
|
1937 |
{
|
sl@0
|
1938 |
iAnims[ii]->Stop();
|
sl@0
|
1939 |
delete iAnims[ii];
|
sl@0
|
1940 |
iAnims[ii] = NULL;
|
sl@0
|
1941 |
}
|
sl@0
|
1942 |
if (iAnims[0])
|
sl@0
|
1943 |
{
|
sl@0
|
1944 |
finished = EFalse;
|
sl@0
|
1945 |
}
|
sl@0
|
1946 |
}
|
sl@0
|
1947 |
if (!finished)
|
sl@0
|
1948 |
{
|
sl@0
|
1949 |
return;
|
sl@0
|
1950 |
}
|
sl@0
|
1951 |
iPackagingFinished = ETrue;
|
sl@0
|
1952 |
break;
|
sl@0
|
1953 |
}
|
sl@0
|
1954 |
case 19:
|
sl@0
|
1955 |
{
|
sl@0
|
1956 |
iPackagingFinished = ETrue;
|
sl@0
|
1957 |
iAnims[0]->Stop();
|
sl@0
|
1958 |
delete iAnims[0];
|
sl@0
|
1959 |
break;
|
sl@0
|
1960 |
}
|
sl@0
|
1961 |
case 21:
|
sl@0
|
1962 |
case 20:
|
sl@0
|
1963 |
{
|
sl@0
|
1964 |
// Stop the animation and delete it, but make sure that you don't increment iState and call Rquest()
|
sl@0
|
1965 |
// until this is the second call i.e. one of aId = 20 or aId = 21 has already been finished.
|
sl@0
|
1966 |
TInt index = aId-20;
|
sl@0
|
1967 |
iAnims[index]->Stop();
|
sl@0
|
1968 |
delete iAnims[index];
|
sl@0
|
1969 |
iAnims[index]=NULL;
|
sl@0
|
1970 |
// This test creates two animations iAnims[0] and iAnims[1].
|
sl@0
|
1971 |
// Use (index ^ 1 ) = Toggle the Index, to get the index of other animation.
|
sl@0
|
1972 |
// If iAnims [ index ^ 1] is NULL then this is the second Call and test is finished.
|
sl@0
|
1973 |
if (iAnims[index ^ 1] != NULL)
|
sl@0
|
1974 |
{
|
sl@0
|
1975 |
return;
|
sl@0
|
1976 |
}
|
sl@0
|
1977 |
DeleteMoveWindow();
|
sl@0
|
1978 |
iPackagingFinished = ETrue;
|
sl@0
|
1979 |
goto CHECKHANDLES;
|
sl@0
|
1980 |
} //unreachable line, no need for break
|
sl@0
|
1981 |
case 24:
|
sl@0
|
1982 |
iPackagingFinished = ETrue;
|
sl@0
|
1983 |
iAnim->Stop();
|
sl@0
|
1984 |
delete iAnim;
|
sl@0
|
1985 |
iAnim=NULL;
|
sl@0
|
1986 |
//don't want to increase state, so decrement, since it is incremented below
|
sl@0
|
1987 |
//as part of processing normal completions. This is to reenter the test
|
sl@0
|
1988 |
//to call Fail() if required
|
sl@0
|
1989 |
iState--;
|
sl@0
|
1990 |
break;
|
sl@0
|
1991 |
|
sl@0
|
1992 |
case 27:
|
sl@0
|
1993 |
case 28:
|
sl@0
|
1994 |
case 29:
|
sl@0
|
1995 |
case 30:
|
sl@0
|
1996 |
case 31:
|
sl@0
|
1997 |
case 32:
|
sl@0
|
1998 |
iAnims[aId-27]->Stop();
|
sl@0
|
1999 |
delete iAnims[aId-27];
|
sl@0
|
2000 |
iAnims[aId-27] = NULL;
|
sl@0
|
2001 |
if(aId != 32)
|
sl@0
|
2002 |
{
|
sl@0
|
2003 |
return;
|
sl@0
|
2004 |
}
|
sl@0
|
2005 |
DeleteMoveWindow();
|
sl@0
|
2006 |
iPackagingFinished = ETrue;
|
sl@0
|
2007 |
break;
|
sl@0
|
2008 |
default:
|
sl@0
|
2009 |
iPackagingFinished = ETrue;
|
sl@0
|
2010 |
TInt ii;
|
sl@0
|
2011 |
for (ii=0;ii<6;++ii)
|
sl@0
|
2012 |
iAnims[ii]->Stop();
|
sl@0
|
2013 |
for (ii=0;ii<6;++ii)
|
sl@0
|
2014 |
delete iAnims[ii];
|
sl@0
|
2015 |
DeleteMoveWindow();
|
sl@0
|
2016 |
break;
|
sl@0
|
2017 |
}
|
sl@0
|
2018 |
#if defined(LOGGING)
|
sl@0
|
2019 |
_LIT(KRequest,"Signal Start NextTest Id=%d, State=%d(+1)");
|
sl@0
|
2020 |
LogMessageText.Zero();
|
sl@0
|
2021 |
LogMessageText.AppendFormat(KRequest,aId,iState);
|
sl@0
|
2022 |
TheClient->iWs.LogMessage(LogMessageText);
|
sl@0
|
2023 |
TheClient->Flush();
|
sl@0
|
2024 |
#endif
|
sl@0
|
2025 |
iState++;
|
sl@0
|
2026 |
}
|
sl@0
|
2027 |
|
sl@0
|
2028 |
void CTDirect::DeleteMoveWindow()
|
sl@0
|
2029 |
{
|
sl@0
|
2030 |
if (iMoveWin)
|
sl@0
|
2031 |
{
|
sl@0
|
2032 |
TRequestStatus status;
|
sl@0
|
2033 |
iMoveWin->Logon(status);
|
sl@0
|
2034 |
if (iMoveWin->StillAlive())
|
sl@0
|
2035 |
{
|
sl@0
|
2036 |
iMoveWin->Terminate(KErrNone);
|
sl@0
|
2037 |
User::WaitForRequest(status);
|
sl@0
|
2038 |
}
|
sl@0
|
2039 |
delete iMoveWin;
|
sl@0
|
2040 |
iMoveWin=NULL;
|
sl@0
|
2041 |
}
|
sl@0
|
2042 |
}
|
sl@0
|
2043 |
|
sl@0
|
2044 |
void CTDirect::DeleteScroll()
|
sl@0
|
2045 |
{
|
sl@0
|
2046 |
if (iScroll)
|
sl@0
|
2047 |
{
|
sl@0
|
2048 |
TheClient->iScreen->SetScreenMode(0);
|
sl@0
|
2049 |
iScroll->Stop();
|
sl@0
|
2050 |
delete iScroll;
|
sl@0
|
2051 |
iScroll=NULL;
|
sl@0
|
2052 |
}
|
sl@0
|
2053 |
}
|
sl@0
|
2054 |
|
sl@0
|
2055 |
TDisplayMode CTDirect::DisplayMode(TInt aId)
|
sl@0
|
2056 |
{
|
sl@0
|
2057 |
switch (aId)
|
sl@0
|
2058 |
{
|
sl@0
|
2059 |
case 1:
|
sl@0
|
2060 |
case 13:
|
sl@0
|
2061 |
case 15:
|
sl@0
|
2062 |
case 16:
|
sl@0
|
2063 |
return EColor16;
|
sl@0
|
2064 |
case 2:
|
sl@0
|
2065 |
return EGray16;
|
sl@0
|
2066 |
case 3:
|
sl@0
|
2067 |
return EColor16;
|
sl@0
|
2068 |
case 4:
|
sl@0
|
2069 |
case 14:
|
sl@0
|
2070 |
case 17:
|
sl@0
|
2071 |
case 18:
|
sl@0
|
2072 |
case 19:
|
sl@0
|
2073 |
case 24:
|
sl@0
|
2074 |
return EColor256;
|
sl@0
|
2075 |
case 5:
|
sl@0
|
2076 |
return EGray256;
|
sl@0
|
2077 |
case 6:
|
sl@0
|
2078 |
return EColor4K;
|
sl@0
|
2079 |
case 7:
|
sl@0
|
2080 |
return EColor64K;
|
sl@0
|
2081 |
case 8:
|
sl@0
|
2082 |
case 9:
|
sl@0
|
2083 |
case 10:
|
sl@0
|
2084 |
case 11:
|
sl@0
|
2085 |
case 12:
|
sl@0
|
2086 |
{
|
sl@0
|
2087 |
TInt colors,grays;
|
sl@0
|
2088 |
/*TDisplayMode mode=*/TheClient->iWs.GetDefModeMaxNumColors(colors,grays);
|
sl@0
|
2089 |
if (colors==0)
|
sl@0
|
2090 |
return EGray4;
|
sl@0
|
2091 |
return (aId==8? EGray16:EColor16);
|
sl@0
|
2092 |
}
|
sl@0
|
2093 |
default:;
|
sl@0
|
2094 |
return TheClient->iScreen->DisplayMode();
|
sl@0
|
2095 |
}
|
sl@0
|
2096 |
}
|
sl@0
|
2097 |
|
sl@0
|
2098 |
void CTDirect::Log(const TText8* aFile, TInt aLine, TInt aSeverity,const TDesC& aString)
|
sl@0
|
2099 |
{
|
sl@0
|
2100 |
Logger().LogExtra(((TText8*)aFile), aLine, aSeverity, aString) ;
|
sl@0
|
2101 |
}
|
sl@0
|
2102 |
|
sl@0
|
2103 |
TRgb CTDirect::BrushColorL(TInt aId,TInt& aColor,TBool& aFinished)
|
sl@0
|
2104 |
{
|
sl@0
|
2105 |
aFinished=EFalse;
|
sl@0
|
2106 |
switch (aId)
|
sl@0
|
2107 |
{
|
sl@0
|
2108 |
case 1:
|
sl@0
|
2109 |
case 13:
|
sl@0
|
2110 |
case 14:
|
sl@0
|
2111 |
case 15:
|
sl@0
|
2112 |
case 16:
|
sl@0
|
2113 |
case 17:
|
sl@0
|
2114 |
case 18:
|
sl@0
|
2115 |
case 19:
|
sl@0
|
2116 |
case 20:
|
sl@0
|
2117 |
case 21:
|
sl@0
|
2118 |
case 27:
|
sl@0
|
2119 |
aFinished=(aColor==20);
|
sl@0
|
2120 |
return TRgb::Color16(27 + aColor++);
|
sl@0
|
2121 |
case 28:
|
sl@0
|
2122 |
aFinished=(aColor==17);
|
sl@0
|
2123 |
return TRgb::Color16(28 + aColor++);
|
sl@0
|
2124 |
case 29:
|
sl@0
|
2125 |
aFinished=(aColor==15);
|
sl@0
|
2126 |
return TRgb::Color16(29 + aColor++);
|
sl@0
|
2127 |
case 8:
|
sl@0
|
2128 |
if (aColor==15)
|
sl@0
|
2129 |
{
|
sl@0
|
2130 |
++iCycles;
|
sl@0
|
2131 |
aFinished=(iCycles==5);
|
sl@0
|
2132 |
}
|
sl@0
|
2133 |
else if (!iScroll)
|
sl@0
|
2134 |
aFinished=ETrue;
|
sl@0
|
2135 |
else if (!iScroll->IsRunning())
|
sl@0
|
2136 |
iScroll->ContinueL();
|
sl@0
|
2137 |
{
|
sl@0
|
2138 |
#if defined(LOGGING)
|
sl@0
|
2139 |
if (aFinished || iScroll==NULL)
|
sl@0
|
2140 |
{
|
sl@0
|
2141 |
_LIT(KColor,"Col=%d Cycles=%d Fin=%d iScroll=%d");
|
sl@0
|
2142 |
LogMessageText.Zero();
|
sl@0
|
2143 |
LogMessageText.AppendFormat(KColor,aColor,iCycles,aFinished,(TInt&)iScroll);
|
sl@0
|
2144 |
TheClient->iWs.LogMessage(LogMessageText);
|
sl@0
|
2145 |
TheClient->Flush();
|
sl@0
|
2146 |
}
|
sl@0
|
2147 |
#endif
|
sl@0
|
2148 |
}
|
sl@0
|
2149 |
case 2:
|
sl@0
|
2150 |
if (aColor==16)
|
sl@0
|
2151 |
aColor=0;
|
sl@0
|
2152 |
return TRgb::Gray16(aColor++);
|
sl@0
|
2153 |
case 9:
|
sl@0
|
2154 |
case 10:
|
sl@0
|
2155 |
aFinished=iCycles>3;
|
sl@0
|
2156 |
case 11:
|
sl@0
|
2157 |
case 3:
|
sl@0
|
2158 |
if (aColor==16)
|
sl@0
|
2159 |
{
|
sl@0
|
2160 |
++iCycles;
|
sl@0
|
2161 |
aColor=0;
|
sl@0
|
2162 |
}
|
sl@0
|
2163 |
return TRgb::Color16(aColor++);
|
sl@0
|
2164 |
case 4:
|
sl@0
|
2165 |
aFinished=(aColor==256);
|
sl@0
|
2166 |
return TRgb::Color256(aColor++);
|
sl@0
|
2167 |
case 5:
|
sl@0
|
2168 |
if (aColor==256)
|
sl@0
|
2169 |
aColor=0;
|
sl@0
|
2170 |
return TRgb::Gray256(aColor++);
|
sl@0
|
2171 |
case 6:
|
sl@0
|
2172 |
aColor+=127;
|
sl@0
|
2173 |
if (aColor>4095)
|
sl@0
|
2174 |
aColor-=4096;
|
sl@0
|
2175 |
return TRgb::Color4K(aColor);
|
sl@0
|
2176 |
case 7:
|
sl@0
|
2177 |
aColor+=211;
|
sl@0
|
2178 |
if (aColor>65535)
|
sl@0
|
2179 |
aColor-=65536;
|
sl@0
|
2180 |
return TRgb::Color64K(aColor++);
|
sl@0
|
2181 |
case 12:
|
sl@0
|
2182 |
aFinished=2*(aColor>5);
|
sl@0
|
2183 |
return TRgb::Color16(aColor++);
|
sl@0
|
2184 |
case 24:
|
sl@0
|
2185 |
iCycles++;
|
sl@0
|
2186 |
if (iCycles==5)
|
sl@0
|
2187 |
{
|
sl@0
|
2188 |
aFinished=ETrue;
|
sl@0
|
2189 |
CheckForTemporaryDeadlock();
|
sl@0
|
2190 |
}
|
sl@0
|
2191 |
return TRgb::Color16(aColor++);
|
sl@0
|
2192 |
case 30:
|
sl@0
|
2193 |
aFinished=(aColor==256);
|
sl@0
|
2194 |
return TRgb::Color16(aColor++);
|
sl@0
|
2195 |
case 31:
|
sl@0
|
2196 |
aFinished=(aColor==100);
|
sl@0
|
2197 |
return TRgb::Color16(aColor++);
|
sl@0
|
2198 |
case 32:
|
sl@0
|
2199 |
aFinished=(aColor==300);
|
sl@0
|
2200 |
return TRgb::Color16(aColor++);
|
sl@0
|
2201 |
default:;
|
sl@0
|
2202 |
aFinished=ETrue;
|
sl@0
|
2203 |
return TRgb::Gray2(1); //White
|
sl@0
|
2204 |
}
|
sl@0
|
2205 |
}
|
sl@0
|
2206 |
|
sl@0
|
2207 |
TInt CTDirect::TimerInterval(TInt aId)
|
sl@0
|
2208 |
{
|
sl@0
|
2209 |
switch (aId)
|
sl@0
|
2210 |
{
|
sl@0
|
2211 |
case 1:
|
sl@0
|
2212 |
case 15:
|
sl@0
|
2213 |
case 16:
|
sl@0
|
2214 |
case 17:
|
sl@0
|
2215 |
case 18:
|
sl@0
|
2216 |
case 20:
|
sl@0
|
2217 |
case 21:
|
sl@0
|
2218 |
return 143200;
|
sl@0
|
2219 |
case 27:
|
sl@0
|
2220 |
return 200000;
|
sl@0
|
2221 |
case 28:
|
sl@0
|
2222 |
return 180000;
|
sl@0
|
2223 |
case 29:
|
sl@0
|
2224 |
return 170000;
|
sl@0
|
2225 |
case 30:
|
sl@0
|
2226 |
return 200000;
|
sl@0
|
2227 |
case 31:
|
sl@0
|
2228 |
return 205000;
|
sl@0
|
2229 |
case 32:
|
sl@0
|
2230 |
return 300000;
|
sl@0
|
2231 |
case 2:
|
sl@0
|
2232 |
case 25:
|
sl@0
|
2233 |
case 26:
|
sl@0
|
2234 |
return 234567;
|
sl@0
|
2235 |
case 3:
|
sl@0
|
2236 |
return 200000;
|
sl@0
|
2237 |
case 4:
|
sl@0
|
2238 |
return 11718;
|
sl@0
|
2239 |
case 5:
|
sl@0
|
2240 |
return 13719;
|
sl@0
|
2241 |
case 6:
|
sl@0
|
2242 |
return 14719;
|
sl@0
|
2243 |
case 7:
|
sl@0
|
2244 |
return 15719;
|
sl@0
|
2245 |
case 8:
|
sl@0
|
2246 |
return 275000;
|
sl@0
|
2247 |
case 9:
|
sl@0
|
2248 |
return 210000;
|
sl@0
|
2249 |
case 10:
|
sl@0
|
2250 |
return 110000;
|
sl@0
|
2251 |
case 11:
|
sl@0
|
2252 |
return 123456;
|
sl@0
|
2253 |
case 12:
|
sl@0
|
2254 |
return 10627;
|
sl@0
|
2255 |
case 19:
|
sl@0
|
2256 |
return 1000000;
|
sl@0
|
2257 |
default:;
|
sl@0
|
2258 |
return 1;
|
sl@0
|
2259 |
}
|
sl@0
|
2260 |
}
|
sl@0
|
2261 |
|
sl@0
|
2262 |
void CTDirect::FailedReStart(TInt /*aId*/,TInt /*aReason*/)
|
sl@0
|
2263 |
{
|
sl@0
|
2264 |
Fail();
|
sl@0
|
2265 |
}
|
sl@0
|
2266 |
|
sl@0
|
2267 |
TInt CTDirect::SlowStopping(TInt aId,TInt aCount)
|
sl@0
|
2268 |
{
|
sl@0
|
2269 |
if (aId==8)
|
sl@0
|
2270 |
return (aCount>1 ? CColorAnimation::eAbortAll : CColorAnimation::eStopNow);
|
sl@0
|
2271 |
if (aId==9 || aId==10)
|
sl@0
|
2272 |
return CColorAnimation::eStopNow;
|
sl@0
|
2273 |
TInt ret=(2*aId-3==aCount%12);
|
sl@0
|
2274 |
if (ret && aId==5)
|
sl@0
|
2275 |
{
|
sl@0
|
2276 |
++iCount;
|
sl@0
|
2277 |
if (iCount==5)
|
sl@0
|
2278 |
return CColorAnimation::eAbort;
|
sl@0
|
2279 |
}
|
sl@0
|
2280 |
return ret;
|
sl@0
|
2281 |
}
|
sl@0
|
2282 |
|
sl@0
|
2283 |
void CTDirect::ModeSwitch()
|
sl@0
|
2284 |
{
|
sl@0
|
2285 |
TRAPD(err,iAnim->ChangeModeL(EGray4));
|
sl@0
|
2286 |
iWin2->SetSize(TSize(20,25));
|
sl@0
|
2287 |
TheClient->Flush();
|
sl@0
|
2288 |
if (err!=KErrNone)
|
sl@0
|
2289 |
Fail();
|
sl@0
|
2290 |
}
|
sl@0
|
2291 |
|
sl@0
|
2292 |
TestState CTDirect::AnimateWindowL()
|
sl@0
|
2293 |
{
|
sl@0
|
2294 |
// if (!iTimer->IsActive())
|
sl@0
|
2295 |
{
|
sl@0
|
2296 |
|
sl@0
|
2297 |
|
sl@0
|
2298 |
iFrameNo=0;
|
sl@0
|
2299 |
SignalWindow();
|
sl@0
|
2300 |
|
sl@0
|
2301 |
|
sl@0
|
2302 |
iTimer->Start(0,200000,TCallBack(NextFrame,this)); //0.2 secs
|
sl@0
|
2303 |
|
sl@0
|
2304 |
StartDirect();
|
sl@0
|
2305 |
TEST(iDrawingRegion->BoundingRect()==iScrSize);
|
sl@0
|
2306 |
}
|
sl@0
|
2307 |
// else
|
sl@0
|
2308 |
// {
|
sl@0
|
2309 |
// int i=0;
|
sl@0
|
2310 |
// }
|
sl@0
|
2311 |
return EWait;
|
sl@0
|
2312 |
}
|
sl@0
|
2313 |
|
sl@0
|
2314 |
TestState CTDirect::AnimationDiesL()
|
sl@0
|
2315 |
{
|
sl@0
|
2316 |
INFO_PRINTF1(_L("AUTO Animation Dies "));
|
sl@0
|
2317 |
_LIT(ThreadName,"AnimationDie");
|
sl@0
|
2318 |
iFirstFunction=TThreadStartUp(CAnimating::StartLC,(TAny*)iTest->iScreenNumber);
|
sl@0
|
2319 |
CProcess* thread=CProcess::NewThreadL(ThreadName,&iFirstFunction);
|
sl@0
|
2320 |
CleanupStack::PushL(thread);
|
sl@0
|
2321 |
thread->LeaveIfDied();
|
sl@0
|
2322 |
INFO_PRINTF1(_L(" Constructed Thread"));
|
sl@0
|
2323 |
iControlSem.Wait();
|
sl@0
|
2324 |
RWindowGroup group(TheClient->iWs);
|
sl@0
|
2325 |
group.Construct(431,EFalse);
|
sl@0
|
2326 |
RBlankWindow win(TheClient->iWs);
|
sl@0
|
2327 |
win.Construct(group,432);
|
sl@0
|
2328 |
win.SetExtent(TPoint(12,34),TSize(56,78));
|
sl@0
|
2329 |
win.Activate();
|
sl@0
|
2330 |
INFO_PRINTF1(_L(" Constructed Windows"));
|
sl@0
|
2331 |
iControlSem.Wait();
|
sl@0
|
2332 |
User::After(1000000); //1 sec
|
sl@0
|
2333 |
TRequestStatus threadDied;
|
sl@0
|
2334 |
thread->Logon(threadDied);
|
sl@0
|
2335 |
thread->Terminate(KErrGeneral);
|
sl@0
|
2336 |
INFO_PRINTF1(_L(" Waiting for Thread"));
|
sl@0
|
2337 |
User::WaitForRequest(threadDied);
|
sl@0
|
2338 |
CleanupStack::PopAndDestroy(thread);
|
sl@0
|
2339 |
win.Close();
|
sl@0
|
2340 |
group.Close();
|
sl@0
|
2341 |
INFO_PRINTF1(_L(" Finished"));
|
sl@0
|
2342 |
return ENext;
|
sl@0
|
2343 |
}
|
sl@0
|
2344 |
|
sl@0
|
2345 |
TestState CTDirect::PackagingClassL()
|
sl@0
|
2346 |
{
|
sl@0
|
2347 |
ConstrucBlankWindowL();
|
sl@0
|
2348 |
TInt numProcessHandles;
|
sl@0
|
2349 |
RThread().HandleCount(numProcessHandles,iNumThreadHandles);
|
sl@0
|
2350 |
iAnim=CColorAnimation::NewL(iTest->iScreenNumber,1,*this,*TheClient->iGroup,TRect(10,10,630,230),ETrue);
|
sl@0
|
2351 |
return EWait;
|
sl@0
|
2352 |
}
|
sl@0
|
2353 |
|
sl@0
|
2354 |
TestState CTDirect::MultipleL()
|
sl@0
|
2355 |
{
|
sl@0
|
2356 |
TSize scrSize=TheClient->iScreen->SizeInPixels();
|
sl@0
|
2357 |
|
sl@0
|
2358 |
iFlags|=eMultiAnim;
|
sl@0
|
2359 |
iAnims[0]=CColorAnimation::NewL(iTest->iScreenNumber,2,*this,*TheClient->iGroup,
|
sl@0
|
2360 |
TRect(0,10,scrSize.iWidth/3+20,scrSize.iHeight/2-5),EFalse);
|
sl@0
|
2361 |
iAnims[1]=CColorAnimation::NewL(iTest->iScreenNumber,3,*this,*TheClient->iGroup,
|
sl@0
|
2362 |
TRect(10,scrSize.iHeight/2-20,scrSize.iWidth/3-5,scrSize.iHeight),EFalse);
|
sl@0
|
2363 |
iAnims[3]=CColorAnimation::NewL(iTest->iScreenNumber,5,*this,*TheClient->iGroup,
|
sl@0
|
2364 |
TRect(scrSize.iWidth/3-20,scrSize.iHeight/2+5,2*scrSize.iWidth/3+20,scrSize.iHeight-10),EFalse);
|
sl@0
|
2365 |
iAnims[2]=CColorAnimation::NewL(iTest->iScreenNumber,4,*this,*TheClient->iGroup,
|
sl@0
|
2366 |
TRect(scrSize.iWidth/3+5,0,2*scrSize.iWidth/3-5,scrSize.iHeight/2+20),EFalse);
|
sl@0
|
2367 |
iAnims[4]=CColorAnimation::NewL(iTest->iScreenNumber,6,*this,*TheClient->iGroup,
|
sl@0
|
2368 |
TRect(2*scrSize.iWidth/3-20,15,scrSize.iWidth,scrSize.iHeight/2+50),EFalse);
|
sl@0
|
2369 |
iAnims[5]=CColorAnimation::NewL(iTest->iScreenNumber,7,*this,*TheClient->iGroup,
|
sl@0
|
2370 |
TRect(2*scrSize.iWidth/3+5,-20,scrSize.iWidth-15,scrSize.iHeight+10),ETrue);
|
sl@0
|
2371 |
TInt ii;
|
sl@0
|
2372 |
for (ii=0;ii<5;++ii)
|
sl@0
|
2373 |
iAnims[ii]->StartL();
|
sl@0
|
2374 |
_LIT(ThreadName,"MoveWin");
|
sl@0
|
2375 |
|
sl@0
|
2376 |
MoveInterval=100000; //0.1 secs
|
sl@0
|
2377 |
ModeInterval=1200000; //1.2 sec
|
sl@0
|
2378 |
ImmediateModeSwitch=EFalse;
|
sl@0
|
2379 |
iFirstFunction=TThreadStartUp(CMoveWindow::StartLC,(TAny*)iTest->iScreenNumber);
|
sl@0
|
2380 |
iMoveWin=CProcess::NewThreadL(ThreadName,&iFirstFunction);
|
sl@0
|
2381 |
return EWait;
|
sl@0
|
2382 |
}
|
sl@0
|
2383 |
|
sl@0
|
2384 |
TestState CTDirect::MixDsaAndRegionTrackingOnlyL(TBool aWhoExitsLast)
|
sl@0
|
2385 |
{
|
sl@0
|
2386 |
TSize scrSize=TheClient->iScreen->SizeInPixels();
|
sl@0
|
2387 |
|
sl@0
|
2388 |
iFlags|=eMultiAnim;
|
sl@0
|
2389 |
TUint firstRegionTrackinOnlyDsa = (aWhoExitsLast == KRegionTrackingOnlyDsaExistLast ? 0 : 3);
|
sl@0
|
2390 |
TUint firstDrawingDsa = (aWhoExitsLast == KDrawingDsaExistLast ? 0 : 3);
|
sl@0
|
2391 |
|
sl@0
|
2392 |
//DSAs who use region tracking only
|
sl@0
|
2393 |
iAnims[firstRegionTrackinOnlyDsa]=CColorAnimation::NewL(iTest->iScreenNumber,firstRegionTrackinOnlyDsa+27,*this,*TheClient->iGroup,
|
sl@0
|
2394 |
TRect(10,scrSize.iHeight/2-20,scrSize.iWidth/3-5,scrSize.iHeight),EFalse,KRegionTrackingOnly);
|
sl@0
|
2395 |
iAnims[firstRegionTrackinOnlyDsa+1]=CColorAnimation::NewL(iTest->iScreenNumber,firstRegionTrackinOnlyDsa+28,*this,*TheClient->iGroup,
|
sl@0
|
2396 |
TRect(2*scrSize.iWidth/3-20,15,scrSize.iWidth,scrSize.iHeight/2+50),EFalse,KRegionTrackingOnly);
|
sl@0
|
2397 |
iAnims[firstRegionTrackinOnlyDsa+2]=CColorAnimation::NewL(iTest->iScreenNumber,firstRegionTrackinOnlyDsa+29,*this,*TheClient->iGroup,
|
sl@0
|
2398 |
TRect(2*scrSize.iWidth/3+5,-20,scrSize.iWidth-15,scrSize.iHeight+10),EFalse,KRegionTrackingOnly);
|
sl@0
|
2399 |
|
sl@0
|
2400 |
//DSAs who actually draw
|
sl@0
|
2401 |
iAnims[firstDrawingDsa]=CColorAnimation::NewL(iTest->iScreenNumber,firstDrawingDsa+27,*this,*TheClient->iGroup,
|
sl@0
|
2402 |
TRect(0,10,scrSize.iWidth/3+20,scrSize.iHeight/2-5),EFalse,KDrawingDsa);
|
sl@0
|
2403 |
iAnims[firstDrawingDsa+1]=CColorAnimation::NewL(iTest->iScreenNumber,firstDrawingDsa+28,*this,*TheClient->iGroup,
|
sl@0
|
2404 |
TRect(scrSize.iWidth/3+5,0,2*scrSize.iWidth/3-5,scrSize.iHeight/2+20),EFalse,KDrawingDsa);
|
sl@0
|
2405 |
iAnims[firstDrawingDsa+2]=CColorAnimation::NewL(iTest->iScreenNumber,firstDrawingDsa+29,*this,*TheClient->iGroup,
|
sl@0
|
2406 |
TRect(scrSize.iWidth/3-20,scrSize.iHeight/2+5,2*scrSize.iWidth/3+20,scrSize.iHeight-10),EFalse,KDrawingDsa);
|
sl@0
|
2407 |
|
sl@0
|
2408 |
TInt ii;
|
sl@0
|
2409 |
for (ii=0;ii<6;++ii)
|
sl@0
|
2410 |
{
|
sl@0
|
2411 |
if(iAnims[ii])
|
sl@0
|
2412 |
iAnims[ii]->StartL();
|
sl@0
|
2413 |
}
|
sl@0
|
2414 |
|
sl@0
|
2415 |
_LIT(ThreadName,"MoveWin");
|
sl@0
|
2416 |
|
sl@0
|
2417 |
MoveInterval=100000; //0.1 secs
|
sl@0
|
2418 |
ModeInterval=1200000; //1.2 secs
|
sl@0
|
2419 |
ImmediateModeSwitch=EFalse;
|
sl@0
|
2420 |
iFirstFunction=TThreadStartUp(CMoveWindow::StartLC,(TAny*)iTest->iScreenNumber);
|
sl@0
|
2421 |
iMoveWin=CProcess::NewThreadL(ThreadName,&iFirstFunction);
|
sl@0
|
2422 |
return EWait;
|
sl@0
|
2423 |
}
|
sl@0
|
2424 |
|
sl@0
|
2425 |
TestState CTDirect::TryDifferentSupportedModesL()
|
sl@0
|
2426 |
{
|
sl@0
|
2427 |
|
sl@0
|
2428 |
RWsSession session;
|
sl@0
|
2429 |
User::LeaveIfError(session.Connect());
|
sl@0
|
2430 |
CWsScreenDevice* device = new(ELeave) CWsScreenDevice(session);
|
sl@0
|
2431 |
CleanupStack::PushL(device);
|
sl@0
|
2432 |
User::LeaveIfError(device->Construct(iTest->iScreenNumber));
|
sl@0
|
2433 |
TUint numOfModes=device->NumScreenModes();
|
sl@0
|
2434 |
_LIT(KTryingCurrentMode,"Trying Mode = %d");
|
sl@0
|
2435 |
for(TUint currentMode =0; currentMode < numOfModes; currentMode++)
|
sl@0
|
2436 |
{
|
sl@0
|
2437 |
LOG_MESSAGE2(KTryingCurrentMode,currentMode);
|
sl@0
|
2438 |
device->SetScreenMode(currentMode);
|
sl@0
|
2439 |
TRAPD(err,iAnims[0]=CColorAnimation::NewL(iTest->iScreenNumber,4,*this,*TheClient->iGroup,
|
sl@0
|
2440 |
TRect(0,0,50,50),ETrue));
|
sl@0
|
2441 |
if(err!=KErrNone)
|
sl@0
|
2442 |
{
|
sl@0
|
2443 |
TEST(EFalse);
|
sl@0
|
2444 |
}
|
sl@0
|
2445 |
else
|
sl@0
|
2446 |
{
|
sl@0
|
2447 |
User::After(2000000);
|
sl@0
|
2448 |
iAnims[0]->Stop();
|
sl@0
|
2449 |
delete iAnims[0];
|
sl@0
|
2450 |
}
|
sl@0
|
2451 |
}
|
sl@0
|
2452 |
CleanupStack::PopAndDestroy(device);
|
sl@0
|
2453 |
session.Close();
|
sl@0
|
2454 |
iState++;
|
sl@0
|
2455 |
return EWait;
|
sl@0
|
2456 |
}
|
sl@0
|
2457 |
|
sl@0
|
2458 |
|
sl@0
|
2459 |
TestState CTDirect::FailCodesL()
|
sl@0
|
2460 |
{
|
sl@0
|
2461 |
__UHEAP_MARK;
|
sl@0
|
2462 |
TRequestStatus status;
|
sl@0
|
2463 |
RRegion region(TRect(0,0,10,10),1);
|
sl@0
|
2464 |
RRegion* pRegion=®ion;
|
sl@0
|
2465 |
RDirectScreenAccess direct(TheClient->iWs);
|
sl@0
|
2466 |
User::LeaveIfError(direct.Construct());
|
sl@0
|
2467 |
RBlankWindow window(TheClient->iWs);
|
sl@0
|
2468 |
User::LeaveIfError(window.Construct(*TheClient->iGroup->WinTreeNode(),1234));
|
sl@0
|
2469 |
TInt err=direct.Request(pRegion,status,window);
|
sl@0
|
2470 |
TEST(err==KErrNone);
|
sl@0
|
2471 |
if (err!=KErrNone)
|
sl@0
|
2472 |
INFO_PRINTF3(_L("direct.Request(pRegion,status,window) return value - Expected: %d, Actual: %d"), KErrNone, err);
|
sl@0
|
2473 |
TEST(pRegion!=NULL);
|
sl@0
|
2474 |
if (pRegion==NULL)
|
sl@0
|
2475 |
INFO_PRINTF3(_L("pRegion!=NULL - Expected: %d, Actual: %d"), 0, 0);
|
sl@0
|
2476 |
pRegion->Destroy();
|
sl@0
|
2477 |
direct.Cancel();
|
sl@0
|
2478 |
User::WaitForRequest(status);
|
sl@0
|
2479 |
window.Activate();
|
sl@0
|
2480 |
window.SetOrdinalPosition(-2);
|
sl@0
|
2481 |
pRegion=®ion;
|
sl@0
|
2482 |
err=direct.Request(pRegion,status,window);
|
sl@0
|
2483 |
TEST(err==KErrNone);
|
sl@0
|
2484 |
if (err!=KErrNone)
|
sl@0
|
2485 |
INFO_PRINTF3(_L("direct.Request(pRegion,status,window) return value - Expected: %d, Actual: %d"), KErrNone, err);
|
sl@0
|
2486 |
TEST(pRegion!=NULL);
|
sl@0
|
2487 |
if (pRegion==NULL)
|
sl@0
|
2488 |
INFO_PRINTF3(_L("pRegion!=NULL - Expected: %d, Actual: %d"), 0, 0);
|
sl@0
|
2489 |
pRegion->Destroy();
|
sl@0
|
2490 |
direct.Cancel();
|
sl@0
|
2491 |
User::WaitForRequest(status);
|
sl@0
|
2492 |
#if defined(__WINS__)
|
sl@0
|
2493 |
// Loop over the allocations done.
|
sl@0
|
2494 |
// There is one allocating of the rectangle list and
|
sl@0
|
2495 |
// one of the region holding the list
|
sl@0
|
2496 |
for (TInt rate = 1; rate <= 2; rate++)
|
sl@0
|
2497 |
{
|
sl@0
|
2498 |
window.SetOrdinalPosition(0);
|
sl@0
|
2499 |
pRegion=®ion;
|
sl@0
|
2500 |
TheClient->Flush();
|
sl@0
|
2501 |
__UHEAP_FAILNEXT(rate);
|
sl@0
|
2502 |
err=direct.Request(pRegion,status,window);
|
sl@0
|
2503 |
TEST(err==KErrNoMemory);
|
sl@0
|
2504 |
if (err!=KErrNoMemory)
|
sl@0
|
2505 |
INFO_PRINTF3(_L("direct.Request(pRegion,status,window) return value - Expected: %d, Actual: %d"), KErrNoMemory, err);
|
sl@0
|
2506 |
|
sl@0
|
2507 |
TEST(pRegion==NULL);
|
sl@0
|
2508 |
if (pRegion!=NULL)
|
sl@0
|
2509 |
INFO_PRINTF3(_L("pRegion!=NULL - Expected: %d, Actual: %d"), 0, 0);
|
sl@0
|
2510 |
}
|
sl@0
|
2511 |
#endif
|
sl@0
|
2512 |
window.Close();
|
sl@0
|
2513 |
direct.Close();
|
sl@0
|
2514 |
region.Close();
|
sl@0
|
2515 |
__UHEAP_MARKEND;
|
sl@0
|
2516 |
return ENext;
|
sl@0
|
2517 |
}
|
sl@0
|
2518 |
|
sl@0
|
2519 |
void CTDirect::ScrolingTextL(TInt aId,TRect aWinRect,TBool aStartThread,TInt aScreenMode/*=0*/)
|
sl@0
|
2520 |
{
|
sl@0
|
2521 |
INFO_PRINTF1(_L("AUTO Construct ScrolingText "));
|
sl@0
|
2522 |
INFO_PRINTF1(_L(" Constructed Window"));
|
sl@0
|
2523 |
iCycles=0;
|
sl@0
|
2524 |
TInt numProcessHandles;
|
sl@0
|
2525 |
RThread().HandleCount(numProcessHandles,iNumThreadHandles);
|
sl@0
|
2526 |
iAnim=CColorAnimation::NewL(iTest->iScreenNumber,aId,*this,*TheClient->iGroup,aWinRect,EFalse);
|
sl@0
|
2527 |
iScroll=CScrollText::NewL(iTest->iScreenNumber,1,*TheClient->iGroup,5,EFalse);
|
sl@0
|
2528 |
INFO_PRINTF1(_L(" Constructed Text Scroller & Animation"));
|
sl@0
|
2529 |
iAnim->BringWindowToFront();
|
sl@0
|
2530 |
if (aStartThread)
|
sl@0
|
2531 |
{
|
sl@0
|
2532 |
_LIT(ThreadName,"MoveWin");
|
sl@0
|
2533 |
INFO_PRINTF1(_L(" About to constructed Thread"));
|
sl@0
|
2534 |
iFirstFunction=TThreadStartUp(CMoveWindow::StartLC,(TAny*)iTest->iScreenNumber);
|
sl@0
|
2535 |
__ASSERT_DEBUG(!iMoveWin,AutoPanic(EAutoPanicDirect));
|
sl@0
|
2536 |
iMoveWin=CProcess::NewThreadL(ThreadName,&iFirstFunction);
|
sl@0
|
2537 |
INFO_PRINTF1(_L(" Constructed Thread"));
|
sl@0
|
2538 |
}
|
sl@0
|
2539 |
if (aScreenMode>0)
|
sl@0
|
2540 |
{
|
sl@0
|
2541 |
TInt numScreenModes = TheClient->iScreen->NumScreenModes();
|
sl@0
|
2542 |
if (aScreenMode < numScreenModes)
|
sl@0
|
2543 |
TheClient->iScreen->SetScreenMode(aScreenMode);
|
sl@0
|
2544 |
else
|
sl@0
|
2545 |
LOG_MESSAGE(_L("WARNING: Failed to change screen mode"));
|
sl@0
|
2546 |
// We have to run the test anyway to avoid things going wrong later
|
sl@0
|
2547 |
}
|
sl@0
|
2548 |
iAnim->StartOrPanic();
|
sl@0
|
2549 |
iScroll->StartL();
|
sl@0
|
2550 |
INFO_PRINTF1(_L(" Constructed/Started"));
|
sl@0
|
2551 |
#if defined(LOGGING)
|
sl@0
|
2552 |
_LIT(KStarted,"Finished StartUp ScrollText");
|
sl@0
|
2553 |
LogMessageText.Copy(KStarted);
|
sl@0
|
2554 |
TheClient->iWs.LogMessage(LogMessageText);
|
sl@0
|
2555 |
TheClient->Flush();
|
sl@0
|
2556 |
#endif
|
sl@0
|
2557 |
}
|
sl@0
|
2558 |
|
sl@0
|
2559 |
TestState CTDirect::ScrolingText1L()
|
sl@0
|
2560 |
{
|
sl@0
|
2561 |
MoveInterval=0;
|
sl@0
|
2562 |
ModeInterval=1200000; //1.2 sec
|
sl@0
|
2563 |
ScrolingTextL(8,TRect(20,20,40,40),ETrue);
|
sl@0
|
2564 |
return EWait;
|
sl@0
|
2565 |
}
|
sl@0
|
2566 |
|
sl@0
|
2567 |
TestState CTDirect::RClassL()
|
sl@0
|
2568 |
{
|
sl@0
|
2569 |
#if defined(LOGGING)
|
sl@0
|
2570 |
_LIT(KRClass,"Starting Panic test on RClass");
|
sl@0
|
2571 |
LogMessageText.Zero();
|
sl@0
|
2572 |
LogMessageText.AppendFormat(KRClass);
|
sl@0
|
2573 |
TheClient->iWs.LogMessage(LogMessageText);
|
sl@0
|
2574 |
TheClient->Flush();
|
sl@0
|
2575 |
#endif
|
sl@0
|
2576 |
TEST(iTest->TestWsPanicL(CPanicDirect::DoTestOnNewScheduler,EWservPanicDirectMisuse,1,(TAny*)iTest->iScreenNumber));
|
sl@0
|
2577 |
#if defined(LOGGING)
|
sl@0
|
2578 |
_LIT(KPanic1,"Done First Panic");
|
sl@0
|
2579 |
LogMessageText.Zero();
|
sl@0
|
2580 |
LogMessageText.AppendFormat(KPanic1);
|
sl@0
|
2581 |
TheClient->iWs.LogMessage(LogMessageText);
|
sl@0
|
2582 |
TheClient->Flush();
|
sl@0
|
2583 |
#endif
|
sl@0
|
2584 |
#if defined(__WINS__)
|
sl@0
|
2585 |
#if defined(LOGGING)
|
sl@0
|
2586 |
_LIT(KPanic2,"Doing 2 debug panics");
|
sl@0
|
2587 |
LogMessageText.Zero();
|
sl@0
|
2588 |
LogMessageText.AppendFormat(KPanic2);
|
sl@0
|
2589 |
TheClient->iWs.LogMessage(LogMessageText);
|
sl@0
|
2590 |
TheClient->Flush();
|
sl@0
|
2591 |
#endif
|
sl@0
|
2592 |
TEST(iTest->TestW32PanicL(CPanicDirect::DoTestOnNewScheduler,EW32PanicDirectMisuse,2,(TAny*)iTest->iScreenNumber));
|
sl@0
|
2593 |
TEST(iTest->TestW32PanicL(CPanicDirect::DoTestOnNewScheduler,EW32PanicDirectMisuse,3,(TAny*)iTest->iScreenNumber));
|
sl@0
|
2594 |
#endif
|
sl@0
|
2595 |
#if defined(LOGGING)
|
sl@0
|
2596 |
_LIT(KPanicTest,"Trying Panic %d");
|
sl@0
|
2597 |
LogMessageText.Zero();
|
sl@0
|
2598 |
LogMessageText.AppendFormat(KPanicTest,4);
|
sl@0
|
2599 |
TheClient->iWs.LogMessage(LogMessageText);
|
sl@0
|
2600 |
TheClient->Flush();
|
sl@0
|
2601 |
#endif
|
sl@0
|
2602 |
TEST(iTest->TestWsPanicL(CPanicDirect::DoTestOnNewScheduler,EWservPanicDirectMisuse,4,(TAny*)iTest->iScreenNumber));
|
sl@0
|
2603 |
TEST(iTest->TestW32PanicL(CPanicDirect::DoTestOnNewScheduler,EW32PanicDirectMisuse,5,(TAny*)iTest->iScreenNumber));
|
sl@0
|
2604 |
return ENext;
|
sl@0
|
2605 |
}
|
sl@0
|
2606 |
|
sl@0
|
2607 |
TestState CTDirect::ScrolingText2L()
|
sl@0
|
2608 |
{
|
sl@0
|
2609 |
MoveInterval=81234; //0.08 sec
|
sl@0
|
2610 |
ModeInterval=140123; //0.14 sec
|
sl@0
|
2611 |
ImmediateModeSwitch=2;
|
sl@0
|
2612 |
ScrolingTextL(9,TRect(15,25,45,35),ETrue);
|
sl@0
|
2613 |
iScroll->SetCountDown(5);
|
sl@0
|
2614 |
return EWait;
|
sl@0
|
2615 |
}
|
sl@0
|
2616 |
|
sl@0
|
2617 |
TestState CTDirect::ScrolingText3L()
|
sl@0
|
2618 |
{
|
sl@0
|
2619 |
iModeBackup=TheClient->iScreen->ScreenModeEnforcement();
|
sl@0
|
2620 |
if (iModeBackup!=ESizeEnforcementNone)
|
sl@0
|
2621 |
TheClient->iScreen->SetScreenModeEnforcement(ESizeEnforcementNone);
|
sl@0
|
2622 |
MoveInterval=0;
|
sl@0
|
2623 |
ModeInterval=0;
|
sl@0
|
2624 |
FlipInterval=1200000; //1.2 secs
|
sl@0
|
2625 |
ScrolingTextL(10,TRect(25,30,35,45),ETrue,1);
|
sl@0
|
2626 |
iScroll->SetBottomOfTest(80); //So it can be seen in both screen modes
|
sl@0
|
2627 |
return EWait;
|
sl@0
|
2628 |
}
|
sl@0
|
2629 |
|
sl@0
|
2630 |
TestState CTDirect::ScrolingText4L()
|
sl@0
|
2631 |
{
|
sl@0
|
2632 |
iModeBackup=TheClient->iScreen->ScreenModeEnforcement();
|
sl@0
|
2633 |
if (iModeBackup!=ESizeEnforcementNone)
|
sl@0
|
2634 |
TheClient->iScreen->SetScreenModeEnforcement(ESizeEnforcementNone);
|
sl@0
|
2635 |
MoveInterval=876543; //0.88 secs
|
sl@0
|
2636 |
ModeInterval=2178900; //2.18 secs
|
sl@0
|
2637 |
FlipInterval=5000000; //5 secs
|
sl@0
|
2638 |
ScrolingTextL(11,TRect(30,40,55,65),ETrue);
|
sl@0
|
2639 |
iScroll->SetBottomOfTest(80); //So it can be seen in both screen modes
|
sl@0
|
2640 |
return EWait;
|
sl@0
|
2641 |
}
|
sl@0
|
2642 |
|
sl@0
|
2643 |
void CTDirect::CreateAnimForScreenModeL(TInt aAnimIndex,CTWinBase& aParent,TRect aRect,TInt aId)
|
sl@0
|
2644 |
{
|
sl@0
|
2645 |
iAnims[aAnimIndex]=CColorAnimation::NewL(iTest->iScreenNumber,aId,*this,aParent,aRect,EFalse);
|
sl@0
|
2646 |
iAnims[aAnimIndex]->StartL();
|
sl@0
|
2647 |
iAnims[aAnimIndex]->BringWindowToFront();
|
sl@0
|
2648 |
}
|
sl@0
|
2649 |
|
sl@0
|
2650 |
void CTDirect::BlankTopClientWindowL(CTBlankWindow& aBlankWindow,TRect aRect)
|
sl@0
|
2651 |
{
|
sl@0
|
2652 |
aBlankWindow.ConstructExtLD(*TheClient->iGroup,aRect.iTl,aRect.Size());
|
sl@0
|
2653 |
User::LeaveIfError(aBlankWindow.BaseWin()->SetRequiredDisplayMode(EColor256));
|
sl@0
|
2654 |
aBlankWindow.BaseWin()->SetShadowDisabled(ETrue);
|
sl@0
|
2655 |
aBlankWindow.Activate();
|
sl@0
|
2656 |
}
|
sl@0
|
2657 |
|
sl@0
|
2658 |
static TInt ChangeScreenModeL(TAny* aTest)
|
sl@0
|
2659 |
{
|
sl@0
|
2660 |
STATIC_CAST(CTDirect*,aTest)->ChangeToNextScreenModeL();
|
sl@0
|
2661 |
return KErrNone;
|
sl@0
|
2662 |
}
|
sl@0
|
2663 |
|
sl@0
|
2664 |
void CTDirect::ChangeToNextScreenModeL()
|
sl@0
|
2665 |
{
|
sl@0
|
2666 |
#if defined(LOGGING)
|
sl@0
|
2667 |
_LIT(KChangeMode,"AUTO Screen Mode Pos Test2 CallBack");
|
sl@0
|
2668 |
LogMessageText.Copy(KChangeMode);
|
sl@0
|
2669 |
TheClient->LogMessage(LogMessageText);
|
sl@0
|
2670 |
TheClient->iWs.LogCommand(RWsSession::ELoggingStatusDump);
|
sl@0
|
2671 |
#endif
|
sl@0
|
2672 |
iNumOfModes=TheClient->iScreen->NumScreenModes();
|
sl@0
|
2673 |
if (iCurrentMode<iNumOfModes)
|
sl@0
|
2674 |
{
|
sl@0
|
2675 |
TPixelsAndRotation pixelsAndRotation;
|
sl@0
|
2676 |
SetScreenMode(iCurrentMode,pixelsAndRotation);
|
sl@0
|
2677 |
TInt oldCurrentMode=iCurrentMode;
|
sl@0
|
2678 |
CArrayFixFlat<TInt>* rotations=new(ELeave) CArrayFixFlat<TInt>(1);
|
sl@0
|
2679 |
CleanupStack::PushL(rotations);
|
sl@0
|
2680 |
User::LeaveIfError(TheClient->iScreen->GetRotationsList(iCurrentMode,rotations));
|
sl@0
|
2681 |
TInt count=rotations->Count();
|
sl@0
|
2682 |
TInt jj=0;
|
sl@0
|
2683 |
if (count>1)
|
sl@0
|
2684 |
{
|
sl@0
|
2685 |
for (jj=0;jj<count;)
|
sl@0
|
2686 |
{
|
sl@0
|
2687 |
if ((*rotations)[jj++]==pixelsAndRotation.iRotation)
|
sl@0
|
2688 |
{
|
sl@0
|
2689 |
break;
|
sl@0
|
2690 |
}
|
sl@0
|
2691 |
}
|
sl@0
|
2692 |
if (jj==count)
|
sl@0
|
2693 |
{
|
sl@0
|
2694 |
jj=0;
|
sl@0
|
2695 |
}
|
sl@0
|
2696 |
}
|
sl@0
|
2697 |
if (jj==0)
|
sl@0
|
2698 |
{
|
sl@0
|
2699 |
iCurrentMode++;
|
sl@0
|
2700 |
}
|
sl@0
|
2701 |
TInt currentRotation=(*rotations)[jj];
|
sl@0
|
2702 |
TheClient->iScreen->SetCurrentRotations(oldCurrentMode,REINTERPRET_CAST(CFbsBitGc::TGraphicsOrientation&,currentRotation));
|
sl@0
|
2703 |
CleanupStack::PopAndDestroy(rotations);
|
sl@0
|
2704 |
TheClient->iScreen->GetScreenModeSizeAndRotation(oldCurrentMode,pixelsAndRotation);
|
sl@0
|
2705 |
TInt screenWidth=pixelsAndRotation.iPixelSize.iWidth;
|
sl@0
|
2706 |
TInt screenHeight=pixelsAndRotation.iPixelSize.iHeight;
|
sl@0
|
2707 |
TPoint screenModeOrigin=TheClient->iScreen->GetScreenModeScaledOrigin(oldCurrentMode);
|
sl@0
|
2708 |
TPoint point1(screenModeOrigin.iX,screenModeOrigin.iY+(screenModeOrigin.iY+screenHeight)/2);
|
sl@0
|
2709 |
TPoint point2(screenModeOrigin.iX+(screenModeOrigin.iX+screenWidth)/2,screenHeight+screenModeOrigin.iY);
|
sl@0
|
2710 |
TRect rect0(point1,point2);
|
sl@0
|
2711 |
TRect rect1(TPoint(0,0),rect0.Size());
|
sl@0
|
2712 |
CreateAnimForScreenModeL(0,*TheClient->iGroup,rect1,14);
|
sl@0
|
2713 |
TPoint pos=iAnims[0]->AbsoluteWindowPosition();
|
sl@0
|
2714 |
TEST(pos==TPoint(0,0));
|
sl@0
|
2715 |
}
|
sl@0
|
2716 |
}
|
sl@0
|
2717 |
|
sl@0
|
2718 |
TInt ChangeScreenScaleCallBack(TAny* aTest)
|
sl@0
|
2719 |
{
|
sl@0
|
2720 |
static_cast<CTDirect*>(aTest)->ChangeScreenScale();
|
sl@0
|
2721 |
return KErrNone;
|
sl@0
|
2722 |
}
|
sl@0
|
2723 |
|
sl@0
|
2724 |
void CTDirect::ChangeScreenScale()
|
sl@0
|
2725 |
{
|
sl@0
|
2726 |
if (!iNumOfCallBack)
|
sl@0
|
2727 |
{
|
sl@0
|
2728 |
iCurrentMode=TheClient->iScreen->CurrentScreenMode();
|
sl@0
|
2729 |
iModeData=TheClient->iScreen->GetCurrentScreenModeAttributes();
|
sl@0
|
2730 |
iModeData.iScreenScale.SetSize(1,1);
|
sl@0
|
2731 |
}
|
sl@0
|
2732 |
TSizeMode testMode=iModeData;
|
sl@0
|
2733 |
if (!iNumOfCallBack)
|
sl@0
|
2734 |
{
|
sl@0
|
2735 |
testMode.iScreenScale.SetSize(2,2);
|
sl@0
|
2736 |
}
|
sl@0
|
2737 |
else if (iNumOfCallBack==1)
|
sl@0
|
2738 |
{
|
sl@0
|
2739 |
testMode.iScreenScale.SetSize(3,2);
|
sl@0
|
2740 |
}
|
sl@0
|
2741 |
else if (iNumOfCallBack==2)
|
sl@0
|
2742 |
{
|
sl@0
|
2743 |
testMode.iScreenScale.SetSize(2,3);
|
sl@0
|
2744 |
}
|
sl@0
|
2745 |
TheClient->iScreen->SetCurrentScreenModeAttributes(testMode);
|
sl@0
|
2746 |
TheClient->iScreen->SetAppScreenMode(iCurrentMode);
|
sl@0
|
2747 |
TheClient->iScreen->SetScreenMode(iCurrentMode);
|
sl@0
|
2748 |
if (iNumOfCallBack==2)
|
sl@0
|
2749 |
{
|
sl@0
|
2750 |
iScreenModeTimer->Cancel();
|
sl@0
|
2751 |
delete iScreenModeTimer;
|
sl@0
|
2752 |
iScreenModeTimer=NULL;
|
sl@0
|
2753 |
}
|
sl@0
|
2754 |
iNumOfCallBack++;
|
sl@0
|
2755 |
}
|
sl@0
|
2756 |
|
sl@0
|
2757 |
/*
|
sl@0
|
2758 |
* Creates a DSA for screen mode 0. After DSA has displayd 2 or 3 frames screen mode
|
sl@0
|
2759 |
* scale is changed with a timer. The DSA aborts and restarts once again
|
sl@0
|
2760 |
* and completes itself in different screen mode.
|
sl@0
|
2761 |
*/
|
sl@0
|
2762 |
TestState CTDirect::ScreenModeTestForScalingL()
|
sl@0
|
2763 |
{
|
sl@0
|
2764 |
CreateAnimForScreenModeL(0,*TheClient->iGroup,TRect(TSize(10,10)),19);
|
sl@0
|
2765 |
iScreenModeTimer=CPeriodic::NewL(0);
|
sl@0
|
2766 |
MoveInterval=2000000;
|
sl@0
|
2767 |
iScreenModeTimer->Start(1000,MoveInterval,TCallBack(ChangeScreenScaleCallBack,this));
|
sl@0
|
2768 |
return EWait;
|
sl@0
|
2769 |
}
|
sl@0
|
2770 |
|
sl@0
|
2771 |
/*
|
sl@0
|
2772 |
* Creates a DSA for screen mode 0, tests API AbsoluteWindowPosition()
|
sl@0
|
2773 |
* Then sets screen mode to last(test) screen mode, here it does the same thing as
|
sl@0
|
2774 |
* done for screenmode 0, but with diffrerent scale (2,2) (2,3) (3,2) (3,3) and
|
sl@0
|
2775 |
* with different origin (20,30) (30,20) (20,20).
|
sl@0
|
2776 |
* Lastly copy back the test screen mode values.
|
sl@0
|
2777 |
*/
|
sl@0
|
2778 |
TestState CTDirect::ScreenModeScalingTestL()
|
sl@0
|
2779 |
{
|
sl@0
|
2780 |
#if defined(LOGGING)
|
sl@0
|
2781 |
INFO_PRINTF1("AUTO ScreenModeScalingTest ");
|
sl@0
|
2782 |
#else
|
sl@0
|
2783 |
// DisabledStartLogText();
|
sl@0
|
2784 |
#endif
|
sl@0
|
2785 |
INFO_PRINTF1(_L(" Switch to mode 0"));
|
sl@0
|
2786 |
iModeData.iScreenScale.iWidth=1;
|
sl@0
|
2787 |
iModeData.iScreenScale.iHeight=1;
|
sl@0
|
2788 |
TheClient->iScreen->SetCurrentScreenModeAttributes(iModeData);
|
sl@0
|
2789 |
TheClient->iScreen->SetAppScreenMode(0);
|
sl@0
|
2790 |
TheClient->iScreen->SetScreenMode(0);
|
sl@0
|
2791 |
iCurrentMode=0;
|
sl@0
|
2792 |
INFO_PRINTF1(_L(" Get Parameters"));
|
sl@0
|
2793 |
iCurrentScreenModeOrigin=TheClient->iScreen->GetDefaultScreenModeOrigin();
|
sl@0
|
2794 |
iCurrentScreenModeScale=TheClient->iScreen->GetCurrentScreenModeScale();
|
sl@0
|
2795 |
Copy2ndHalfOfScreen=(iCurrentScreenModeOrigin.iX>FullScreenModeSize.iWidth/2? 1 : 0);
|
sl@0
|
2796 |
TRect testWinRect(PhysicalToLogical(TPoint(),iCurrentScreenModeScale),
|
sl@0
|
2797 |
PhysicalToLogical(TPoint((Copy2ndHalfOfScreen ? FullScreenModeSize.iWidth :
|
sl@0
|
2798 |
FullScreenModeSize.iWidth/2),
|
sl@0
|
2799 |
FullScreenModeSize.iHeight)-
|
sl@0
|
2800 |
iCurrentScreenModeOrigin,iCurrentScreenModeScale)
|
sl@0
|
2801 |
);
|
sl@0
|
2802 |
testWinRect.Shrink(10,10);
|
sl@0
|
2803 |
INFO_PRINTF1(_L(" Create Animation"));
|
sl@0
|
2804 |
CreateAnimForScreenModeL(0,*TheClient->iGroup,testWinRect,17);
|
sl@0
|
2805 |
TPoint pos0=iAnims[0]->AbsoluteWindowPosition();
|
sl@0
|
2806 |
TEST(pos0==TPoint(10,10));
|
sl@0
|
2807 |
|
sl@0
|
2808 |
TInt numOfModes=TheClient->iScreen->NumScreenModes();
|
sl@0
|
2809 |
iCurrentMode=numOfModes-1;
|
sl@0
|
2810 |
INFO_PRINTF1(_L(" Switch to Last Mode"));
|
sl@0
|
2811 |
TheClient->iScreen->SetAppScreenMode(iCurrentMode);
|
sl@0
|
2812 |
TheClient->iScreen->SetScreenMode(iCurrentMode);
|
sl@0
|
2813 |
TSizeMode storeModeData=TheClient->iScreen->GetCurrentScreenModeAttributes();
|
sl@0
|
2814 |
TSizeMode testMode=storeModeData;
|
sl@0
|
2815 |
iNumAnimation=0;
|
sl@0
|
2816 |
for (TInt xScale=2;xScale<4;xScale++)
|
sl@0
|
2817 |
{
|
sl@0
|
2818 |
INFO_PRINTF1(_L(" New X-Scale"));
|
sl@0
|
2819 |
for (TInt yScale=2;yScale<4;yScale++)
|
sl@0
|
2820 |
{
|
sl@0
|
2821 |
INFO_PRINTF1(_L(" New Y-Scale"));
|
sl@0
|
2822 |
testMode.iScreenScale=TSize(xScale,yScale);
|
sl@0
|
2823 |
TestDifferentOriginAndScaleL(testMode,TPoint(20,20));
|
sl@0
|
2824 |
TestDifferentOriginAndScaleL(testMode,TPoint(20,30));
|
sl@0
|
2825 |
TestDifferentOriginAndScaleL(testMode,TPoint(30,20));
|
sl@0
|
2826 |
}
|
sl@0
|
2827 |
}
|
sl@0
|
2828 |
TheClient->iScreen->SetScreenMode(iCurrentMode);
|
sl@0
|
2829 |
TheClient->iScreen->SetCurrentScreenModeAttributes(storeModeData);
|
sl@0
|
2830 |
INFO_PRINTF1(_L(" Set To Mode 0"));
|
sl@0
|
2831 |
TheClient->iScreen->SetAppScreenMode(0);
|
sl@0
|
2832 |
TheClient->iScreen->SetScreenMode(0);
|
sl@0
|
2833 |
return EWait;
|
sl@0
|
2834 |
}
|
sl@0
|
2835 |
|
sl@0
|
2836 |
void CTDirect::TestDifferentOriginAndScaleL(TSizeMode &aMode,TPoint aOrigin)
|
sl@0
|
2837 |
{
|
sl@0
|
2838 |
aMode.iOrigin=aOrigin;
|
sl@0
|
2839 |
TheClient->iScreen->SetCurrentScreenModeAttributes(aMode);
|
sl@0
|
2840 |
TheClient->iScreen->SetAppScreenMode(iCurrentMode);
|
sl@0
|
2841 |
TheClient->iScreen->SetScreenMode(iCurrentMode);
|
sl@0
|
2842 |
iCurrentScreenModeOrigin=TheClient->iScreen->GetScreenModeOrigin(iCurrentMode);
|
sl@0
|
2843 |
iCurrentScreenModeScale=TheClient->iScreen->GetScreenModeScale(iCurrentMode);
|
sl@0
|
2844 |
Copy2ndHalfOfScreen=(iCurrentScreenModeOrigin.iX>FullScreenModeSize.iWidth/2? 1 : 0);
|
sl@0
|
2845 |
TRect testWinRect(PhysicalToLogical(TPoint(),iCurrentScreenModeScale),
|
sl@0
|
2846 |
PhysicalToLogical(TPoint((Copy2ndHalfOfScreen ? FullScreenModeSize.iWidth
|
sl@0
|
2847 |
: FullScreenModeSize.iWidth/2),
|
sl@0
|
2848 |
FullScreenModeSize.iHeight)
|
sl@0
|
2849 |
-iCurrentScreenModeOrigin,iCurrentScreenModeScale)
|
sl@0
|
2850 |
);
|
sl@0
|
2851 |
testWinRect.Shrink(10,10);
|
sl@0
|
2852 |
++iNumAnimation;
|
sl@0
|
2853 |
CreateAnimForScreenModeL(iNumAnimation,*TheClient->iGroup,testWinRect,18);
|
sl@0
|
2854 |
TPoint pos0=iAnims[iNumAnimation]->AbsoluteWindowPosition();
|
sl@0
|
2855 |
TEST(pos0==TPoint(10,10));
|
sl@0
|
2856 |
}
|
sl@0
|
2857 |
|
sl@0
|
2858 |
//REQUIREMENT: CR PHAR-5SJGAM, PREQ673
|
sl@0
|
2859 |
//Tests that DSA works correctly in screen modes with non-zero screen mode origin.
|
sl@0
|
2860 |
TestState CTDirect::DSAWithScreenModeOffset1L()
|
sl@0
|
2861 |
{
|
sl@0
|
2862 |
TPoint screenModeTwoOrigin=TheClient->iScreen->GetScreenModeScaledOrigin(2);
|
sl@0
|
2863 |
TPixelsAndRotation pixelsAndRotation;
|
sl@0
|
2864 |
TheClient->iScreen->GetScreenModeSizeAndRotation(2,pixelsAndRotation);
|
sl@0
|
2865 |
if(pixelsAndRotation.iRotation != CFbsBitGc::EGraphicsOrientationNormal)
|
sl@0
|
2866 |
{
|
sl@0
|
2867 |
TheClient->iScreen->SetCurrentRotations(2, CFbsBitGc::EGraphicsOrientationNormal);
|
sl@0
|
2868 |
}
|
sl@0
|
2869 |
TheClient->iScreen->GetScreenModeSizeAndRotation(2,pixelsAndRotation);
|
sl@0
|
2870 |
//check that the current rotation is normal
|
sl@0
|
2871 |
__ASSERT_DEBUG(pixelsAndRotation.iRotation==CFbsBitGc::EGraphicsOrientationNormal,AutoPanic(EAutoPanicDirect));
|
sl@0
|
2872 |
TInt screenWidthMode2=pixelsAndRotation.iPixelSize.iWidth;
|
sl@0
|
2873 |
TInt screenHeightMode2=pixelsAndRotation.iPixelSize.iHeight;
|
sl@0
|
2874 |
TPoint point1(screenModeTwoOrigin.iX,screenModeTwoOrigin.iY+(screenModeTwoOrigin.iY+screenHeightMode2)/2);
|
sl@0
|
2875 |
TPoint point2(screenModeTwoOrigin.iX+(screenModeTwoOrigin.iX+screenWidthMode2)/2,screenHeightMode2+screenModeTwoOrigin.iY);
|
sl@0
|
2876 |
TPoint point3(screenModeTwoOrigin.iX+screenWidthMode2,screenModeTwoOrigin.iY+screenHeightMode2);
|
sl@0
|
2877 |
|
sl@0
|
2878 |
SetScreenMode(0,pixelsAndRotation);
|
sl@0
|
2879 |
TRect rect0(point1,point2);
|
sl@0
|
2880 |
CreateAnimForScreenModeL(0,*TheClient->iGroup,rect0,13);
|
sl@0
|
2881 |
TPoint pos0=iAnims[0]->AbsoluteWindowPosition();
|
sl@0
|
2882 |
TEST(pos0==point1);
|
sl@0
|
2883 |
|
sl@0
|
2884 |
SetScreenMode(2,pixelsAndRotation);
|
sl@0
|
2885 |
TRect rect1(TPoint(0,0),rect0.Size());
|
sl@0
|
2886 |
CreateAnimForScreenModeL(1,*TheClient->iGroup,rect1,13);
|
sl@0
|
2887 |
TPoint pos1=iAnims[1]->AbsoluteWindowPosition();
|
sl@0
|
2888 |
TEST(pos1==rect1.iTl);
|
sl@0
|
2889 |
|
sl@0
|
2890 |
SetScreenMode(0,pixelsAndRotation);
|
sl@0
|
2891 |
iBlankTopClientWin1=new(ELeave) CTBlankWindow();
|
sl@0
|
2892 |
// TInt ordpos = iBlankTopClientWin1->BaseWin()->OrdinalPosition();
|
sl@0
|
2893 |
TRect rect2(TPoint(point2.iX,point1.iY),point3);
|
sl@0
|
2894 |
BlankTopClientWindowL(*iBlankTopClientWin1,rect2);
|
sl@0
|
2895 |
TInt x=rect2.Size().iWidth/4;
|
sl@0
|
2896 |
TPoint animWinPt(x,0);
|
sl@0
|
2897 |
rect2.Shrink(x,0);
|
sl@0
|
2898 |
CreateAnimForScreenModeL(2,*iBlankTopClientWin1,TRect(animWinPt,rect2.Size()),13);
|
sl@0
|
2899 |
TPoint pos2=iAnims[2]->AbsoluteWindowPosition();
|
sl@0
|
2900 |
TEST(pos2==rect2.iTl);
|
sl@0
|
2901 |
|
sl@0
|
2902 |
SetScreenMode(2,pixelsAndRotation);
|
sl@0
|
2903 |
iBlankTopClientWin2=new(ELeave) CTBlankWindow();
|
sl@0
|
2904 |
// ordpos = iBlankTopClientWin2->BaseWin()->OrdinalPosition();
|
sl@0
|
2905 |
TPoint tl(rect1.iBr.iX,0);
|
sl@0
|
2906 |
TRect rect3(tl,TPoint(screenWidthMode2,rect1.iBr.iY));
|
sl@0
|
2907 |
BlankTopClientWindowL(*iBlankTopClientWin2,rect3);
|
sl@0
|
2908 |
x=rect3.Size().iWidth/4;
|
sl@0
|
2909 |
animWinPt=TPoint(x,0);
|
sl@0
|
2910 |
rect3.Shrink(x,0);
|
sl@0
|
2911 |
CreateAnimForScreenModeL(3,*iBlankTopClientWin2,TRect(animWinPt,rect3.Size()),13);
|
sl@0
|
2912 |
TPoint pos3=iAnims[3]->AbsoluteWindowPosition();
|
sl@0
|
2913 |
TEST(pos3==(animWinPt+tl));
|
sl@0
|
2914 |
|
sl@0
|
2915 |
SetScreenMode(0,pixelsAndRotation);
|
sl@0
|
2916 |
return EWait;
|
sl@0
|
2917 |
}
|
sl@0
|
2918 |
|
sl@0
|
2919 |
//REQUIREMENT: CR PHAR-5SJGAM, PREQ673
|
sl@0
|
2920 |
//Tests that DSA works correctly in screen modes with non-zero screen mode origin and different rotations
|
sl@0
|
2921 |
TestState CTDirect::DSAWithScreenModeOffset2L()
|
sl@0
|
2922 |
{
|
sl@0
|
2923 |
iCurrentMode=0;
|
sl@0
|
2924 |
TTimeIntervalMicroSeconds32 timeBetweenScreenModeChange=3200000;
|
sl@0
|
2925 |
iCallBackWin->WinTreeNode()->SetOrdinalPosition(0);
|
sl@0
|
2926 |
iCallBackWin->SetVisible(ETrue); //Used to forsce screen into Color256 so that it will rotate
|
sl@0
|
2927 |
iChangeScreenModeTimer=CPeriodic::NewL(0);
|
sl@0
|
2928 |
iChangeScreenModeTimer->Start(0,timeBetweenScreenModeChange,TCallBack(ChangeScreenModeL,this));
|
sl@0
|
2929 |
return EWait;
|
sl@0
|
2930 |
}
|
sl@0
|
2931 |
|
sl@0
|
2932 |
void CTDirect::SetScreenMode(TInt aMode,TPixelsAndRotation& aPixelsAndRotation)
|
sl@0
|
2933 |
{
|
sl@0
|
2934 |
TheClient->iScreen->SetScreenMode(aMode);
|
sl@0
|
2935 |
TheClient->iScreen->SetScreenModeEnforcement(ESizeEnforcementNone);
|
sl@0
|
2936 |
TheClient->iScreen->GetDefaultScreenSizeAndRotation(aPixelsAndRotation);
|
sl@0
|
2937 |
TheClient->iScreen->SetScreenSizeAndRotation(aPixelsAndRotation);
|
sl@0
|
2938 |
TheClient->Flush();
|
sl@0
|
2939 |
}
|
sl@0
|
2940 |
|
sl@0
|
2941 |
TestState CTDirect::DefectFix_KAA_5J3BLW_L()
|
sl@0
|
2942 |
{
|
sl@0
|
2943 |
TInt numProcessHandles;
|
sl@0
|
2944 |
RThread().HandleCount(numProcessHandles,iNumThreadHandles);
|
sl@0
|
2945 |
const TSize screenSize(TheClient->iScreen->SizeInPixels());
|
sl@0
|
2946 |
const TRect dsaRect(0,0,screenSize.iWidth>>2,screenSize.iHeight>>2);
|
sl@0
|
2947 |
iAnim=CBugFixColorAnimation::NewL(iTest->iScreenNumber, 1, *this, *TheClient->iGroup, dsaRect,ETrue);
|
sl@0
|
2948 |
return EWait;
|
sl@0
|
2949 |
}
|
sl@0
|
2950 |
|
sl@0
|
2951 |
TestState CTDirect::RegionTrackingOnlyNotificationsL(TUint aId)
|
sl@0
|
2952 |
{
|
sl@0
|
2953 |
TInt numProcessHandles;
|
sl@0
|
2954 |
RThread().HandleCount(numProcessHandles,iNumThreadHandles);
|
sl@0
|
2955 |
const TSize screenSize(TheClient->iScreen->SizeInPixels());
|
sl@0
|
2956 |
const TRect dsaRect(0,0,screenSize.iWidth>>2,screenSize.iHeight>>2);
|
sl@0
|
2957 |
TBool isWindowOpenedInFrontOfDsa = (aId == KRegionTrackingOnlyDsaWaitingForAbortSignal);
|
sl@0
|
2958 |
iAnim=CRegionTrackingOnly::NewL(iTest->iScreenNumber, aId, *this, *TheClient->iGroup, dsaRect,ETrue,isWindowOpenedInFrontOfDsa);
|
sl@0
|
2959 |
return EWait;
|
sl@0
|
2960 |
}
|
sl@0
|
2961 |
|
sl@0
|
2962 |
// Tests the new function of getting the window's absolute position
|
sl@0
|
2963 |
TestState CTDirect::WindowPoistionRelativeToScreenL()
|
sl@0
|
2964 |
{
|
sl@0
|
2965 |
//.. delete screen mode timer
|
sl@0
|
2966 |
delete iChangeScreenModeTimer;
|
sl@0
|
2967 |
iChangeScreenModeTimer=NULL;
|
sl@0
|
2968 |
|
sl@0
|
2969 |
TInt numProcessHandles;
|
sl@0
|
2970 |
RThread().HandleCount(numProcessHandles,iNumThreadHandles);
|
sl@0
|
2971 |
TSize screenSize(TheClient->iScreen->SizeInPixels());
|
sl@0
|
2972 |
TRect rect(0,0,screenSize.iWidth>>1,screenSize.iHeight);
|
sl@0
|
2973 |
rect.Shrink(10,10);
|
sl@0
|
2974 |
// First animation is for showing that child window is within the visible part of the parent window and within the visible screen area
|
sl@0
|
2975 |
iAnims[0]=new(ELeave) CColorAnimation(iTest->iScreenNumber,15,*this);
|
sl@0
|
2976 |
iAnims[0]->ConstructL(*TheClient->iGroup,rect,KDrawingDsa,1);
|
sl@0
|
2977 |
iAnims[0]->StartL(ETrue);
|
sl@0
|
2978 |
// First animation is for showing that child window is to the side of visible part of parent window
|
sl@0
|
2979 |
rect.Move(screenSize.iWidth>>1,0);
|
sl@0
|
2980 |
iAnims[1]=new(ELeave) CColorAnimation(iTest->iScreenNumber,16,*this);
|
sl@0
|
2981 |
iAnims[1]->ConstructL(*TheClient->iGroup,rect,KDrawingDsa,2);
|
sl@0
|
2982 |
iAnims[1]->StartL(ETrue);
|
sl@0
|
2983 |
return EWait;
|
sl@0
|
2984 |
}
|
sl@0
|
2985 |
|
sl@0
|
2986 |
TestState CTDirect::MultipleDSAsOnSameWindowL()
|
sl@0
|
2987 |
{
|
sl@0
|
2988 |
TInt numProcessHandles;
|
sl@0
|
2989 |
RThread().HandleCount(numProcessHandles,iNumThreadHandles);
|
sl@0
|
2990 |
iCallBackWin->SetVisible(ETrue);
|
sl@0
|
2991 |
iCallBackWin->WinTreeNode()->SetOrdinalPosition(0);
|
sl@0
|
2992 |
iAnims[0]=new(ELeave) CColorAnimation(iTest->iScreenNumber,20,*this);
|
sl@0
|
2993 |
iAnims[0]->ConstructL(*TheClient->iGroup,TRect(),KDrawingDsa,0,1);
|
sl@0
|
2994 |
iAnims[0]->StartL();
|
sl@0
|
2995 |
iAnims[1]=new(ELeave) CColorAnimation(iTest->iScreenNumber,21,*this);
|
sl@0
|
2996 |
iAnims[1]->ConstructL(*TheClient->iGroup,TRect(),KDrawingDsa,0,2);
|
sl@0
|
2997 |
iAnims[1]->StartL();
|
sl@0
|
2998 |
_LIT(ThreadName,"MoveWin");
|
sl@0
|
2999 |
MoveInterval=100000;
|
sl@0
|
3000 |
ModeInterval=0;
|
sl@0
|
3001 |
FlipInterval=0;
|
sl@0
|
3002 |
ImmediateModeSwitch=EFalse;
|
sl@0
|
3003 |
iFirstFunction=TThreadStartUp(CMoveWindow::StartLC,(TAny*)iTest->iScreenNumber);
|
sl@0
|
3004 |
iMoveWin=CProcess::NewThreadL(ThreadName,&iFirstFunction);
|
sl@0
|
3005 |
return EWait;
|
sl@0
|
3006 |
}
|
sl@0
|
3007 |
|
sl@0
|
3008 |
TestState CTDirect::KillAnimationL()
|
sl@0
|
3009 |
{
|
sl@0
|
3010 |
TInt numProcessHandles;
|
sl@0
|
3011 |
RThread().HandleCount(numProcessHandles,iNumThreadHandles);
|
sl@0
|
3012 |
iAnim=CColorAnimation::NewL(iTest->iScreenNumber,12,*this,*TheClient->iGroup,TRect(15,15,625,225),ETrue);
|
sl@0
|
3013 |
return EWait;
|
sl@0
|
3014 |
}
|
sl@0
|
3015 |
|
sl@0
|
3016 |
TestState CTDirect::TemporaryDeadlockL()
|
sl@0
|
3017 |
{
|
sl@0
|
3018 |
|
sl@0
|
3019 |
if (iTestJustCompleted)
|
sl@0
|
3020 |
{
|
sl@0
|
3021 |
if (iTestJustFailed)
|
sl@0
|
3022 |
{
|
sl@0
|
3023 |
Fail();
|
sl@0
|
3024 |
}
|
sl@0
|
3025 |
iState++;
|
sl@0
|
3026 |
return ENext;
|
sl@0
|
3027 |
}
|
sl@0
|
3028 |
|
sl@0
|
3029 |
//make sure this code isn't called a second time
|
sl@0
|
3030 |
__ASSERT_ALWAYS(iAnim==NULL,AutoPanic(EAutoPanicDirect));
|
sl@0
|
3031 |
|
sl@0
|
3032 |
TSize screenSize(TheClient->iScreen->SizeInPixels());
|
sl@0
|
3033 |
TRect rect(0,0,screenSize.iWidth>>1,screenSize.iHeight);
|
sl@0
|
3034 |
rect.Shrink(10,10);
|
sl@0
|
3035 |
iAnim=new(ELeave) CColorAnimation(iTest->iScreenNumber,24,*this);
|
sl@0
|
3036 |
iAnim->ConstructL(*TheClient->iGroup,rect,KDrawingDsa,1);
|
sl@0
|
3037 |
iAnim->StartL(ETrue);
|
sl@0
|
3038 |
return EWait;
|
sl@0
|
3039 |
}
|
sl@0
|
3040 |
|
sl@0
|
3041 |
void CTDirect::CheckForTemporaryDeadlock()
|
sl@0
|
3042 |
{
|
sl@0
|
3043 |
|
sl@0
|
3044 |
TBool result=ETrue;
|
sl@0
|
3045 |
TInt error;
|
sl@0
|
3046 |
|
sl@0
|
3047 |
|
sl@0
|
3048 |
//Create a window for placing on top
|
sl@0
|
3049 |
TTime beforeTime;
|
sl@0
|
3050 |
beforeTime.HomeTime();
|
sl@0
|
3051 |
|
sl@0
|
3052 |
RWindow window(TheClient->iWs);
|
sl@0
|
3053 |
|
sl@0
|
3054 |
error=window.Construct(*TheClient->iGroup->GroupWin(), reinterpret_cast<TInt>(&window));
|
sl@0
|
3055 |
if (error==KErrNone)
|
sl@0
|
3056 |
{
|
sl@0
|
3057 |
window.SetOrdinalPosition(0);
|
sl@0
|
3058 |
window.SetExtent(TPoint(30,30),TSize(10,10));
|
sl@0
|
3059 |
window.SetBackgroundColor(TRgb(255,0,255));
|
sl@0
|
3060 |
|
sl@0
|
3061 |
//make sure the basewin is towards the back
|
sl@0
|
3062 |
iCallBackWin->BaseWin()->SetOrdinalPosition(5);
|
sl@0
|
3063 |
|
sl@0
|
3064 |
window.SetRequiredDisplayMode(EColor256);
|
sl@0
|
3065 |
window.Activate();
|
sl@0
|
3066 |
TheClient->iWs.Flush();
|
sl@0
|
3067 |
//need code similar to below, but the status of the active object we
|
sl@0
|
3068 |
//really want is too private
|
sl@0
|
3069 |
//if (!iAnim->IsReadyToAbort())
|
sl@0
|
3070 |
// {
|
sl@0
|
3071 |
// result=EFalse;
|
sl@0
|
3072 |
// }
|
sl@0
|
3073 |
window.Close();
|
sl@0
|
3074 |
}
|
sl@0
|
3075 |
else
|
sl@0
|
3076 |
{
|
sl@0
|
3077 |
result = EFalse;
|
sl@0
|
3078 |
}
|
sl@0
|
3079 |
|
sl@0
|
3080 |
TTime afterTime;
|
sl@0
|
3081 |
afterTime.HomeTime();
|
sl@0
|
3082 |
TTimeIntervalMicroSeconds difference = afterTime.MicroSecondsFrom(beforeTime);
|
sl@0
|
3083 |
|
sl@0
|
3084 |
//make time difference 350ms, since the two timers to be checked are 400ms and 500ms
|
sl@0
|
3085 |
if (difference>TTimeIntervalMicroSeconds(1000*350))
|
sl@0
|
3086 |
{
|
sl@0
|
3087 |
result=EFalse;
|
sl@0
|
3088 |
}
|
sl@0
|
3089 |
|
sl@0
|
3090 |
iTestJustCompleted = ETrue;
|
sl@0
|
3091 |
if (result==EFalse)
|
sl@0
|
3092 |
{
|
sl@0
|
3093 |
iTestJustFailed=ETrue;
|
sl@0
|
3094 |
}
|
sl@0
|
3095 |
}
|
sl@0
|
3096 |
|
sl@0
|
3097 |
void CTDirect::RunTestCaseL(TInt /*aCurTestCase*/)
|
sl@0
|
3098 |
{
|
sl@0
|
3099 |
_LIT(Animation1,"Animating");
|
sl@0
|
3100 |
_LIT(Animation2,"Animating Dies");
|
sl@0
|
3101 |
_LIT(Animation3,"Packaging Class");
|
sl@0
|
3102 |
_LIT(Animation4,"Many Animations");
|
sl@0
|
3103 |
_LIT(Animation5,"Fail Codes");
|
sl@0
|
3104 |
_LIT(Animation6,"Cancel The Other");
|
sl@0
|
3105 |
_LIT(Animation7,"'R' Class API");
|
sl@0
|
3106 |
_LIT(Animation8,"Switch Clear Type");
|
sl@0
|
3107 |
_LIT(Animation9,"SizeMode Change");
|
sl@0
|
3108 |
_LIT(Animation10,"Soak Testing");
|
sl@0
|
3109 |
_LIT(Animation11,"Kill Animation");
|
sl@0
|
3110 |
_LIT(Animation12,"Defect-Fix: KAA-5J3BLW");
|
sl@0
|
3111 |
_LIT(Animation13,"Screen Mode Positioning DSA Test 1");
|
sl@0
|
3112 |
_LIT(Animation14,"Screen Mode Positioning DSA Test 2");
|
sl@0
|
3113 |
_LIT(Animation15,"Position Relative to Screen");
|
sl@0
|
3114 |
_LIT(Animation16,"Screen mode Scaling DSA Test 1");
|
sl@0
|
3115 |
_LIT(Animation17,"Screen mode Scaling DSA Test 2");
|
sl@0
|
3116 |
_LIT(Animation18,"Multiple DSAs on same window");
|
sl@0
|
3117 |
_LIT(Animation19,"DSA and windows temporary deadlock");
|
sl@0
|
3118 |
_LIT(Animation25,"RegionTrackingOnly DSA, window opened in front");
|
sl@0
|
3119 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
|
sl@0
|
3120 |
_LIT(Animation26,"RegionTrackingOnly DSA, window opened behind");
|
sl@0
|
3121 |
_LIT(Animation27,"Mixed DSAs, RegionTrackingOnly DSA last to exit");
|
sl@0
|
3122 |
_LIT(Animation28,"Mixed DSAs, drawing DSA last to exit");
|
sl@0
|
3123 |
_LIT(Animation29,"Trying all the screen supported modes");
|
sl@0
|
3124 |
#endif
|
sl@0
|
3125 |
TestState ret=ENext;
|
sl@0
|
3126 |
|
sl@0
|
3127 |
if (iTimerRunning && !iPackagingFinished)
|
sl@0
|
3128 |
{
|
sl@0
|
3129 |
// Prevent test harness from repeatedly running the test case too quickly.
|
sl@0
|
3130 |
User::After(SHORT_DELAY);
|
sl@0
|
3131 |
}
|
sl@0
|
3132 |
|
sl@0
|
3133 |
//if (iState==0) iState=18;
|
sl@0
|
3134 |
iTest->iState=iState;
|
sl@0
|
3135 |
((CTDirectStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
|
sl@0
|
3136 |
switch(iState)
|
sl@0
|
3137 |
{
|
sl@0
|
3138 |
/**
|
sl@0
|
3139 |
@SYMTestCaseID GRAPHICS-WSERV-0158
|
sl@0
|
3140 |
|
sl@0
|
3141 |
@SYMDEF DEF081259
|
sl@0
|
3142 |
|
sl@0
|
3143 |
@SYMTestCaseDesc Create seven seperate animations and run them to completion
|
sl@0
|
3144 |
|
sl@0
|
3145 |
@SYMTestPriority High
|
sl@0
|
3146 |
|
sl@0
|
3147 |
@SYMTestStatus Implemented
|
sl@0
|
3148 |
|
sl@0
|
3149 |
@SYMTestActions Create animations and start them running. Run until the animations finish.
|
sl@0
|
3150 |
|
sl@0
|
3151 |
@SYMTestExpectedResults The animation run to completion without error
|
sl@0
|
3152 |
*/
|
sl@0
|
3153 |
case 0:
|
sl@0
|
3154 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0158"));
|
sl@0
|
3155 |
if (iNextFrameFinished)
|
sl@0
|
3156 |
InitialiseAnimationL();
|
sl@0
|
3157 |
case 1:
|
sl@0
|
3158 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0158"));
|
sl@0
|
3159 |
case 2:
|
sl@0
|
3160 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0158"));
|
sl@0
|
3161 |
case 3:
|
sl@0
|
3162 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0158"));
|
sl@0
|
3163 |
case 4:
|
sl@0
|
3164 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0158"));
|
sl@0
|
3165 |
case 5:
|
sl@0
|
3166 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0158"));
|
sl@0
|
3167 |
case 6:
|
sl@0
|
3168 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0158"));
|
sl@0
|
3169 |
if (iNextFrameFinished)
|
sl@0
|
3170 |
{
|
sl@0
|
3171 |
iTest->LogSubTest(Animation1);
|
sl@0
|
3172 |
ret=AnimateWindowL();
|
sl@0
|
3173 |
iNextFrameFinished=EFalse;
|
sl@0
|
3174 |
}
|
sl@0
|
3175 |
else
|
sl@0
|
3176 |
{
|
sl@0
|
3177 |
// Prevent test harness from repeatedly running the test case too quickly.
|
sl@0
|
3178 |
User::After(SHORT_DELAY);
|
sl@0
|
3179 |
}
|
sl@0
|
3180 |
break;
|
sl@0
|
3181 |
/**
|
sl@0
|
3182 |
@SYMTestCaseID GRAPHICS-WSERV-0159
|
sl@0
|
3183 |
|
sl@0
|
3184 |
@SYMDEF DEF081259
|
sl@0
|
3185 |
|
sl@0
|
3186 |
@SYMTestCaseDesc Check animation dies correctly when run in a thread
|
sl@0
|
3187 |
|
sl@0
|
3188 |
@SYMTestPriority High
|
sl@0
|
3189 |
|
sl@0
|
3190 |
@SYMTestStatus Implemented
|
sl@0
|
3191 |
|
sl@0
|
3192 |
@SYMTestActions Create animation and run in from a thread that dies. Once the thread
|
sl@0
|
3193 |
has died check the animation has been dealt with correctly.
|
sl@0
|
3194 |
|
sl@0
|
3195 |
@SYMTestExpectedResults The animation dies correctly
|
sl@0
|
3196 |
*/
|
sl@0
|
3197 |
case 7:
|
sl@0
|
3198 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0159"));
|
sl@0
|
3199 |
iTest->LogSubTest(Animation2);
|
sl@0
|
3200 |
ret=AnimationDiesL();
|
sl@0
|
3201 |
++iState;
|
sl@0
|
3202 |
DestroyAnimation();
|
sl@0
|
3203 |
break;
|
sl@0
|
3204 |
/**
|
sl@0
|
3205 |
@SYMTestCaseID GRAPHICS-WSERV-0160
|
sl@0
|
3206 |
|
sl@0
|
3207 |
@SYMDEF DEF081259
|
sl@0
|
3208 |
|
sl@0
|
3209 |
@SYMTestCaseDesc Check animation runs correctly in blank window
|
sl@0
|
3210 |
|
sl@0
|
3211 |
@SYMTestPriority High
|
sl@0
|
3212 |
|
sl@0
|
3213 |
@SYMTestStatus Implemented
|
sl@0
|
3214 |
|
sl@0
|
3215 |
@SYMTestActions Create an animation and run it in a blank window
|
sl@0
|
3216 |
|
sl@0
|
3217 |
@SYMTestExpectedResults The animation runs to completion without error
|
sl@0
|
3218 |
*/
|
sl@0
|
3219 |
case 8:
|
sl@0
|
3220 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0160"));
|
sl@0
|
3221 |
if (!iTimerRunning)
|
sl@0
|
3222 |
{
|
sl@0
|
3223 |
iTest->LogSubTest(Animation3);
|
sl@0
|
3224 |
ret=PackagingClassL();
|
sl@0
|
3225 |
iTimerRunning = ETrue;
|
sl@0
|
3226 |
}
|
sl@0
|
3227 |
if (iPackagingFinished)
|
sl@0
|
3228 |
{
|
sl@0
|
3229 |
iPackagingFinished = EFalse;
|
sl@0
|
3230 |
iTimerRunning = EFalse;
|
sl@0
|
3231 |
}
|
sl@0
|
3232 |
break;
|
sl@0
|
3233 |
/**
|
sl@0
|
3234 |
@SYMTestCaseID GRAPHICS-WSERV-0161
|
sl@0
|
3235 |
|
sl@0
|
3236 |
@SYMDEF DEF081259
|
sl@0
|
3237 |
|
sl@0
|
3238 |
@SYMTestCaseDesc Check many animations can be run in the same window
|
sl@0
|
3239 |
|
sl@0
|
3240 |
@SYMTestPriority High
|
sl@0
|
3241 |
|
sl@0
|
3242 |
@SYMTestStatus Implemented
|
sl@0
|
3243 |
|
sl@0
|
3244 |
@SYMTestActions Create multiple animations in a window and run them all
|
sl@0
|
3245 |
until completion
|
sl@0
|
3246 |
|
sl@0
|
3247 |
@SYMTestExpectedResults The animations run without error
|
sl@0
|
3248 |
*/
|
sl@0
|
3249 |
case 9:
|
sl@0
|
3250 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0161"));
|
sl@0
|
3251 |
if (!iTimerRunning)
|
sl@0
|
3252 |
{
|
sl@0
|
3253 |
iTest->LogSubTest(Animation4);
|
sl@0
|
3254 |
ret=MultipleL();
|
sl@0
|
3255 |
iTimerRunning = ETrue;
|
sl@0
|
3256 |
}
|
sl@0
|
3257 |
if (iPackagingFinished)
|
sl@0
|
3258 |
{
|
sl@0
|
3259 |
iPackagingFinished = EFalse;
|
sl@0
|
3260 |
iTimerRunning = EFalse;
|
sl@0
|
3261 |
}
|
sl@0
|
3262 |
break;
|
sl@0
|
3263 |
/**
|
sl@0
|
3264 |
@SYMTestCaseID GRAPHICS-WSERV-0162
|
sl@0
|
3265 |
|
sl@0
|
3266 |
@SYMDEF DEF081259
|
sl@0
|
3267 |
|
sl@0
|
3268 |
@SYMTestCaseDesc Direct screen access out of memory test
|
sl@0
|
3269 |
|
sl@0
|
3270 |
@SYMTestPriority High
|
sl@0
|
3271 |
|
sl@0
|
3272 |
@SYMTestStatus Implemented
|
sl@0
|
3273 |
|
sl@0
|
3274 |
@SYMTestActions Direct screen access out of memory test
|
sl@0
|
3275 |
|
sl@0
|
3276 |
@SYMTestExpectedResults The out of memory error is handled correctly
|
sl@0
|
3277 |
*/
|
sl@0
|
3278 |
case 10:
|
sl@0
|
3279 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0162"));
|
sl@0
|
3280 |
iTest->LogSubTest(Animation5);
|
sl@0
|
3281 |
ret=FailCodesL();
|
sl@0
|
3282 |
iState++;
|
sl@0
|
3283 |
break;
|
sl@0
|
3284 |
/**
|
sl@0
|
3285 |
@SYMTestCaseID GRAPHICS-WSERV-0163
|
sl@0
|
3286 |
|
sl@0
|
3287 |
@SYMDEF DEF081259
|
sl@0
|
3288 |
|
sl@0
|
3289 |
@SYMTestCaseDesc Two animations, one scrolling text
|
sl@0
|
3290 |
|
sl@0
|
3291 |
@SYMTestPriority High
|
sl@0
|
3292 |
|
sl@0
|
3293 |
@SYMTestStatus Implemented
|
sl@0
|
3294 |
|
sl@0
|
3295 |
@SYMTestActions Create two animations, one which scrolls text across the screen and
|
sl@0
|
3296 |
run them to completion
|
sl@0
|
3297 |
|
sl@0
|
3298 |
@SYMTestExpectedResults The animations run without error
|
sl@0
|
3299 |
*/
|
sl@0
|
3300 |
case 11:
|
sl@0
|
3301 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0163"));
|
sl@0
|
3302 |
if (!iTimerRunning)
|
sl@0
|
3303 |
{
|
sl@0
|
3304 |
iTest->LogSubTest(Animation6);
|
sl@0
|
3305 |
ret=ScrolingText1L();
|
sl@0
|
3306 |
iTimerRunning = ETrue;
|
sl@0
|
3307 |
}
|
sl@0
|
3308 |
if (iPackagingFinished)
|
sl@0
|
3309 |
{
|
sl@0
|
3310 |
iPackagingFinished = EFalse;
|
sl@0
|
3311 |
iTimerRunning = EFalse;
|
sl@0
|
3312 |
}
|
sl@0
|
3313 |
break;
|
sl@0
|
3314 |
/**
|
sl@0
|
3315 |
@SYMTestCaseID GRAPHICS-WSERV-0164
|
sl@0
|
3316 |
|
sl@0
|
3317 |
@SYMDEF DEF081259
|
sl@0
|
3318 |
|
sl@0
|
3319 |
@SYMTestCaseDesc Test direct screen access panic messages
|
sl@0
|
3320 |
|
sl@0
|
3321 |
@SYMTestPriority High
|
sl@0
|
3322 |
|
sl@0
|
3323 |
@SYMTestStatus Implemented
|
sl@0
|
3324 |
|
sl@0
|
3325 |
@SYMTestActions Call the direct screen access panic's and check they are handled
|
sl@0
|
3326 |
correctly
|
sl@0
|
3327 |
|
sl@0
|
3328 |
@SYMTestExpectedResults The panic's are handled correctly
|
sl@0
|
3329 |
*/
|
sl@0
|
3330 |
case 12:
|
sl@0
|
3331 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0164"));
|
sl@0
|
3332 |
iTest->LogSubTest(Animation7);
|
sl@0
|
3333 |
ret=RClassL();
|
sl@0
|
3334 |
iTest->CloseAllPanicWindows();
|
sl@0
|
3335 |
iState++;
|
sl@0
|
3336 |
break;
|
sl@0
|
3337 |
/**
|
sl@0
|
3338 |
@SYMTestCaseID GRAPHICS-WSERV-0165
|
sl@0
|
3339 |
|
sl@0
|
3340 |
@SYMDEF DEF081259
|
sl@0
|
3341 |
|
sl@0
|
3342 |
@SYMTestCaseDesc Two animations, one scrolling text
|
sl@0
|
3343 |
|
sl@0
|
3344 |
@SYMTestPriority High
|
sl@0
|
3345 |
|
sl@0
|
3346 |
@SYMTestStatus Implemented
|
sl@0
|
3347 |
|
sl@0
|
3348 |
@SYMTestActions Create two animations, one which scrolls text across the screen and
|
sl@0
|
3349 |
run them to completion
|
sl@0
|
3350 |
|
sl@0
|
3351 |
@SYMTestExpectedResults The animations run without error
|
sl@0
|
3352 |
*/
|
sl@0
|
3353 |
case 13:
|
sl@0
|
3354 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0165"));
|
sl@0
|
3355 |
if (!iTimerRunning)
|
sl@0
|
3356 |
{
|
sl@0
|
3357 |
iTest->LogSubTest(Animation8);
|
sl@0
|
3358 |
ret=ScrolingText2L();
|
sl@0
|
3359 |
iTimerRunning = ETrue;
|
sl@0
|
3360 |
}
|
sl@0
|
3361 |
if (iPackagingFinished)
|
sl@0
|
3362 |
{
|
sl@0
|
3363 |
iPackagingFinished = EFalse;
|
sl@0
|
3364 |
iTimerRunning = EFalse;
|
sl@0
|
3365 |
}
|
sl@0
|
3366 |
break;
|
sl@0
|
3367 |
/**
|
sl@0
|
3368 |
@SYMTestCaseID GRAPHICS-WSERV-0166
|
sl@0
|
3369 |
|
sl@0
|
3370 |
@SYMDEF DEF081259
|
sl@0
|
3371 |
|
sl@0
|
3372 |
@SYMTestCaseDesc Two animations, one scrolling text. Change the screen mode an run.
|
sl@0
|
3373 |
|
sl@0
|
3374 |
@SYMTestPriority High
|
sl@0
|
3375 |
|
sl@0
|
3376 |
@SYMTestStatus Implemented
|
sl@0
|
3377 |
|
sl@0
|
3378 |
@SYMTestActions Create two animations, one which scrolls text across the screen and
|
sl@0
|
3379 |
run them to completion while changing the screen mode
|
sl@0
|
3380 |
|
sl@0
|
3381 |
@SYMTestExpectedResults The animations run without error
|
sl@0
|
3382 |
*/
|
sl@0
|
3383 |
|
sl@0
|
3384 |
case 14:
|
sl@0
|
3385 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0166"));
|
sl@0
|
3386 |
if (!iTimerRunning)
|
sl@0
|
3387 |
{
|
sl@0
|
3388 |
iTest->LogSubTest(Animation9);
|
sl@0
|
3389 |
ret=ScrolingText3L();
|
sl@0
|
3390 |
if (ret == ENext)
|
sl@0
|
3391 |
iPackagingFinished = ETrue;
|
sl@0
|
3392 |
else
|
sl@0
|
3393 |
iTimerRunning = ETrue;
|
sl@0
|
3394 |
}
|
sl@0
|
3395 |
if (iPackagingFinished)
|
sl@0
|
3396 |
{
|
sl@0
|
3397 |
iPackagingFinished = EFalse;
|
sl@0
|
3398 |
iTimerRunning = EFalse;
|
sl@0
|
3399 |
FlipInterval = 0; // Stops the tests (erroneously) flipping for the rest of the run
|
sl@0
|
3400 |
}
|
sl@0
|
3401 |
break;
|
sl@0
|
3402 |
/**
|
sl@0
|
3403 |
@SYMTestCaseID GRAPHICS-WSERV-0167
|
sl@0
|
3404 |
|
sl@0
|
3405 |
@SYMDEF DEF081259
|
sl@0
|
3406 |
|
sl@0
|
3407 |
@SYMTestCaseDesc Start an animation then kill it
|
sl@0
|
3408 |
|
sl@0
|
3409 |
@SYMTestPriority High
|
sl@0
|
3410 |
|
sl@0
|
3411 |
@SYMTestStatus Implemented
|
sl@0
|
3412 |
|
sl@0
|
3413 |
@SYMTestActions Start an animation running then kill it. Check the animation dies correctly
|
sl@0
|
3414 |
|
sl@0
|
3415 |
@SYMTestExpectedResults The animations dies correctly
|
sl@0
|
3416 |
*/
|
sl@0
|
3417 |
case 15:
|
sl@0
|
3418 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0167"));
|
sl@0
|
3419 |
if (!iTimerRunning)
|
sl@0
|
3420 |
{
|
sl@0
|
3421 |
iTest->LogSubTest(Animation11);
|
sl@0
|
3422 |
ret=KillAnimationL();
|
sl@0
|
3423 |
iTimerRunning = ETrue;
|
sl@0
|
3424 |
}
|
sl@0
|
3425 |
if (iPackagingFinished)
|
sl@0
|
3426 |
{
|
sl@0
|
3427 |
iPackagingFinished = EFalse;
|
sl@0
|
3428 |
iTimerRunning = EFalse;
|
sl@0
|
3429 |
}
|
sl@0
|
3430 |
break;
|
sl@0
|
3431 |
case 16:
|
sl@0
|
3432 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0167"));
|
sl@0
|
3433 |
iTest->LogSubTest(Animation10); //This test is designed to be left running for at least several hours
|
sl@0
|
3434 |
//ret=ScrolingText4L();
|
sl@0
|
3435 |
iState++;
|
sl@0
|
3436 |
break;
|
sl@0
|
3437 |
/**
|
sl@0
|
3438 |
@SYMTestCaseID GRAPHICS-WSERV-0168
|
sl@0
|
3439 |
|
sl@0
|
3440 |
@SYMDEF DEF081259
|
sl@0
|
3441 |
|
sl@0
|
3442 |
@SYMTestCaseDesc CBugFixColorAnimation
|
sl@0
|
3443 |
|
sl@0
|
3444 |
@SYMTestPriority High
|
sl@0
|
3445 |
|
sl@0
|
3446 |
@SYMTestStatus Implemented
|
sl@0
|
3447 |
|
sl@0
|
3448 |
@SYMTestActions This class is used for reproducing a defect found on 6.1: KAA-5J3BLW "Unnecessary Wserv's DSA abort".
|
sl@0
|
3449 |
The problem was that a direct screen access client was getting an unnecessary abort notification
|
sl@0
|
3450 |
when a new window (or window group) was created but not visible.
|
sl@0
|
3451 |
This class will simulate the direct screen access client and it will check whether the first DSA abort
|
sl@0
|
3452 |
is not caused by just creating a window.
|
sl@0
|
3453 |
|
sl@0
|
3454 |
@SYMTestExpectedResults Abort is not caused when creatung a window
|
sl@0
|
3455 |
*/
|
sl@0
|
3456 |
case 17:
|
sl@0
|
3457 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0168"));
|
sl@0
|
3458 |
if (!iTimerRunning)
|
sl@0
|
3459 |
{
|
sl@0
|
3460 |
iTest->LogSubTest(Animation12);
|
sl@0
|
3461 |
ret=DefectFix_KAA_5J3BLW_L();
|
sl@0
|
3462 |
iTimerRunning = ETrue;
|
sl@0
|
3463 |
}
|
sl@0
|
3464 |
if (iPackagingFinished)
|
sl@0
|
3465 |
{
|
sl@0
|
3466 |
iPackagingFinished = EFalse;
|
sl@0
|
3467 |
iTimerRunning = EFalse;
|
sl@0
|
3468 |
}
|
sl@0
|
3469 |
break;
|
sl@0
|
3470 |
/**
|
sl@0
|
3471 |
@SYMTestCaseID GRAPHICS-WSERV-0169
|
sl@0
|
3472 |
|
sl@0
|
3473 |
@SYMDEF DEF081259
|
sl@0
|
3474 |
|
sl@0
|
3475 |
@SYMTestCaseDesc Direct screen access in screen modes with non-zero screen mode origin
|
sl@0
|
3476 |
|
sl@0
|
3477 |
@SYMTestPriority High
|
sl@0
|
3478 |
|
sl@0
|
3479 |
@SYMTestStatus Implemented
|
sl@0
|
3480 |
|
sl@0
|
3481 |
@SYMTestActions Tests that DSA works correctly in screen modes with non-zero screen mode origin
|
sl@0
|
3482 |
|
sl@0
|
3483 |
@SYMTestExpectedResults The DSA works correctly
|
sl@0
|
3484 |
*/
|
sl@0
|
3485 |
case 18:
|
sl@0
|
3486 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0169"));
|
sl@0
|
3487 |
if (!CheckNonZeroOriginsSupportedOrNot())
|
sl@0
|
3488 |
{
|
sl@0
|
3489 |
INFO_PRINTF1(_L("Non Zero Origins not supported\n"));
|
sl@0
|
3490 |
iState++;
|
sl@0
|
3491 |
}
|
sl@0
|
3492 |
else
|
sl@0
|
3493 |
{
|
sl@0
|
3494 |
if (!iTimerRunning)
|
sl@0
|
3495 |
{
|
sl@0
|
3496 |
iTest->LogSubTest(Animation13);
|
sl@0
|
3497 |
ret=DSAWithScreenModeOffset1L();
|
sl@0
|
3498 |
iTimerRunning = ETrue;
|
sl@0
|
3499 |
}
|
sl@0
|
3500 |
if (iPackagingFinished)
|
sl@0
|
3501 |
{
|
sl@0
|
3502 |
iPackagingFinished = EFalse;
|
sl@0
|
3503 |
iTimerRunning = EFalse;
|
sl@0
|
3504 |
}
|
sl@0
|
3505 |
}
|
sl@0
|
3506 |
break;
|
sl@0
|
3507 |
/**
|
sl@0
|
3508 |
@SYMTestCaseID GRAPHICS-WSERV-0170
|
sl@0
|
3509 |
|
sl@0
|
3510 |
@SYMDEF DEF081259
|
sl@0
|
3511 |
|
sl@0
|
3512 |
@SYMTestCaseDesc Direct screen access in screen modes with non-zero screen mode origin
|
sl@0
|
3513 |
|
sl@0
|
3514 |
@SYMTestPriority High
|
sl@0
|
3515 |
|
sl@0
|
3516 |
@SYMTestStatus Implemented
|
sl@0
|
3517 |
|
sl@0
|
3518 |
@SYMTestActions Tests that DSA works correctly in screen modes with non-zero screen mode origin and different rotations
|
sl@0
|
3519 |
|
sl@0
|
3520 |
@SYMTestExpectedResults The DSA works correctly
|
sl@0
|
3521 |
*/
|
sl@0
|
3522 |
case 19:
|
sl@0
|
3523 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0170"));
|
sl@0
|
3524 |
if (!CheckNonZeroOriginsSupportedOrNot())
|
sl@0
|
3525 |
{
|
sl@0
|
3526 |
INFO_PRINTF1(_L("Non Zero Origins not supported\n"));
|
sl@0
|
3527 |
iState++;
|
sl@0
|
3528 |
}
|
sl@0
|
3529 |
else
|
sl@0
|
3530 |
{
|
sl@0
|
3531 |
if (!iTimerRunning)
|
sl@0
|
3532 |
{
|
sl@0
|
3533 |
iTest->LogSubTest(Animation14);
|
sl@0
|
3534 |
ret=DSAWithScreenModeOffset2L();
|
sl@0
|
3535 |
iTimerRunning = ETrue;
|
sl@0
|
3536 |
}
|
sl@0
|
3537 |
if (iPackagingFinished)
|
sl@0
|
3538 |
{
|
sl@0
|
3539 |
iPackagingFinished = EFalse;
|
sl@0
|
3540 |
iTimerRunning = EFalse;
|
sl@0
|
3541 |
}
|
sl@0
|
3542 |
}
|
sl@0
|
3543 |
break;
|
sl@0
|
3544 |
/**
|
sl@0
|
3545 |
@SYMTestCaseID GRAPHICS-WSERV-0171
|
sl@0
|
3546 |
|
sl@0
|
3547 |
@SYMDEF DEF081259
|
sl@0
|
3548 |
|
sl@0
|
3549 |
@SYMTestCaseDesc Window absolute position
|
sl@0
|
3550 |
|
sl@0
|
3551 |
@SYMTestPriority High
|
sl@0
|
3552 |
|
sl@0
|
3553 |
@SYMTestStatus Implemented
|
sl@0
|
3554 |
|
sl@0
|
3555 |
@SYMTestActions Tests the new function of getting the window's absolute position
|
sl@0
|
3556 |
|
sl@0
|
3557 |
@SYMTestExpectedResults Function works correctly
|
sl@0
|
3558 |
*/
|
sl@0
|
3559 |
case 20:
|
sl@0
|
3560 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0171"));
|
sl@0
|
3561 |
if (!iTimerRunning)
|
sl@0
|
3562 |
{
|
sl@0
|
3563 |
iTest->LogSubTest(Animation15);
|
sl@0
|
3564 |
ret=WindowPoistionRelativeToScreenL();
|
sl@0
|
3565 |
iTimerRunning = ETrue;
|
sl@0
|
3566 |
}
|
sl@0
|
3567 |
if (iPackagingFinished)
|
sl@0
|
3568 |
{
|
sl@0
|
3569 |
iPackagingFinished = EFalse;
|
sl@0
|
3570 |
iTimerRunning = EFalse;
|
sl@0
|
3571 |
}
|
sl@0
|
3572 |
break;
|
sl@0
|
3573 |
/**
|
sl@0
|
3574 |
@SYMTestCaseID GRAPHICS-WSERV-0172
|
sl@0
|
3575 |
|
sl@0
|
3576 |
@SYMDEF DEF081259
|
sl@0
|
3577 |
|
sl@0
|
3578 |
@SYMTestCaseDesc Test direct screen access restart
|
sl@0
|
3579 |
|
sl@0
|
3580 |
@SYMTestPriority High
|
sl@0
|
3581 |
|
sl@0
|
3582 |
@SYMTestStatus Implemented
|
sl@0
|
3583 |
|
sl@0
|
3584 |
@SYMTestActions Creates a DSA for screen mode 0. After DSA has displayed 2 or 3 frames screen mode
|
sl@0
|
3585 |
scale is changed with a timer. The DSA aborts and restarts once again
|
sl@0
|
3586 |
and completes itself in different screen mode.
|
sl@0
|
3587 |
|
sl@0
|
3588 |
@SYMTestExpectedResults DSA restarts and completes correctly
|
sl@0
|
3589 |
*/
|
sl@0
|
3590 |
case 21:
|
sl@0
|
3591 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0172"));
|
sl@0
|
3592 |
if (iIsScalingSupported)
|
sl@0
|
3593 |
{
|
sl@0
|
3594 |
if (!iTimerRunning)
|
sl@0
|
3595 |
{
|
sl@0
|
3596 |
iTest->LogSubTest(Animation16);
|
sl@0
|
3597 |
ret=ScreenModeTestForScalingL();
|
sl@0
|
3598 |
iTimerRunning = ETrue;
|
sl@0
|
3599 |
}
|
sl@0
|
3600 |
if (iPackagingFinished)
|
sl@0
|
3601 |
{
|
sl@0
|
3602 |
iPackagingFinished = EFalse;
|
sl@0
|
3603 |
iTimerRunning = EFalse;
|
sl@0
|
3604 |
}
|
sl@0
|
3605 |
break;
|
sl@0
|
3606 |
}
|
sl@0
|
3607 |
iState++;
|
sl@0
|
3608 |
break;
|
sl@0
|
3609 |
/**
|
sl@0
|
3610 |
@SYMTestCaseID GRAPHICS-WSERV-0173
|
sl@0
|
3611 |
|
sl@0
|
3612 |
@SYMDEF DEF081259
|
sl@0
|
3613 |
|
sl@0
|
3614 |
@SYMTestCaseDesc Test direct screen access scaling
|
sl@0
|
3615 |
|
sl@0
|
3616 |
@SYMTestPriority High
|
sl@0
|
3617 |
|
sl@0
|
3618 |
@SYMTestStatus Implemented
|
sl@0
|
3619 |
|
sl@0
|
3620 |
@SYMTestActions Creates a DSA for screen mode 0, tests API AbsoluteWindowPosition()
|
sl@0
|
3621 |
Then sets screen mode to last(test) screen mode, here it does the same thing as
|
sl@0
|
3622 |
done for screenmode 0, but with diffrerent scale (2,2) (2,3) (3,2) (3,3) and
|
sl@0
|
3623 |
with different origin (20,30) (30,20) (20,20).
|
sl@0
|
3624 |
Lastly copy back the test screen mode values.
|
sl@0
|
3625 |
|
sl@0
|
3626 |
@SYMTestExpectedResults DSA scales correctly
|
sl@0
|
3627 |
*/
|
sl@0
|
3628 |
case 22:
|
sl@0
|
3629 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0173"));
|
sl@0
|
3630 |
if (iIsScalingSupported)
|
sl@0
|
3631 |
{
|
sl@0
|
3632 |
if (!iTimerRunning)
|
sl@0
|
3633 |
{
|
sl@0
|
3634 |
iTest->LogSubTest(Animation17);
|
sl@0
|
3635 |
ret=ScreenModeScalingTestL();
|
sl@0
|
3636 |
iTimerRunning = ETrue;
|
sl@0
|
3637 |
}
|
sl@0
|
3638 |
if (iPackagingFinished)
|
sl@0
|
3639 |
{
|
sl@0
|
3640 |
iPackagingFinished = EFalse;
|
sl@0
|
3641 |
iTimerRunning = EFalse;
|
sl@0
|
3642 |
}
|
sl@0
|
3643 |
break;
|
sl@0
|
3644 |
}
|
sl@0
|
3645 |
iState++;
|
sl@0
|
3646 |
break;
|
sl@0
|
3647 |
/**
|
sl@0
|
3648 |
@SYMTestCaseID GRAPHICS-WSERV-0174
|
sl@0
|
3649 |
|
sl@0
|
3650 |
@SYMDEF DEF081259
|
sl@0
|
3651 |
|
sl@0
|
3652 |
@SYMTestCaseDesc Test multiple direct screen access elements on the same window
|
sl@0
|
3653 |
|
sl@0
|
3654 |
@SYMTestPriority High
|
sl@0
|
3655 |
|
sl@0
|
3656 |
@SYMTestStatus Implemented
|
sl@0
|
3657 |
|
sl@0
|
3658 |
@SYMTestActions Create a number of direct screen access elements on the same window and
|
sl@0
|
3659 |
check that they work correctly
|
sl@0
|
3660 |
|
sl@0
|
3661 |
@SYMTestExpectedResults DSAs work correctly
|
sl@0
|
3662 |
*/
|
sl@0
|
3663 |
case 23:
|
sl@0
|
3664 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0174"));
|
sl@0
|
3665 |
if (iIsScalingSupported)
|
sl@0
|
3666 |
{
|
sl@0
|
3667 |
if (!iTimerRunning)
|
sl@0
|
3668 |
{
|
sl@0
|
3669 |
iTest->LogSubTest(Animation18);
|
sl@0
|
3670 |
ret=MultipleDSAsOnSameWindowL();
|
sl@0
|
3671 |
iTimerRunning = ETrue;
|
sl@0
|
3672 |
}
|
sl@0
|
3673 |
if (iPackagingFinished)
|
sl@0
|
3674 |
{
|
sl@0
|
3675 |
iPackagingFinished = EFalse;
|
sl@0
|
3676 |
iTimerRunning = EFalse;
|
sl@0
|
3677 |
}
|
sl@0
|
3678 |
break;
|
sl@0
|
3679 |
}
|
sl@0
|
3680 |
iState++;
|
sl@0
|
3681 |
break;
|
sl@0
|
3682 |
/**
|
sl@0
|
3683 |
@SYMTestCaseID GRAPHICS-WSERV-0175
|
sl@0
|
3684 |
|
sl@0
|
3685 |
@SYMDEF DEF081259
|
sl@0
|
3686 |
|
sl@0
|
3687 |
@SYMTestCaseDesc Create a temporary deadlock on a DSA and resolve it
|
sl@0
|
3688 |
|
sl@0
|
3689 |
@SYMTestPriority High
|
sl@0
|
3690 |
|
sl@0
|
3691 |
@SYMTestStatus Implemented
|
sl@0
|
3692 |
|
sl@0
|
3693 |
@SYMTestActions Resolve a temporary deadlock on a DSA
|
sl@0
|
3694 |
|
sl@0
|
3695 |
@SYMTestExpectedResults DSA resolves the deadlock
|
sl@0
|
3696 |
*/
|
sl@0
|
3697 |
case 24:
|
sl@0
|
3698 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0175"));
|
sl@0
|
3699 |
if (!iTimerRunning)
|
sl@0
|
3700 |
{
|
sl@0
|
3701 |
iTest->LogSubTest(Animation19);
|
sl@0
|
3702 |
ret=TemporaryDeadlockL();//for INC072887 - removing a 0.5s delay in wserv.
|
sl@0
|
3703 |
iTimerRunning = ETrue;
|
sl@0
|
3704 |
}
|
sl@0
|
3705 |
if (iPackagingFinished)
|
sl@0
|
3706 |
{
|
sl@0
|
3707 |
iPackagingFinished = EFalse;
|
sl@0
|
3708 |
iTimerRunning = EFalse;
|
sl@0
|
3709 |
iState++;
|
sl@0
|
3710 |
}
|
sl@0
|
3711 |
break;
|
sl@0
|
3712 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
|
sl@0
|
3713 |
case 25:
|
sl@0
|
3714 |
/**
|
sl@0
|
3715 |
@SYMTestCaseID GRAPHICS-WSERV-0533
|
sl@0
|
3716 |
*/
|
sl@0
|
3717 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0533"));
|
sl@0
|
3718 |
if (!iTimerRunning)
|
sl@0
|
3719 |
{
|
sl@0
|
3720 |
FlipInterval=0;
|
sl@0
|
3721 |
iTest->LogSubTest(Animation25);
|
sl@0
|
3722 |
//Opens a window in front of a region tracking only DSA
|
sl@0
|
3723 |
ret=RegionTrackingOnlyNotificationsL(KRegionTrackingOnlyDsaWaitingForAbortSignal);
|
sl@0
|
3724 |
iTimerRunning = ETrue;
|
sl@0
|
3725 |
}
|
sl@0
|
3726 |
if (iPackagingFinished)
|
sl@0
|
3727 |
{
|
sl@0
|
3728 |
iPackagingFinished = EFalse;
|
sl@0
|
3729 |
iTimerRunning = EFalse;
|
sl@0
|
3730 |
}
|
sl@0
|
3731 |
break;
|
sl@0
|
3732 |
case 26:
|
sl@0
|
3733 |
/**
|
sl@0
|
3734 |
@SYMTestCaseID GRAPHICS-WSERV-0534
|
sl@0
|
3735 |
*/
|
sl@0
|
3736 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0534"));
|
sl@0
|
3737 |
if (!iTimerRunning)
|
sl@0
|
3738 |
{
|
sl@0
|
3739 |
iTest->LogSubTest(Animation26);
|
sl@0
|
3740 |
//Opens a window behind a region tracking only DSA
|
sl@0
|
3741 |
ret=RegionTrackingOnlyNotificationsL(KRegionTrackingOnlyDsaNoAbortSignal);
|
sl@0
|
3742 |
iTimerRunning = ETrue;
|
sl@0
|
3743 |
}
|
sl@0
|
3744 |
if (iPackagingFinished)
|
sl@0
|
3745 |
{
|
sl@0
|
3746 |
iPackagingFinished = EFalse;
|
sl@0
|
3747 |
iTimerRunning = EFalse;
|
sl@0
|
3748 |
}
|
sl@0
|
3749 |
break;
|
sl@0
|
3750 |
case 27:
|
sl@0
|
3751 |
/**
|
sl@0
|
3752 |
@SYMTestCaseID GRAPHICS-WSERV-0535
|
sl@0
|
3753 |
*/
|
sl@0
|
3754 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0535"));
|
sl@0
|
3755 |
if (!iTimerRunning)
|
sl@0
|
3756 |
{
|
sl@0
|
3757 |
iTest->LogSubTest(Animation27);
|
sl@0
|
3758 |
ret=MixDsaAndRegionTrackingOnlyL(KRegionTrackingOnlyDsaExistLast);
|
sl@0
|
3759 |
iTimerRunning = ETrue;
|
sl@0
|
3760 |
}
|
sl@0
|
3761 |
if (iPackagingFinished)
|
sl@0
|
3762 |
{
|
sl@0
|
3763 |
iPackagingFinished = EFalse;
|
sl@0
|
3764 |
iTimerRunning = EFalse;
|
sl@0
|
3765 |
}
|
sl@0
|
3766 |
break;
|
sl@0
|
3767 |
case 28:
|
sl@0
|
3768 |
/**
|
sl@0
|
3769 |
@SYMTestCaseID GRAPHICS-WSERV-0536
|
sl@0
|
3770 |
*/
|
sl@0
|
3771 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0536"));
|
sl@0
|
3772 |
if (!iTimerRunning)
|
sl@0
|
3773 |
{
|
sl@0
|
3774 |
iTest->LogSubTest(Animation28);
|
sl@0
|
3775 |
ret=MixDsaAndRegionTrackingOnlyL(KDrawingDsaExistLast);
|
sl@0
|
3776 |
iTimerRunning = ETrue;
|
sl@0
|
3777 |
}
|
sl@0
|
3778 |
if (iPackagingFinished)
|
sl@0
|
3779 |
{
|
sl@0
|
3780 |
iPackagingFinished = EFalse;
|
sl@0
|
3781 |
iTimerRunning = EFalse;
|
sl@0
|
3782 |
}
|
sl@0
|
3783 |
break;
|
sl@0
|
3784 |
case 29:
|
sl@0
|
3785 |
/**
|
sl@0
|
3786 |
@SYMTestCaseID GRAPHICS-WSERV-0537
|
sl@0
|
3787 |
*/
|
sl@0
|
3788 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0537"));
|
sl@0
|
3789 |
if (!iTimerRunning)
|
sl@0
|
3790 |
{
|
sl@0
|
3791 |
iTest->LogSubTest(Animation29);
|
sl@0
|
3792 |
ret=TryDifferentSupportedModesL();
|
sl@0
|
3793 |
iTimerRunning = ETrue;
|
sl@0
|
3794 |
}
|
sl@0
|
3795 |
if (iPackagingFinished)
|
sl@0
|
3796 |
{
|
sl@0
|
3797 |
iPackagingFinished = EFalse;
|
sl@0
|
3798 |
iTimerRunning = EFalse;
|
sl@0
|
3799 |
}
|
sl@0
|
3800 |
break;
|
sl@0
|
3801 |
#else
|
sl@0
|
3802 |
//NON NGA negative test for RegionTrackingOnly DSA
|
sl@0
|
3803 |
case 25:
|
sl@0
|
3804 |
/**
|
sl@0
|
3805 |
@SYMTestCaseID GRAPHICS-WSERV-0575
|
sl@0
|
3806 |
*/
|
sl@0
|
3807 |
((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0575"));
|
sl@0
|
3808 |
if (!iTimerRunning)
|
sl@0
|
3809 |
{
|
sl@0
|
3810 |
FlipInterval=0;
|
sl@0
|
3811 |
iTest->LogSubTest(Animation25);
|
sl@0
|
3812 |
CColorAnimation* temp = NULL;
|
sl@0
|
3813 |
//Attempt to create a RegionTrackingOnly DSA in non NGA code
|
sl@0
|
3814 |
TRAPD(err,temp = CColorAnimation::NewL(iTest->iScreenNumber,1,*this,*TheClient->iGroup,TRect(10,10,630,230),ETrue,KRegionTrackingOnly));
|
sl@0
|
3815 |
if(err!=KErrNotSupported)
|
sl@0
|
3816 |
{
|
sl@0
|
3817 |
_LIT(KCTDirectNonNgaError,"Attempt to creat a RegionTrackingOnly DSA did not return KErrNotSupported on non-NGA");
|
sl@0
|
3818 |
LOG_MESSAGE(KCTDirectNonNgaError);
|
sl@0
|
3819 |
if(temp)
|
sl@0
|
3820 |
{
|
sl@0
|
3821 |
delete temp;
|
sl@0
|
3822 |
}
|
sl@0
|
3823 |
Fail();
|
sl@0
|
3824 |
}
|
sl@0
|
3825 |
else
|
sl@0
|
3826 |
{
|
sl@0
|
3827 |
_LIT(KCTDirectNonNgaSuccess,"RegionTrackingOnly DSA not supported on non-NGA as expected");
|
sl@0
|
3828 |
LOG_MESSAGE(KCTDirectNonNgaSuccess);
|
sl@0
|
3829 |
}
|
sl@0
|
3830 |
iState++;
|
sl@0
|
3831 |
}
|
sl@0
|
3832 |
break;
|
sl@0
|
3833 |
#endif
|
sl@0
|
3834 |
default:
|
sl@0
|
3835 |
((CTDirectStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
|
sl@0
|
3836 |
((CTDirectStep*)iStep)->CloseTMSGraphicsStep();
|
sl@0
|
3837 |
TestComplete();
|
sl@0
|
3838 |
break;
|
sl@0
|
3839 |
}
|
sl@0
|
3840 |
((CTDirectStep*)iStep)->RecordTestResultL();
|
sl@0
|
3841 |
}
|
sl@0
|
3842 |
|
sl@0
|
3843 |
CRegionTrackingOnly* CRegionTrackingOnly::NewL(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack,CTWindowGroup& aParent,TRect aExtent,TBool aStart,TBool aOpenWindowInFrontDsa)
|
sl@0
|
3844 |
{
|
sl@0
|
3845 |
CRegionTrackingOnly* self=new(ELeave) CRegionTrackingOnly(aScreenNumber, aId,aCallBack);
|
sl@0
|
3846 |
CleanupStack::PushL(self);
|
sl@0
|
3847 |
self->ConstructL(aParent,aExtent,aOpenWindowInFrontDsa);
|
sl@0
|
3848 |
if (aStart)
|
sl@0
|
3849 |
{
|
sl@0
|
3850 |
self->StartL();
|
sl@0
|
3851 |
self->Started();
|
sl@0
|
3852 |
}
|
sl@0
|
3853 |
CleanupStack::Pop(self);
|
sl@0
|
3854 |
return self;
|
sl@0
|
3855 |
}
|
sl@0
|
3856 |
|
sl@0
|
3857 |
CRegionTrackingOnly::CRegionTrackingOnly(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack)
|
sl@0
|
3858 |
: CColorAnimation(aScreenNumber, aId, aCallBack)
|
sl@0
|
3859 |
{
|
sl@0
|
3860 |
iThreadParam.iScreenNumber = aScreenNumber;
|
sl@0
|
3861 |
}
|
sl@0
|
3862 |
|
sl@0
|
3863 |
void CRegionTrackingOnly::ConstructL(CTWindowGroup& aParent,TRect aExtent,TBool aOpenWindowInFrontDsa)
|
sl@0
|
3864 |
{
|
sl@0
|
3865 |
iExpectedToAbort = aOpenWindowInFrontDsa;
|
sl@0
|
3866 |
CColorAnimation::ConstructL(aParent, aExtent, KRegionTrackingOnly);
|
sl@0
|
3867 |
_LIT(ThreadName,"Create new Window");
|
sl@0
|
3868 |
|
sl@0
|
3869 |
TInt error=iSem.CreateGlobal(KSem_DefectFix_KAA_5J3BLW_Name, 0);
|
sl@0
|
3870 |
if (error==KErrNone)
|
sl@0
|
3871 |
{
|
sl@0
|
3872 |
iAnimRect=aExtent;
|
sl@0
|
3873 |
iThreadParam.iRect = iAnimRect;
|
sl@0
|
3874 |
iThreadParam.iIsInFront = aOpenWindowInFrontDsa;
|
sl@0
|
3875 |
TThreadStartUp function=TThreadStartUp(CreateNewWindowGroup, &iThreadParam);
|
sl@0
|
3876 |
TRequestStatus status;
|
sl@0
|
3877 |
iThread=CProcess::NewThreadRendezvousL(ThreadName,&function,status);
|
sl@0
|
3878 |
User::WaitForRequest(status);
|
sl@0
|
3879 |
if (status != KErrNone)
|
sl@0
|
3880 |
{
|
sl@0
|
3881 |
RDebug::Printf("the request status is returned to be non KErrNone: %d", status.Int());
|
sl@0
|
3882 |
TestFailed(this);
|
sl@0
|
3883 |
}
|
sl@0
|
3884 |
}
|
sl@0
|
3885 |
else
|
sl@0
|
3886 |
{
|
sl@0
|
3887 |
TestFailed(this);
|
sl@0
|
3888 |
}
|
sl@0
|
3889 |
}
|
sl@0
|
3890 |
|
sl@0
|
3891 |
TBool CColorAnimation::TestGcAndScreenDeviceValues()
|
sl@0
|
3892 |
{
|
sl@0
|
3893 |
TBool succeeded = ETrue;
|
sl@0
|
3894 |
_LIT(KErrorLogGraphicContext,"GraphicsContext not NULL when using the region tracking feature only");
|
sl@0
|
3895 |
_LIT(KErrorLogScreenDevice,"ScreenDevice not NULL when using the region tracking feature only");
|
sl@0
|
3896 |
if(iRegionTrackingOnly && iDrawer->Gc() != NULL)
|
sl@0
|
3897 |
{
|
sl@0
|
3898 |
CallBack().Log((TText8*)__FILE__,__LINE__, ESevrErr,KErrorLogGraphicContext);
|
sl@0
|
3899 |
succeeded = EFalse;
|
sl@0
|
3900 |
}
|
sl@0
|
3901 |
if(iRegionTrackingOnly && iDrawer->ScreenDevice() != NULL)
|
sl@0
|
3902 |
{
|
sl@0
|
3903 |
CallBack().Log((TText8*)__FILE__,__LINE__, ESevrErr,KErrorLogScreenDevice);
|
sl@0
|
3904 |
succeeded = EFalse;
|
sl@0
|
3905 |
}
|
sl@0
|
3906 |
return succeeded;
|
sl@0
|
3907 |
}
|
sl@0
|
3908 |
|
sl@0
|
3909 |
void CRegionTrackingOnly::AbortNow(RDirectScreenAccess::TTerminationReasons /*aReason*/)
|
sl@0
|
3910 |
{
|
sl@0
|
3911 |
Stop();
|
sl@0
|
3912 |
}
|
sl@0
|
3913 |
|
sl@0
|
3914 |
void CRegionTrackingOnly::Restart(RDirectScreenAccess::TTerminationReasons/* aReason*/)
|
sl@0
|
3915 |
{
|
sl@0
|
3916 |
if(!TestGcAndScreenDeviceValues())
|
sl@0
|
3917 |
{
|
sl@0
|
3918 |
CallBack().Fail();
|
sl@0
|
3919 |
}
|
sl@0
|
3920 |
if (iExpectedToAbort)
|
sl@0
|
3921 |
{
|
sl@0
|
3922 |
_LIT(KExpected,"DSA got an abort signal as expected");
|
sl@0
|
3923 |
CallBack().Log((TText8*)__FILE__,__LINE__,ESevrInfo,KExpected);
|
sl@0
|
3924 |
}
|
sl@0
|
3925 |
else
|
sl@0
|
3926 |
{
|
sl@0
|
3927 |
_LIT(KError,"DSA got an abort signal even though the window was opened behind it");
|
sl@0
|
3928 |
CallBack().Log((TText8*)__FILE__,__LINE__,ESevrErr,KError);
|
sl@0
|
3929 |
CallBack().Fail();
|
sl@0
|
3930 |
}
|
sl@0
|
3931 |
FinishTest();
|
sl@0
|
3932 |
}
|
sl@0
|
3933 |
|
sl@0
|
3934 |
CRegionTrackingOnly::~CRegionTrackingOnly()
|
sl@0
|
3935 |
{
|
sl@0
|
3936 |
iSem.Close();
|
sl@0
|
3937 |
if(iThread)
|
sl@0
|
3938 |
{
|
sl@0
|
3939 |
TRequestStatus status;
|
sl@0
|
3940 |
iThread->Logon(status);
|
sl@0
|
3941 |
if (iThread->StillAlive())
|
sl@0
|
3942 |
{
|
sl@0
|
3943 |
iThread->Terminate(KErrNone);
|
sl@0
|
3944 |
User::WaitForRequest(status);
|
sl@0
|
3945 |
}
|
sl@0
|
3946 |
delete iThread;
|
sl@0
|
3947 |
}
|
sl@0
|
3948 |
}
|
sl@0
|
3949 |
|
sl@0
|
3950 |
__WS_CONSTRUCT_STEP__(Direct)
|