103
|
1 |
// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// ORDINAL.CPP
|
|
15 |
// Test ordinal position and priority changes on windows
|
|
16 |
//
|
|
17 |
//
|
|
18 |
|
|
19 |
/**
|
|
20 |
@file
|
|
21 |
@test
|
|
22 |
@internalComponent - Internal Symbian test code
|
|
23 |
*/
|
|
24 |
|
|
25 |
#include "TORDINAL.H"
|
|
26 |
|
|
27 |
_LIT(KLogNextSibling,"NextSibling of iChild%d is not iChild%d");
|
|
28 |
_LIT(KLogNoNextSibling,"iChild%d has a NextSibling when it shouldn't");
|
|
29 |
_LIT(KLogPrevSibling,"PrevSibling of iChild%d is not iChild%d");
|
|
30 |
_LIT(KLogNoPrevSibling,"iChild%d has a PrevSibling when it shouldn't");
|
|
31 |
|
|
32 |
CTOrdinal::CTOrdinal(CTestStep* aStep):
|
|
33 |
CTWsGraphicsBase(aStep)
|
|
34 |
{
|
|
35 |
}
|
|
36 |
|
|
37 |
COrdinalWindowBase::COrdinalWindowBase(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep) : iClient(aClient), iTest(aTest), iTestStep(aTestStep)
|
|
38 |
{
|
|
39 |
}
|
|
40 |
|
|
41 |
COrdinalWindow::COrdinalWindow(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep) : COrdinalWindowBase(aClient, aTest, aTestStep), iClientWin(aClient->iWs)
|
|
42 |
{
|
|
43 |
__DECLARE_NAME(_S("COrdinalWindow"));
|
|
44 |
}
|
|
45 |
|
|
46 |
COrdinalWindowGroup::COrdinalWindowGroup(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep) : COrdinalWindowBase(aClient, aTest, aTestStep), iGroupWin(aClient->iWs)
|
|
47 |
{
|
|
48 |
__DECLARE_NAME(_S("COrdinalWindowGroup"));
|
|
49 |
}
|
|
50 |
|
|
51 |
COrdinalWindowBase::~COrdinalWindowBase()
|
|
52 |
{
|
|
53 |
if (iWin)
|
|
54 |
iWin->Close();
|
|
55 |
}
|
|
56 |
|
|
57 |
void COrdinalWindowBase::Draw()
|
|
58 |
{}
|
|
59 |
|
|
60 |
inline RWindowTreeNode* COrdinalWindowBase::WinTreeNode()
|
|
61 |
{
|
|
62 |
return(iWin);
|
|
63 |
}
|
|
64 |
|
|
65 |
inline TUint32 COrdinalWindowBase::Handle()
|
|
66 |
{
|
|
67 |
return reinterpret_cast<TUint>(this);
|
|
68 |
}
|
|
69 |
|
|
70 |
COrdinalWindowBase *COrdinalWindowGroup::NewL(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep)
|
|
71 |
{
|
|
72 |
COrdinalWindowGroup *oWin=new(ELeave) COrdinalWindowGroup(aClient, aTest, aTestStep);
|
|
73 |
TInt err=oWin->iGroupWin.Construct((TUint32)oWin);
|
|
74 |
if (err<0)
|
|
75 |
{
|
|
76 |
delete oWin;
|
|
77 |
User::Leave(err);
|
|
78 |
}
|
|
79 |
oWin->iWin= &oWin->iGroupWin;
|
|
80 |
return(oWin);
|
|
81 |
}
|
|
82 |
|
|
83 |
COrdinalWindowBase *COrdinalWindow::NewL(CTClient* aClient, RWindowTreeNode* aParent, CTestBase* aTest, CTestStep* aTestStep)
|
|
84 |
{
|
|
85 |
COrdinalWindow *oWin=new(ELeave) COrdinalWindow(aClient, aTest, aTestStep);
|
|
86 |
TInt err=oWin->iClientWin.Construct(*aParent,(TUint32)oWin);
|
|
87 |
if (err!=KErrNone)
|
|
88 |
{
|
|
89 |
delete oWin;
|
|
90 |
User::Leave(err);
|
|
91 |
}
|
|
92 |
oWin->iClientWin.Activate();
|
|
93 |
oWin->iWin= &oWin->iClientWin;
|
|
94 |
return(oWin);
|
|
95 |
}
|
|
96 |
|
|
97 |
TInt COrdinalWindowBase::OrdinalPosition()
|
|
98 |
{
|
|
99 |
return(iWin->OrdinalPosition());
|
|
100 |
}
|
|
101 |
|
|
102 |
void COrdinalWindowBase::SetOrdinalPosition(TInt aPos)
|
|
103 |
{
|
|
104 |
iWin->SetOrdinalPosition(aPos);
|
|
105 |
}
|
|
106 |
|
|
107 |
void COrdinalWindowBase::SetOrdinalPosition(TInt aPos,TInt aPri)
|
|
108 |
{
|
|
109 |
iWin->SetOrdinalPosition(aPos,aPri);
|
|
110 |
}
|
|
111 |
|
|
112 |
CTOrdinal::~CTOrdinal()
|
|
113 |
{
|
|
114 |
delete iClient;
|
|
115 |
}
|
|
116 |
|
|
117 |
void DZ(COrdinalWindowBase * &aX)
|
|
118 |
{
|
|
119 |
delete aX;
|
|
120 |
aX=NULL;
|
|
121 |
}
|
|
122 |
|
|
123 |
void CTOrdinal::DestroyWindows()
|
|
124 |
{
|
|
125 |
DZ(iParent);
|
|
126 |
DZ(iParent2);
|
|
127 |
DZ(iParent3);
|
|
128 |
for(TInt child=0;child<ENumChildren;++child)
|
|
129 |
DZ(iChild[child]);
|
|
130 |
}
|
|
131 |
|
|
132 |
void COrdinalWindowBase::TestOP(TInt aTestPos)
|
|
133 |
{
|
|
134 |
iTestStep->TEST(iWin->OrdinalPosition()==aTestPos);
|
|
135 |
}
|
|
136 |
|
|
137 |
void COrdinalWindowBase::SetAndTestOP(TInt aPos,TInt aTestPos)
|
|
138 |
{
|
|
139 |
iWin->SetOrdinalPosition(aPos);
|
|
140 |
iTestStep->TEST(iWin->OrdinalPosition()==aTestPos);
|
|
141 |
}
|
|
142 |
|
|
143 |
void COrdinalWindowBase::SetAndTestOP(TInt aPos)
|
|
144 |
{
|
|
145 |
SetAndTestOP(aPos, aPos);
|
|
146 |
}
|
|
147 |
|
|
148 |
TInt COrdinalWindowBase::SetToLastAndGetOP()
|
|
149 |
{
|
|
150 |
iWin->SetOrdinalPosition(-1);
|
|
151 |
return(iWin->OrdinalPosition());
|
|
152 |
}
|
|
153 |
|
|
154 |
TInt COrdinalWindowBase::SetToLastAndGetOPPri(TInt aPri)
|
|
155 |
{
|
|
156 |
iWin->SetOrdinalPosition(-1, aPri);
|
|
157 |
return(iWin->OrdinalPosition());
|
|
158 |
}
|
|
159 |
|
|
160 |
void COrdinalWindowBase::SetAndTestOPPri(TInt aPos,TInt aPri,TInt aTestPos)
|
|
161 |
{
|
|
162 |
iWin->SetOrdinalPosition(aPos,aPri);
|
|
163 |
iTestStep->TEST(iWin->OrdinalPosition()==aTestPos);
|
|
164 |
iTestStep->TEST(iWin->OrdinalPriority()==aPri);
|
|
165 |
}
|
|
166 |
|
|
167 |
void COrdinalWindowBase::SetAndTestOPPri(TInt aPos,TInt aPri)
|
|
168 |
{
|
|
169 |
SetAndTestOPPri(aPos,aPri,aPos);
|
|
170 |
}
|
|
171 |
|
|
172 |
inline COrdinalWindowBase* COrdinalWindowBase::NextSibling() const
|
|
173 |
{
|
|
174 |
return reinterpret_cast<COrdinalWindow*>(iWin->NextSibling());
|
|
175 |
}
|
|
176 |
|
|
177 |
inline COrdinalWindowBase* COrdinalWindowBase::PrevSibling() const
|
|
178 |
{
|
|
179 |
return reinterpret_cast<COrdinalWindow*>(iWin->PrevSibling());
|
|
180 |
}
|
|
181 |
|
|
182 |
void CTOrdinal::TestWindowOrderNext(TInt aBefore,TInt aAfter)
|
|
183 |
{
|
|
184 |
TInt retVal=(iChild[aBefore]->NextSibling()==iChild[aAfter]);
|
|
185 |
TEST(retVal);
|
|
186 |
if (!retVal)
|
|
187 |
LOG_MESSAGE3(KLogNextSibling,aBefore,aAfter);
|
|
188 |
}
|
|
189 |
|
|
190 |
void CTOrdinal::TestWindowOrderNext(TInt aLast)
|
|
191 |
{
|
|
192 |
TInt retVal=(iChild[aLast]->NextSibling()==0);
|
|
193 |
TEST(retVal);
|
|
194 |
if (!retVal)
|
|
195 |
LOG_MESSAGE2(KLogNoNextSibling,aLast);
|
|
196 |
}
|
|
197 |
|
|
198 |
void CTOrdinal::TestWindowOrderPrev(TInt aAfter,TInt aBefore)
|
|
199 |
{
|
|
200 |
TInt retVal=(iChild[aAfter]->PrevSibling()==iChild[aBefore]);
|
|
201 |
TEST(retVal);
|
|
202 |
if (!retVal)
|
|
203 |
LOG_MESSAGE3(KLogPrevSibling,aAfter,aBefore);
|
|
204 |
}
|
|
205 |
|
|
206 |
void CTOrdinal::TestWindowOrderPrev(TInt aFirst)
|
|
207 |
{
|
|
208 |
TInt retVal=(iChild[aFirst]->PrevSibling()==0);
|
|
209 |
TEST(retVal);
|
|
210 |
if (!retVal)
|
|
211 |
LOG_MESSAGE2(KLogNoPrevSibling,aFirst);
|
|
212 |
}
|
|
213 |
|
|
214 |
void CTOrdinal::OrdinalPos()
|
|
215 |
{
|
|
216 |
TInt last=iChild[0]->SetToLastAndGetOP();
|
|
217 |
iChild[0]->SetAndTestOP(0);
|
|
218 |
iChild[5]->TestOP(5);
|
|
219 |
iChild[1]->SetAndTestOP(3);
|
|
220 |
iChild[0]->SetAndTestOP(0);
|
|
221 |
iChild[0]->SetAndTestOP(-1,last);
|
|
222 |
iChild[0]->SetAndTestOP(-1000,last);
|
|
223 |
iChild[0]->SetAndTestOP(2);
|
|
224 |
iChild[0]->SetAndTestOP(-1000,last);
|
|
225 |
iChild[0]->SetAndTestOP(0);
|
|
226 |
for(TInt index=0;index<=5;index++)
|
|
227 |
iChild[4]->SetAndTestOP(index,index);
|
|
228 |
iChild[0]->SetAndTestOP(-1,last);
|
|
229 |
iChild[1]->SetAndTestOP(-1,last);
|
|
230 |
iChild[2]->SetAndTestOP(-1,last);
|
|
231 |
iChild[3]->SetAndTestOP(-1,last);
|
|
232 |
iChild[4]->SetAndTestOP(-1,last);
|
|
233 |
iChild[5]->SetAndTestOP(-1,last);
|
|
234 |
TInt child;
|
|
235 |
for (child=0;child<ENumChildren-1;++child)
|
|
236 |
TestWindowOrderNext(child,child+1);
|
|
237 |
TestWindowOrderNext(5);
|
|
238 |
}
|
|
239 |
|
|
240 |
void CTOrdinal::OrdinalPriority()
|
|
241 |
{
|
|
242 |
TBool retVal;
|
|
243 |
TInt last12=iChild[2]->SetToLastAndGetOPPri(12);
|
|
244 |
iChild[2]->TestOP(last12);
|
|
245 |
TInt lastKMax=iChild[2]->SetToLastAndGetOPPri(KMaxTInt32);
|
|
246 |
iChild[2]->TestOP(lastKMax);
|
|
247 |
TInt last=iChild[2]->SetToLastAndGetOPPri(0);
|
|
248 |
iChild[2]->TestOP(last);
|
|
249 |
iChild[2]->SetAndTestOPPri(-1,12,last12); // One and only pri 12 window
|
|
250 |
iChild[3]->SetAndTestOPPri(-1,KMaxTInt32,lastKMax); // One and only pri KMaxTInt32 window
|
|
251 |
iChild[1]->SetAndTestOPPri(0,KMaxTInt32);
|
|
252 |
iChild[5]->SetAndTestOP(-1,last-3);
|
|
253 |
iChild[1]->TestOP(0);
|
|
254 |
iChild[0]->SetAndTestOPPri(0,50);
|
|
255 |
iChild[1]->SetAndTestOPPri(0,50);
|
|
256 |
iChild[2]->SetAndTestOPPri(0,50);
|
|
257 |
iChild[3]->SetAndTestOPPri(0,50);
|
|
258 |
iChild[1]->TestOP(2);
|
|
259 |
if (iGroupTest)
|
|
260 |
{
|
|
261 |
retVal=(reinterpret_cast<CBase*>(iChild[0]->NextSibling())==iClient->iGroup);
|
|
262 |
TEST(retVal);
|
|
263 |
if (!retVal)
|
|
264 |
{
|
|
265 |
_LIT(KLog,"iChild0 NextSibling is not the main group window");
|
|
266 |
LOG_MESSAGE(KLog);
|
|
267 |
}
|
|
268 |
retVal=(reinterpret_cast<CBase*>(iClient->iGroup->NextSibling())==iChild[4]);
|
|
269 |
TEST(retVal);
|
|
270 |
if (!retVal)
|
|
271 |
{
|
|
272 |
_LIT(KLog,"NextSibling of main group window is not iChild4");
|
|
273 |
LOG_MESSAGE(KLog);
|
|
274 |
}
|
|
275 |
}
|
|
276 |
else
|
|
277 |
TestWindowOrderNext(0,4);
|
|
278 |
TestWindowOrderNext(4,5);
|
|
279 |
TestWindowOrderNext(5);
|
|
280 |
iChild[2]->SetAndTestOPPri(5,-1,0);
|
|
281 |
iChild[3]->SetAndTestOPPri(5,-1,1);
|
|
282 |
TestWindowOrderNext(5,2);
|
|
283 |
iChild[0]->SetAndTestOPPri(100000,KMinTInt32,0);
|
|
284 |
iChild[1]->SetAndTestOPPri(200000,KMinTInt32,1);
|
|
285 |
iChild[2]->SetAndTestOPPri(300000,KMinTInt32,2);
|
|
286 |
iChild[5]->SetAndTestOPPri(0,0,0);
|
|
287 |
iChild[3]->TestOP(0);
|
|
288 |
iChild[0]->SetAndTestOPPri(0,-1);
|
|
289 |
iChild[1]->SetAndTestOPPri(0,-1);
|
|
290 |
iChild[2]->SetAndTestOPPri(0,-1);
|
|
291 |
iChild[3]->SetAndTestOPPri(0,1);
|
|
292 |
iChild[4]->SetAndTestOPPri(0,1);
|
|
293 |
iChild[5]->SetAndTestOPPri(0,1);
|
|
294 |
TestWindowOrderPrev(0,1);
|
|
295 |
TestWindowOrderPrev(1,2);
|
|
296 |
if (iGroupTest)
|
|
297 |
{
|
|
298 |
retVal=(reinterpret_cast<CBase*>(iChild[2]->PrevSibling())==iClient->iGroup);
|
|
299 |
TEST(retVal);
|
|
300 |
if (!retVal)
|
|
301 |
{
|
|
302 |
_LIT(KLog,"iChild2 PrevSibling is not the main group window");
|
|
303 |
LOG_MESSAGE(KLog);
|
|
304 |
}
|
|
305 |
retVal=(reinterpret_cast<CBase*>(iClient->iGroup->PrevSibling())==iChild[3]);
|
|
306 |
TEST(retVal);
|
|
307 |
if (!retVal)
|
|
308 |
{
|
|
309 |
_LIT(KLog,"PrevSibling of main group window is not iChild3");
|
|
310 |
LOG_MESSAGE(KLog);
|
|
311 |
}
|
|
312 |
}
|
|
313 |
else
|
|
314 |
TestWindowOrderPrev(2,3);
|
|
315 |
TestWindowOrderPrev(3,4);
|
|
316 |
TestWindowOrderPrev(4,5);
|
|
317 |
TestWindowOrderPrev(5);
|
|
318 |
}
|
|
319 |
|
|
320 |
void CTOrdinal::ConstructL()
|
|
321 |
{
|
|
322 |
iClient=new(ELeave) COrdinalClient();
|
|
323 |
iClient->SetScreenNumber(iTest->iScreenNumber);
|
|
324 |
iClient->ConstructL();
|
|
325 |
}
|
|
326 |
|
|
327 |
/**
|
|
328 |
@SYMTestCaseID GRAPHICS-WSERV-0446
|
|
329 |
|
|
330 |
@SYMCR CR1164
|
|
331 |
|
|
332 |
@SYMTestCaseDesc Test ClientHandle function returns right value
|
|
333 |
|
|
334 |
@SYMTestPriority High
|
|
335 |
|
|
336 |
@SYMTestStatus Implemented
|
|
337 |
|
|
338 |
@SYMTestActions Call this function on windows at various times
|
|
339 |
|
|
340 |
@SYMTestExpectedResults The value set when window was created is returned
|
|
341 |
*/
|
|
342 |
void CTOrdinal::CreateWindowsL(TInt aMode)
|
|
343 |
{
|
|
344 |
RWindowTreeNode* parent=NULL;
|
|
345 |
RWindowTreeNode* base=iClient->iGroup->WinTreeNode();
|
|
346 |
TInt errors=0;
|
|
347 |
|
|
348 |
if (base->Child()!=0)
|
|
349 |
{
|
|
350 |
_LIT(KErrText,"Main Group Window has children at start of test");
|
|
351 |
LOG_MESSAGE(KErrText);
|
|
352 |
AutoPanic(EAutoPanicGroupWinHasChild);
|
|
353 |
}
|
|
354 |
if (base->ClientHandle()!=reinterpret_cast<TUint32&>(iClient->iGroup))
|
|
355 |
++errors;
|
|
356 |
if (base->Parent()!=0)
|
|
357 |
++errors;
|
|
358 |
TEST(errors==0);
|
|
359 |
if (errors>0)
|
|
360 |
{
|
|
361 |
_LIT(KErrText,"Handles of Main Group Window are not as expected");
|
|
362 |
LOG_MESSAGE2(KErrText,errors);
|
|
363 |
}
|
|
364 |
iGroupTest=EFalse;
|
|
365 |
switch(aMode)
|
|
366 |
{
|
|
367 |
case 3:
|
|
368 |
iParent=COrdinalWindow::NewL(iClient,base,iTest,iStep);
|
|
369 |
parent=iParent->WinTreeNode();
|
|
370 |
CheckHandlesOnNewWindow(iClient->iGroup,iParent);
|
|
371 |
break;
|
|
372 |
case 1:
|
|
373 |
parent=iClient->iGroup->WinTreeNode();
|
|
374 |
break;
|
|
375 |
case 2:
|
|
376 |
iParent=COrdinalWindow::NewL(iClient,base,iTest,iStep);
|
|
377 |
CheckHandlesOnNewWindow(iClient->iGroup,iParent);
|
|
378 |
iParent2=COrdinalWindow::NewL(iClient,iParent->WinTreeNode(),iTest,iStep);
|
|
379 |
CheckHandlesOnNewWindow(iParent,iParent2);
|
|
380 |
iParent3=COrdinalWindow::NewL(iClient,iParent2->WinTreeNode(),iTest,iStep);
|
|
381 |
parent=iParent3->WinTreeNode();
|
|
382 |
CheckHandlesOnNewWindow(iParent2,iParent3);
|
|
383 |
break;
|
|
384 |
case 0:
|
|
385 |
iGroupTest=ETrue;
|
|
386 |
for (TInt child=ENumChildren-1;child>=0;--child)
|
|
387 |
iChild[child]=COrdinalWindowGroup::NewL(iClient,iTest,iStep);
|
|
388 |
CheckHandles(0);
|
|
389 |
return;
|
|
390 |
}
|
|
391 |
for (TInt child=ENumChildren-1;child>=0;--child)
|
|
392 |
{
|
|
393 |
iChild[child]=COrdinalWindow::NewL(iClient,parent,iTest,iStep);
|
|
394 |
if (iChild[child]->Handle()!=parent->Child())
|
|
395 |
++errors;
|
|
396 |
}
|
|
397 |
TEST(errors==0);
|
|
398 |
if (errors>0)
|
|
399 |
{
|
|
400 |
_LIT(KErrText,"%d windows were not the first child");
|
|
401 |
LOG_MESSAGE2(KErrText,errors);
|
|
402 |
}
|
|
403 |
CheckHandles(parent->ClientHandle());
|
|
404 |
}
|
|
405 |
|
|
406 |
void CTOrdinal::CheckHandlesOnNewWindow(CTWindowGroup* aParent,COrdinalWindowBase* aWin)
|
|
407 |
{
|
|
408 |
TInt errors=0;
|
|
409 |
if (aParent->WinTreeNode()->Child()!=aWin->Handle())
|
|
410 |
++errors;
|
|
411 |
if (aWin->WinTreeNode()->Parent()!=reinterpret_cast<TUint32&>(aParent))
|
|
412 |
++errors;
|
|
413 |
CheckHandlesOnNewWindow(errors,aWin);
|
|
414 |
}
|
|
415 |
|
|
416 |
void CTOrdinal::CheckHandlesOnNewWindow(COrdinalWindowBase* aParent,COrdinalWindowBase* aWin)
|
|
417 |
{
|
|
418 |
TInt errors=0;
|
|
419 |
if (aParent->WinTreeNode()->Child()!=aWin->Handle())
|
|
420 |
++errors;
|
|
421 |
if (aWin->WinTreeNode()->Parent()!=aParent->Handle())
|
|
422 |
++errors;
|
|
423 |
CheckHandlesOnNewWindow(errors,aWin);
|
|
424 |
}
|
|
425 |
|
|
426 |
void CTOrdinal::CheckHandlesOnNewWindow(TInt aErrors,COrdinalWindowBase* aWin)
|
|
427 |
{
|
|
428 |
RWindowTreeNode* win=aWin->WinTreeNode();
|
|
429 |
if (win->ClientHandle()!=aWin->Handle())
|
|
430 |
++aErrors;
|
|
431 |
if (win->PrevSibling()!=0)
|
|
432 |
++aErrors;
|
|
433 |
if (win->NextSibling()!=0)
|
|
434 |
++aErrors;
|
|
435 |
if (win->Child()!=0)
|
|
436 |
++aErrors;
|
|
437 |
TEST(aErrors==0);
|
|
438 |
if (aErrors>0)
|
|
439 |
{
|
|
440 |
_LIT(KErrText,"%d errors in handles of newly created window");
|
|
441 |
LOG_MESSAGE2(KErrText,aErrors);
|
|
442 |
}
|
|
443 |
}
|
|
444 |
|
|
445 |
void CTOrdinal::CheckHandles(TUint aParent)
|
|
446 |
{
|
|
447 |
TInt errors=0;
|
|
448 |
TInt child;
|
|
449 |
for (child=0;child<ENumChildren;++child)
|
|
450 |
{
|
|
451 |
if (iChild[child]->WinTreeNode()->ClientHandle()!=iChild[child]->Handle())
|
|
452 |
++errors;
|
|
453 |
}
|
|
454 |
TEST(errors==0);
|
|
455 |
if (errors>0)
|
|
456 |
{
|
|
457 |
_LIT(KErrText,"%d windows gave wrong client handle");
|
|
458 |
LOG_MESSAGE2(KErrText,errors);
|
|
459 |
errors=0;
|
|
460 |
}
|
|
461 |
for (child=0;child<ENumChildren;++child)
|
|
462 |
{
|
|
463 |
if (iChild[child]->WinTreeNode()->Parent()!=aParent)
|
|
464 |
++errors;
|
|
465 |
}
|
|
466 |
TEST(errors==0);
|
|
467 |
if (errors>0)
|
|
468 |
{
|
|
469 |
_LIT(KErrText,"%d children gave wrong parent handle");
|
|
470 |
LOG_MESSAGE2(KErrText,errors);
|
|
471 |
errors=0;
|
|
472 |
}
|
|
473 |
for (child=1;child<ENumChildren;++child)
|
|
474 |
{
|
|
475 |
if (iChild[child-1]->WinTreeNode()->NextSibling()!=iChild[child]->Handle())
|
|
476 |
++errors;
|
|
477 |
}
|
|
478 |
if (iChild[5]->WinTreeNode()->NextSibling()!=0 && !iGroupTest)
|
|
479 |
++errors;
|
|
480 |
TEST(errors==0);
|
|
481 |
if (errors>0)
|
|
482 |
{
|
|
483 |
_LIT(KErrText,"%d windows gave wrong next sibling handle");
|
|
484 |
LOG_MESSAGE2(KErrText,errors);
|
|
485 |
errors=0;
|
|
486 |
}
|
|
487 |
if (iChild[0]->WinTreeNode()->PrevSibling()!=0 && !iGroupTest)
|
|
488 |
++errors;
|
|
489 |
for (child=1;child<ENumChildren;++child)
|
|
490 |
{
|
|
491 |
if (iChild[child]->WinTreeNode()->PrevSibling()!=iChild[child-1]->Handle())
|
|
492 |
++errors;
|
|
493 |
}
|
|
494 |
TEST(errors==0);
|
|
495 |
if (errors>0)
|
|
496 |
{
|
|
497 |
_LIT(KErrText,"%d windows gave wrong prev sibling handle");
|
|
498 |
LOG_MESSAGE2(KErrText,errors);
|
|
499 |
}
|
|
500 |
}
|
|
501 |
|
|
502 |
COrdinalClient::COrdinalClient()
|
|
503 |
{
|
|
504 |
}
|
|
505 |
|
|
506 |
void COrdinalClient::ConstructL()
|
|
507 |
{
|
|
508 |
User::LeaveIfError(iWs.Connect());
|
|
509 |
// change to correct screen
|
|
510 |
//
|
|
511 |
iScreen = new (ELeave) CWsScreenDevice(iWs);
|
|
512 |
User::LeaveIfError(iScreen->Construct(iScreenNumber));
|
|
513 |
|
|
514 |
TheClient->iGroup->WinTreeNode()->SetOrdinalPosition(0,-2000000000);
|
|
515 |
TheClient->iWs.Flush();
|
|
516 |
iGroup=new(ELeave) CTWindowGroup(this);
|
|
517 |
iGroup->ConstructL();
|
|
518 |
}
|
|
519 |
|
|
520 |
COrdinalClient::~COrdinalClient()
|
|
521 |
{
|
|
522 |
TheClient->iGroup->WinTreeNode()->SetOrdinalPosition(0,0);
|
|
523 |
}
|
|
524 |
|
|
525 |
void COrdinalClient::KeyL(const TKeyEvent &,const TTime &)
|
|
526 |
{
|
|
527 |
}
|
|
528 |
|
|
529 |
void CTOrdinal::RunTestCaseL(TInt /*aCurTestCase*/)
|
|
530 |
{
|
|
531 |
_LIT(KTest1,"Ordinal 1");
|
|
532 |
((CTOrdinalStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
|
|
533 |
switch(++iTest->iState)
|
|
534 |
{
|
|
535 |
/**
|
|
536 |
@SYMTestCaseID GRAPHICS-WSERV-0217
|
|
537 |
|
|
538 |
@SYMDEF DEF081259
|
|
539 |
|
|
540 |
@SYMTestCaseDesc Test ordinal position and priority changes on windows
|
|
541 |
|
|
542 |
@SYMTestPriority High
|
|
543 |
|
|
544 |
@SYMTestStatus Implemented
|
|
545 |
|
|
546 |
@SYMTestActions Set different ordinal positions and priorities on a
|
|
547 |
number of windows and check they have been set
|
|
548 |
correctly
|
|
549 |
|
|
550 |
@SYMTestExpectedResults The positions and priorities are set correctly
|
|
551 |
*/
|
|
552 |
case 1:
|
|
553 |
((CTOrdinalStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0217"));
|
|
554 |
iTest->LogSubTest(KTest1);
|
|
555 |
{
|
|
556 |
for(TInt index=0;index<4;index++)
|
|
557 |
{
|
|
558 |
((CTOrdinalStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0446"));
|
|
559 |
CreateWindowsL(index);
|
|
560 |
((CTOrdinalStep*)iStep)->RecordTestResultL();
|
|
561 |
OrdinalPos();
|
|
562 |
OrdinalPriority();
|
|
563 |
DestroyWindows();
|
|
564 |
}
|
|
565 |
}
|
|
566 |
((CTOrdinalStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0217"));
|
|
567 |
if (!iStep->TestStepResult() == EPass)
|
|
568 |
TEST(EFalse);
|
|
569 |
break;
|
|
570 |
default:
|
|
571 |
((CTOrdinalStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
|
|
572 |
((CTOrdinalStep*)iStep)->CloseTMSGraphicsStep();
|
|
573 |
TestComplete();
|
|
574 |
break;
|
|
575 |
};
|
|
576 |
((CTOrdinalStep*)iStep)->RecordTestResultL();
|
|
577 |
}
|
|
578 |
|
|
579 |
__WS_CONSTRUCT_STEP__(Ordinal)
|