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 pointer capture
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
/**
|
sl@0
|
19 |
@file
|
sl@0
|
20 |
@test
|
sl@0
|
21 |
@internalComponent - Internal Symbian test code
|
sl@0
|
22 |
*/
|
sl@0
|
23 |
|
sl@0
|
24 |
#include "TPNTCAP.H"
|
sl@0
|
25 |
|
sl@0
|
26 |
#define LOGGING on
|
sl@0
|
27 |
|
sl@0
|
28 |
_LIT(ClickOnMe,"Click on me");
|
sl@0
|
29 |
|
sl@0
|
30 |
//
|
sl@0
|
31 |
// CMcConnection
|
sl@0
|
32 |
|
sl@0
|
33 |
CPcConnection::CPcConnection(CTPointerCapture *aTest) : iTest(aTest)
|
sl@0
|
34 |
{
|
sl@0
|
35 |
}
|
sl@0
|
36 |
|
sl@0
|
37 |
CPcConnection::~CPcConnection()
|
sl@0
|
38 |
{
|
sl@0
|
39 |
}
|
sl@0
|
40 |
|
sl@0
|
41 |
void CPcConnection::ConstructL()
|
sl@0
|
42 |
{
|
sl@0
|
43 |
CTClient::SetScreenNumber(iTest->TestBase()->ScreenNumber());
|
sl@0
|
44 |
CTClient::ConstructL();
|
sl@0
|
45 |
iGroup=new(ELeave) CTWindowGroup(this);
|
sl@0
|
46 |
iGroup->ConstructL();
|
sl@0
|
47 |
iGroup->GroupWin()->SetOrdinalPosition(0,1);
|
sl@0
|
48 |
iGroup->GroupWin()->EnableReceiptOfFocus(EFalse);
|
sl@0
|
49 |
iWs.Flush();
|
sl@0
|
50 |
}
|
sl@0
|
51 |
|
sl@0
|
52 |
//
|
sl@0
|
53 |
// CPcWindow, base class //
|
sl@0
|
54 |
//
|
sl@0
|
55 |
|
sl@0
|
56 |
CPcWindowBase::CPcWindowBase(CTPointerCapture *aTest) : CTWin(), iTest(aTest)
|
sl@0
|
57 |
{
|
sl@0
|
58 |
}
|
sl@0
|
59 |
|
sl@0
|
60 |
void CPcWindowBase::SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
|
sl@0
|
61 |
{
|
sl@0
|
62 |
ConstructExtLD(*parent,pos,size);
|
sl@0
|
63 |
iWin.SetBackgroundColor(iBack);
|
sl@0
|
64 |
Activate();
|
sl@0
|
65 |
AssignGC(aGc);
|
sl@0
|
66 |
}
|
sl@0
|
67 |
|
sl@0
|
68 |
void CPcWindowBase::SetUpL(TPoint pos,TSize size,CTWinBase *parent)
|
sl@0
|
69 |
{
|
sl@0
|
70 |
SetUpL(pos,size,parent,*iTest->Client()->iGc);
|
sl@0
|
71 |
}
|
sl@0
|
72 |
|
sl@0
|
73 |
void CPcWindowBase::SubStateChanged()
|
sl@0
|
74 |
{
|
sl@0
|
75 |
iWin.Invalidate();
|
sl@0
|
76 |
Client()->iWs.Flush();
|
sl@0
|
77 |
}
|
sl@0
|
78 |
|
sl@0
|
79 |
void CPcWindowBase::Draw(TDesC &aBuf)
|
sl@0
|
80 |
{
|
sl@0
|
81 |
iGc->Clear();
|
sl@0
|
82 |
iGc->SetPenColor(iBack.Gray4()>1 ? TRgb(0,0,0) : TRgb(255,255,255));
|
sl@0
|
83 |
iGc->DrawText(aBuf, TPoint(10,20));
|
sl@0
|
84 |
}
|
sl@0
|
85 |
|
sl@0
|
86 |
void CPcWindowBase::PointerL(const TPointerEvent &pointer,const TTime &)
|
sl@0
|
87 |
{
|
sl@0
|
88 |
#if defined(LOGGING)
|
sl@0
|
89 |
_LIT(KLog1,"Pointer Event Recieved Type=%S State=%d SubState=%d");
|
sl@0
|
90 |
_LIT(KDown,"Down");
|
sl@0
|
91 |
_LIT(KUp,"Up");
|
sl@0
|
92 |
iTest->LOG_MESSAGE4(KLog1,&(pointer.iType?KUp():KDown()),iTest->State(),iTest->SubState());
|
sl@0
|
93 |
#endif
|
sl@0
|
94 |
if (pointer.iType==TPointerEvent::EButton1Down && !iTest->iFailed)
|
sl@0
|
95 |
{
|
sl@0
|
96 |
if (iTest->SubState()==ERootWindow) // Root window click, must not be inside this window
|
sl@0
|
97 |
{
|
sl@0
|
98 |
if (TRect(Size()).Contains(pointer.iPosition))
|
sl@0
|
99 |
{
|
sl@0
|
100 |
iTest->TestFailed();
|
sl@0
|
101 |
return;
|
sl@0
|
102 |
}
|
sl@0
|
103 |
}
|
sl@0
|
104 |
TInt ret;
|
sl@0
|
105 |
if ((ret=PointerDown())==EFailed)
|
sl@0
|
106 |
iTest->TestFailed();
|
sl@0
|
107 |
else
|
sl@0
|
108 |
iTest->IncSubStateL(ret==ENeedsDDEvent);
|
sl@0
|
109 |
}
|
sl@0
|
110 |
#if defined(LOGGING)
|
sl@0
|
111 |
_LIT(KLog2,"End of processing Pointer Event");
|
sl@0
|
112 |
iTest->LOG_MESSAGE(KLog2);
|
sl@0
|
113 |
#endif
|
sl@0
|
114 |
}
|
sl@0
|
115 |
|
sl@0
|
116 |
void CPcWindowBase::DragDropL(const TPointerEvent &pointer,const TTime &)
|
sl@0
|
117 |
{
|
sl@0
|
118 |
#if defined(LOGGING)
|
sl@0
|
119 |
_LIT(KLog,"CPcWindowBase::DragDropL Type=%d State=%d SubState=%d");
|
sl@0
|
120 |
iTest->LOG_MESSAGE4(KLog,pointer.iType,iTest->State(),iTest->SubState());
|
sl@0
|
121 |
#endif
|
sl@0
|
122 |
switch(iTest->State())
|
sl@0
|
123 |
{
|
sl@0
|
124 |
case ENormalCaptureWithoutFocus:
|
sl@0
|
125 |
if (iTest->SubState()==0)
|
sl@0
|
126 |
break;
|
sl@0
|
127 |
case ECaptureDisabled:
|
sl@0
|
128 |
case ENormalCapture:
|
sl@0
|
129 |
case ECaptureAllGroups:
|
sl@0
|
130 |
iTest->TestFailed();
|
sl@0
|
131 |
break;
|
sl@0
|
132 |
}
|
sl@0
|
133 |
if (pointer.iType==TPointerEvent::EButton1Down && !iTest->iFailed)
|
sl@0
|
134 |
{
|
sl@0
|
135 |
if (DragDrop()==EFailed)
|
sl@0
|
136 |
iTest->TestFailed();
|
sl@0
|
137 |
else
|
sl@0
|
138 |
iTest->GotDDL();
|
sl@0
|
139 |
}
|
sl@0
|
140 |
}
|
sl@0
|
141 |
//
|
sl@0
|
142 |
|
sl@0
|
143 |
CPcWindowMain::CPcWindowMain(CTPointerCapture *aTest) : CPcWindowBase(aTest)
|
sl@0
|
144 |
{
|
sl@0
|
145 |
iBack=TRgb::Gray256(236);
|
sl@0
|
146 |
}
|
sl@0
|
147 |
|
sl@0
|
148 |
TPointerCheckRet CPcWindowMain::PointerDown()
|
sl@0
|
149 |
{
|
sl@0
|
150 |
#if defined(LOGGING)
|
sl@0
|
151 |
_LIT(KLog1,"CPcWindowMain::PointerDown State=%d SubState=%d");
|
sl@0
|
152 |
iTest->LOG_MESSAGE3(KLog1,iTest->State(),iTest->SubState());
|
sl@0
|
153 |
#endif
|
sl@0
|
154 |
switch(iTest->State())
|
sl@0
|
155 |
{
|
sl@0
|
156 |
case ECaptureDisabled:
|
sl@0
|
157 |
if (iTest->SubState()==EMainWindow)
|
sl@0
|
158 |
return(EOkay);
|
sl@0
|
159 |
break;
|
sl@0
|
160 |
case ENormalCapture:
|
sl@0
|
161 |
switch(iTest->SubState())
|
sl@0
|
162 |
{
|
sl@0
|
163 |
case EMainWindow:
|
sl@0
|
164 |
case ERootWindow:
|
sl@0
|
165 |
return(EOkay);
|
sl@0
|
166 |
default:
|
sl@0
|
167 |
break;
|
sl@0
|
168 |
}
|
sl@0
|
169 |
break;
|
sl@0
|
170 |
case ECaptureAllGroups:
|
sl@0
|
171 |
switch(iTest->SubState())
|
sl@0
|
172 |
{
|
sl@0
|
173 |
case EMainWindow:
|
sl@0
|
174 |
case EOtherGroup:
|
sl@0
|
175 |
case EOtherSession:
|
sl@0
|
176 |
case ERootWindow:
|
sl@0
|
177 |
return(EOkay);
|
sl@0
|
178 |
default:
|
sl@0
|
179 |
break;
|
sl@0
|
180 |
}
|
sl@0
|
181 |
break;
|
sl@0
|
182 |
case EDragDropCapture:
|
sl@0
|
183 |
switch(iTest->SubState())
|
sl@0
|
184 |
{
|
sl@0
|
185 |
case EMainWindow:
|
sl@0
|
186 |
return(ENeedsDDEvent);
|
sl@0
|
187 |
case ERootWindow:
|
sl@0
|
188 |
return(EOkay);
|
sl@0
|
189 |
default:
|
sl@0
|
190 |
break;
|
sl@0
|
191 |
}
|
sl@0
|
192 |
break;
|
sl@0
|
193 |
case EDragDropCaptureAllGroups:
|
sl@0
|
194 |
switch(iTest->SubState())
|
sl@0
|
195 |
{
|
sl@0
|
196 |
case EMainWindow:
|
sl@0
|
197 |
case EOtherGroup:
|
sl@0
|
198 |
case EOtherSession:
|
sl@0
|
199 |
return(ENeedsDDEvent);
|
sl@0
|
200 |
case ERootWindow:
|
sl@0
|
201 |
return(EOkay);
|
sl@0
|
202 |
default:
|
sl@0
|
203 |
break;
|
sl@0
|
204 |
}
|
sl@0
|
205 |
break;
|
sl@0
|
206 |
case ENormalCaptureWithoutFocus:
|
sl@0
|
207 |
switch(iTest->SubState())
|
sl@0
|
208 |
{
|
sl@0
|
209 |
case EMainWindow:
|
sl@0
|
210 |
return(EOkay);
|
sl@0
|
211 |
default:
|
sl@0
|
212 |
break;
|
sl@0
|
213 |
}
|
sl@0
|
214 |
break;
|
sl@0
|
215 |
default:
|
sl@0
|
216 |
break;
|
sl@0
|
217 |
}
|
sl@0
|
218 |
#if defined(LOGGING)
|
sl@0
|
219 |
_LIT(KLog2,"CPcWindowMain::PointerDown FAILED State=%d SubState=%d");
|
sl@0
|
220 |
iTest->LOG_MESSAGE3(KLog2,iTest->State(),iTest->SubState());
|
sl@0
|
221 |
#endif
|
sl@0
|
222 |
return(EFailed);
|
sl@0
|
223 |
}
|
sl@0
|
224 |
|
sl@0
|
225 |
TPointerCheckRet CPcWindowMain::DragDrop()
|
sl@0
|
226 |
{
|
sl@0
|
227 |
#if defined(LOGGING)
|
sl@0
|
228 |
_LIT(KLog1,"CPcWindowMain::DragDrop State=%d SubState=%d");
|
sl@0
|
229 |
iTest->LOG_MESSAGE3(KLog1,iTest->State(),iTest->SubState());
|
sl@0
|
230 |
#endif
|
sl@0
|
231 |
switch(iTest->State())
|
sl@0
|
232 |
{
|
sl@0
|
233 |
case EDragDropCapture:
|
sl@0
|
234 |
case EDragDropCaptureAllGroups:
|
sl@0
|
235 |
switch(iTest->SubState())
|
sl@0
|
236 |
{
|
sl@0
|
237 |
case EMainWindow:
|
sl@0
|
238 |
return(EOkay);
|
sl@0
|
239 |
default:
|
sl@0
|
240 |
break;
|
sl@0
|
241 |
}
|
sl@0
|
242 |
break;
|
sl@0
|
243 |
default:
|
sl@0
|
244 |
break;
|
sl@0
|
245 |
}
|
sl@0
|
246 |
#if defined(LOGGING)
|
sl@0
|
247 |
_LIT(KLog2,"CPcWindowMain::DragDrop FAILED State=%d SubState=%d");
|
sl@0
|
248 |
iTest->LOG_MESSAGE3(KLog2,iTest->State(),iTest->SubState());
|
sl@0
|
249 |
#endif
|
sl@0
|
250 |
return(EFailed);
|
sl@0
|
251 |
}
|
sl@0
|
252 |
|
sl@0
|
253 |
void CPcWindowMain::Draw()
|
sl@0
|
254 |
{
|
sl@0
|
255 |
TBuf<0x40> buf;
|
sl@0
|
256 |
if (iTest->State()==ECaptureDisabled)
|
sl@0
|
257 |
{
|
sl@0
|
258 |
switch(iTest->SubState())
|
sl@0
|
259 |
{
|
sl@0
|
260 |
case EMainWindow:
|
sl@0
|
261 |
buf.Copy(ClickOnMe);
|
sl@0
|
262 |
break;
|
sl@0
|
263 |
}
|
sl@0
|
264 |
}
|
sl@0
|
265 |
else
|
sl@0
|
266 |
{
|
sl@0
|
267 |
switch(iTest->SubState())
|
sl@0
|
268 |
{
|
sl@0
|
269 |
case EMainWindow:
|
sl@0
|
270 |
buf.Copy(ClickOnMe);
|
sl@0
|
271 |
break;
|
sl@0
|
272 |
case EChildWindow:
|
sl@0
|
273 |
case EOtherGroup:
|
sl@0
|
274 |
case EOtherSession:
|
sl@0
|
275 |
break;
|
sl@0
|
276 |
case ERootWindow:
|
sl@0
|
277 |
{
|
sl@0
|
278 |
_LIT(ClickOnRoot,"Click on the root window");
|
sl@0
|
279 |
if (iTest->State()<ENormalCaptureWithoutFocus)
|
sl@0
|
280 |
buf.Copy(ClickOnRoot);
|
sl@0
|
281 |
else
|
sl@0
|
282 |
{
|
sl@0
|
283 |
_LIT(AndEscape,", then press <Escape>");
|
sl@0
|
284 |
buf.Copy(ClickOnRoot);
|
sl@0
|
285 |
buf.Append(AndEscape);
|
sl@0
|
286 |
}
|
sl@0
|
287 |
}
|
sl@0
|
288 |
break;
|
sl@0
|
289 |
}
|
sl@0
|
290 |
}
|
sl@0
|
291 |
CPcWindowBase::Draw(buf);
|
sl@0
|
292 |
}
|
sl@0
|
293 |
|
sl@0
|
294 |
void CPcWindowMain::WinKeyL(const TKeyEvent &aKey,const TTime &)
|
sl@0
|
295 |
{
|
sl@0
|
296 |
switch(aKey.iCode)
|
sl@0
|
297 |
{
|
sl@0
|
298 |
case EKeyEscape:
|
sl@0
|
299 |
iTest->AbortTests();
|
sl@0
|
300 |
break;
|
sl@0
|
301 |
case EKeyEnter:
|
sl@0
|
302 |
if (iTest->SubState()==ERootWindow)
|
sl@0
|
303 |
iTest->IncSubStateL(EFalse);
|
sl@0
|
304 |
break;
|
sl@0
|
305 |
}
|
sl@0
|
306 |
}
|
sl@0
|
307 |
|
sl@0
|
308 |
//
|
sl@0
|
309 |
|
sl@0
|
310 |
CPcWindowChild::CPcWindowChild(CTPointerCapture *aTest) : CPcWindowBase(aTest)
|
sl@0
|
311 |
{
|
sl@0
|
312 |
iBack=TRgb::Gray256(85);
|
sl@0
|
313 |
}
|
sl@0
|
314 |
|
sl@0
|
315 |
TPointerCheckRet CPcWindowChild::PointerDown()
|
sl@0
|
316 |
{
|
sl@0
|
317 |
#if defined(LOGGING)
|
sl@0
|
318 |
_LIT(KLog1,"CPcWindowChild::PointerDown State=%d SubState=%d");
|
sl@0
|
319 |
iTest->LOG_MESSAGE3(KLog1,iTest->State(),iTest->SubState());
|
sl@0
|
320 |
#endif
|
sl@0
|
321 |
switch(iTest->State())
|
sl@0
|
322 |
{
|
sl@0
|
323 |
case ECaptureDisabled:
|
sl@0
|
324 |
break;
|
sl@0
|
325 |
default:
|
sl@0
|
326 |
switch(iTest->SubState())
|
sl@0
|
327 |
{
|
sl@0
|
328 |
case EChildWindow:
|
sl@0
|
329 |
return(EOkay);
|
sl@0
|
330 |
default:
|
sl@0
|
331 |
break;
|
sl@0
|
332 |
}
|
sl@0
|
333 |
break;
|
sl@0
|
334 |
}
|
sl@0
|
335 |
#if defined(LOGGING)
|
sl@0
|
336 |
_LIT(KLog2,"CPcWindowChild::PointerDown FAILED State=%d SubState=%d");
|
sl@0
|
337 |
iTest->LOG_MESSAGE3(KLog2,iTest->State(),iTest->SubState());
|
sl@0
|
338 |
#endif
|
sl@0
|
339 |
return(EFailed);
|
sl@0
|
340 |
}
|
sl@0
|
341 |
|
sl@0
|
342 |
TPointerCheckRet CPcWindowChild::DragDrop()
|
sl@0
|
343 |
{
|
sl@0
|
344 |
#if defined(LOGGING)
|
sl@0
|
345 |
_LIT(KLog1,"CPcWindowChild::PointerDown State=%d SubState=%d");
|
sl@0
|
346 |
iTest->LOG_MESSAGE3(KLog1,iTest->State(),iTest->SubState());
|
sl@0
|
347 |
#endif
|
sl@0
|
348 |
switch(iTest->State())
|
sl@0
|
349 |
{
|
sl@0
|
350 |
case EDragDropCapture:
|
sl@0
|
351 |
case EDragDropCaptureAllGroups:
|
sl@0
|
352 |
switch(iTest->SubState())
|
sl@0
|
353 |
{
|
sl@0
|
354 |
case EChildWindow:
|
sl@0
|
355 |
return(EOkay);
|
sl@0
|
356 |
default:
|
sl@0
|
357 |
break;
|
sl@0
|
358 |
}
|
sl@0
|
359 |
break;
|
sl@0
|
360 |
default:
|
sl@0
|
361 |
break;
|
sl@0
|
362 |
}
|
sl@0
|
363 |
#if defined(LOGGING)
|
sl@0
|
364 |
_LIT(KLog2,"CPcWindowChild::PointerDown FAILED State=%d SubState=%d");
|
sl@0
|
365 |
iTest->LOG_MESSAGE3(KLog2,iTest->State(),iTest->SubState());
|
sl@0
|
366 |
#endif
|
sl@0
|
367 |
return(EFailed);
|
sl@0
|
368 |
}
|
sl@0
|
369 |
|
sl@0
|
370 |
void CPcWindowChild::Draw()
|
sl@0
|
371 |
{
|
sl@0
|
372 |
TBuf<0x40> buf;
|
sl@0
|
373 |
if (iTest->State()!=ECaptureDisabled)
|
sl@0
|
374 |
{
|
sl@0
|
375 |
switch(iTest->SubState())
|
sl@0
|
376 |
{
|
sl@0
|
377 |
case EChildWindow:
|
sl@0
|
378 |
buf.Copy(ClickOnMe);
|
sl@0
|
379 |
break;
|
sl@0
|
380 |
default:
|
sl@0
|
381 |
break;
|
sl@0
|
382 |
}
|
sl@0
|
383 |
}
|
sl@0
|
384 |
CPcWindowBase::Draw(buf);
|
sl@0
|
385 |
}
|
sl@0
|
386 |
|
sl@0
|
387 |
//
|
sl@0
|
388 |
|
sl@0
|
389 |
CPcWindowNickFocusGroup::CPcWindowNickFocusGroup(CTPointerCapture *aTest, CTClient *aClient) : CTWindowGroup(aClient), iTest(aTest)
|
sl@0
|
390 |
{
|
sl@0
|
391 |
}
|
sl@0
|
392 |
|
sl@0
|
393 |
void CPcWindowNickFocusGroup::KeyL(const TKeyEvent &aKey,const TTime &)
|
sl@0
|
394 |
{
|
sl@0
|
395 |
if (aKey.iCode==EKeyEscape)
|
sl@0
|
396 |
iTest->IncSubStateL(EFalse);
|
sl@0
|
397 |
}
|
sl@0
|
398 |
|
sl@0
|
399 |
//
|
sl@0
|
400 |
|
sl@0
|
401 |
CPcWindowAltGroup::CPcWindowAltGroup(CTPointerCapture *aTest) : CPcWindowBase(aTest)
|
sl@0
|
402 |
{
|
sl@0
|
403 |
iBack=TRgb::Gray256(236);
|
sl@0
|
404 |
}
|
sl@0
|
405 |
|
sl@0
|
406 |
TPointerCheckRet CPcWindowAltGroup::PointerDown()
|
sl@0
|
407 |
{
|
sl@0
|
408 |
#if defined(LOGGING)
|
sl@0
|
409 |
_LIT(KLog1,"CPcWindowAltGroup::PointerDown State=%d SubState=%d");
|
sl@0
|
410 |
iTest->LOG_MESSAGE3(KLog1,iTest->State(),iTest->SubState());
|
sl@0
|
411 |
#endif
|
sl@0
|
412 |
switch(iTest->State())
|
sl@0
|
413 |
{
|
sl@0
|
414 |
case ECaptureDisabled:
|
sl@0
|
415 |
if (iTest->SubState()==EChildWindow)
|
sl@0
|
416 |
return(EOkay);
|
sl@0
|
417 |
break;
|
sl@0
|
418 |
case ENormalCapture:
|
sl@0
|
419 |
case EDragDropCapture:
|
sl@0
|
420 |
case ENormalCaptureWithoutFocus:
|
sl@0
|
421 |
switch(iTest->SubState())
|
sl@0
|
422 |
{
|
sl@0
|
423 |
case EOtherGroup:
|
sl@0
|
424 |
return(EOkay);
|
sl@0
|
425 |
default:
|
sl@0
|
426 |
break;
|
sl@0
|
427 |
}
|
sl@0
|
428 |
break;
|
sl@0
|
429 |
default:
|
sl@0
|
430 |
break;
|
sl@0
|
431 |
}
|
sl@0
|
432 |
#if defined(LOGGING)
|
sl@0
|
433 |
_LIT(KLog2,"CPcWindowAltGroup::PointerDown FAILED State=%d SubState=%d");
|
sl@0
|
434 |
iTest->LOG_MESSAGE3(KLog2,iTest->State(),iTest->SubState());
|
sl@0
|
435 |
#endif
|
sl@0
|
436 |
return(EFailed);
|
sl@0
|
437 |
}
|
sl@0
|
438 |
|
sl@0
|
439 |
TPointerCheckRet CPcWindowAltGroup::DragDrop()
|
sl@0
|
440 |
{
|
sl@0
|
441 |
#if defined(LOGGING)
|
sl@0
|
442 |
_LIT(KLog1,"CPcWindowAltGroup::DragDrop State=%d SubState=%d");
|
sl@0
|
443 |
iTest->LOG_MESSAGE3(KLog1,iTest->State(),iTest->SubState());
|
sl@0
|
444 |
#endif
|
sl@0
|
445 |
switch(iTest->State())
|
sl@0
|
446 |
{
|
sl@0
|
447 |
case EDragDropCapture:
|
sl@0
|
448 |
case EDragDropCaptureAllGroups:
|
sl@0
|
449 |
switch(iTest->SubState())
|
sl@0
|
450 |
{
|
sl@0
|
451 |
case EOtherGroup:
|
sl@0
|
452 |
return(EOkay);
|
sl@0
|
453 |
default:
|
sl@0
|
454 |
break;
|
sl@0
|
455 |
}
|
sl@0
|
456 |
break;
|
sl@0
|
457 |
default:
|
sl@0
|
458 |
break;
|
sl@0
|
459 |
}
|
sl@0
|
460 |
#if defined(LOGGING)
|
sl@0
|
461 |
_LIT(KLog2,"CPcWindowAltGroup::DragDrop FAILED State=%d SubState=%d");
|
sl@0
|
462 |
iTest->LOG_MESSAGE3(KLog2,iTest->State(),iTest->SubState());
|
sl@0
|
463 |
#endif
|
sl@0
|
464 |
return(EFailed);
|
sl@0
|
465 |
}
|
sl@0
|
466 |
|
sl@0
|
467 |
void CPcWindowAltGroup::Draw()
|
sl@0
|
468 |
{
|
sl@0
|
469 |
TBuf<0x40> buf;
|
sl@0
|
470 |
if (iTest->State()==ECaptureDisabled)
|
sl@0
|
471 |
{
|
sl@0
|
472 |
switch(iTest->SubState())
|
sl@0
|
473 |
{
|
sl@0
|
474 |
case EMainWindow:
|
sl@0
|
475 |
break;
|
sl@0
|
476 |
case EChildWindow:
|
sl@0
|
477 |
buf.Copy(ClickOnMe);
|
sl@0
|
478 |
break;
|
sl@0
|
479 |
}
|
sl@0
|
480 |
}
|
sl@0
|
481 |
else
|
sl@0
|
482 |
{
|
sl@0
|
483 |
switch(iTest->SubState())
|
sl@0
|
484 |
{
|
sl@0
|
485 |
case EOtherGroup:
|
sl@0
|
486 |
buf.Copy(ClickOnMe);
|
sl@0
|
487 |
break;
|
sl@0
|
488 |
default:
|
sl@0
|
489 |
break;
|
sl@0
|
490 |
}
|
sl@0
|
491 |
}
|
sl@0
|
492 |
CPcWindowBase::Draw(buf);
|
sl@0
|
493 |
}
|
sl@0
|
494 |
|
sl@0
|
495 |
//
|
sl@0
|
496 |
|
sl@0
|
497 |
CPcWindowAltConnection::CPcWindowAltConnection(CTPointerCapture *aTest) : CPcWindowBase(aTest)
|
sl@0
|
498 |
{
|
sl@0
|
499 |
iBack=TRgb::Gray256(236);
|
sl@0
|
500 |
}
|
sl@0
|
501 |
|
sl@0
|
502 |
TPointerCheckRet CPcWindowAltConnection::PointerDown()
|
sl@0
|
503 |
{
|
sl@0
|
504 |
#if defined(LOGGING)
|
sl@0
|
505 |
_LIT(KLog1,"CPcWindowAltConnection::PointerDown State=%d SubState=%d");
|
sl@0
|
506 |
iTest->LOG_MESSAGE3(KLog1,iTest->State(),iTest->SubState());
|
sl@0
|
507 |
#endif
|
sl@0
|
508 |
switch(iTest->State())
|
sl@0
|
509 |
{
|
sl@0
|
510 |
case ECaptureDisabled:
|
sl@0
|
511 |
if (iTest->SubState()==EChildWindow)
|
sl@0
|
512 |
return(EOkay);
|
sl@0
|
513 |
break;
|
sl@0
|
514 |
case ENormalCapture:
|
sl@0
|
515 |
case EDragDropCapture:
|
sl@0
|
516 |
case ENormalCaptureWithoutFocus:
|
sl@0
|
517 |
switch(iTest->SubState())
|
sl@0
|
518 |
{
|
sl@0
|
519 |
case EOtherSession:
|
sl@0
|
520 |
return(EOkay);
|
sl@0
|
521 |
default:
|
sl@0
|
522 |
break;
|
sl@0
|
523 |
}
|
sl@0
|
524 |
break;
|
sl@0
|
525 |
default:
|
sl@0
|
526 |
break;
|
sl@0
|
527 |
}
|
sl@0
|
528 |
#if defined(LOGGING)
|
sl@0
|
529 |
_LIT(KLog2,"CPcWindowAltConnection::PointerDown FAILED State=%d SubState=%d");
|
sl@0
|
530 |
iTest->LOG_MESSAGE3(KLog2,iTest->State(),iTest->SubState());
|
sl@0
|
531 |
#endif
|
sl@0
|
532 |
return(EFailed);
|
sl@0
|
533 |
}
|
sl@0
|
534 |
|
sl@0
|
535 |
TPointerCheckRet CPcWindowAltConnection::DragDrop()
|
sl@0
|
536 |
{
|
sl@0
|
537 |
#if defined(LOGGING)
|
sl@0
|
538 |
_LIT(KLog1,"CPcWindowAltConnection::DragDrop State=%d SubState=%d");
|
sl@0
|
539 |
iTest->LOG_MESSAGE3(KLog1,iTest->State(),iTest->SubState());
|
sl@0
|
540 |
#endif
|
sl@0
|
541 |
switch(iTest->State())
|
sl@0
|
542 |
{
|
sl@0
|
543 |
case EDragDropCapture:
|
sl@0
|
544 |
case EDragDropCaptureAllGroups:
|
sl@0
|
545 |
switch(iTest->SubState())
|
sl@0
|
546 |
{
|
sl@0
|
547 |
case EOtherSession:
|
sl@0
|
548 |
return(EOkay);
|
sl@0
|
549 |
default:
|
sl@0
|
550 |
break;
|
sl@0
|
551 |
}
|
sl@0
|
552 |
break;
|
sl@0
|
553 |
default:
|
sl@0
|
554 |
break;
|
sl@0
|
555 |
}
|
sl@0
|
556 |
#if defined(LOGGING)
|
sl@0
|
557 |
_LIT(KLog2,"CPcWindowAltConnection::DragDrop FAILED State=%d SubState=%d");
|
sl@0
|
558 |
iTest->LOG_MESSAGE3(KLog2,iTest->State(),iTest->SubState());
|
sl@0
|
559 |
#endif
|
sl@0
|
560 |
return(EFailed);
|
sl@0
|
561 |
}
|
sl@0
|
562 |
|
sl@0
|
563 |
void CPcWindowAltConnection::Draw()
|
sl@0
|
564 |
{
|
sl@0
|
565 |
TBuf<0x40> buf;
|
sl@0
|
566 |
if (iTest->State()!=ECaptureDisabled)
|
sl@0
|
567 |
{
|
sl@0
|
568 |
switch(iTest->SubState())
|
sl@0
|
569 |
{
|
sl@0
|
570 |
case EOtherSession:
|
sl@0
|
571 |
buf.Copy(ClickOnMe);
|
sl@0
|
572 |
break;
|
sl@0
|
573 |
default:
|
sl@0
|
574 |
break;
|
sl@0
|
575 |
}
|
sl@0
|
576 |
}
|
sl@0
|
577 |
CPcWindowBase::Draw(buf);
|
sl@0
|
578 |
}
|
sl@0
|
579 |
|
sl@0
|
580 |
//
|
sl@0
|
581 |
|
sl@0
|
582 |
CTPointerCapture::CTPointerCapture(CTestStep* aStep) : CTWsGraphicsBase(aStep)
|
sl@0
|
583 |
{
|
sl@0
|
584 |
iSubState=0;
|
sl@0
|
585 |
iFailed=EFalse;
|
sl@0
|
586 |
}
|
sl@0
|
587 |
|
sl@0
|
588 |
CTPointerCapture::~CTPointerCapture()
|
sl@0
|
589 |
{
|
sl@0
|
590 |
delete iNickFocusBlankWin;
|
sl@0
|
591 |
delete iNickFocusGroup;
|
sl@0
|
592 |
delete iAltConnectionWin;
|
sl@0
|
593 |
delete iAltConnection;
|
sl@0
|
594 |
delete iChildWin;
|
sl@0
|
595 |
delete iMainWin;
|
sl@0
|
596 |
delete iMainGroup;
|
sl@0
|
597 |
delete iAltGroupWin;
|
sl@0
|
598 |
delete iAltGroup;
|
sl@0
|
599 |
}
|
sl@0
|
600 |
|
sl@0
|
601 |
void CTPointerCapture::TestFailed()
|
sl@0
|
602 |
{
|
sl@0
|
603 |
if (iFailed)
|
sl@0
|
604 |
{
|
sl@0
|
605 |
_LIT(KLog,"Test Failed State=%d SubState=%d");
|
sl@0
|
606 |
LOG_MESSAGE3(KLog,iTest->iState,iSubState);
|
sl@0
|
607 |
}
|
sl@0
|
608 |
__ASSERT_DEBUG(iFailed==EFalse,AutoPanic(ETManPanicPcFailed));
|
sl@0
|
609 |
TInt dRet=1;
|
sl@0
|
610 |
#if !defined(DISABLE_FAIL_DIALOG)
|
sl@0
|
611 |
Client()->iGroup->GroupWin()->SetOrdinalPosition(0,10); // Put error dialog on top of test windows
|
sl@0
|
612 |
TRAPD(err,dRet=doTestFailedL());
|
sl@0
|
613 |
Client()->iGroup->GroupWin()->SetOrdinalPosition(0,0);
|
sl@0
|
614 |
#endif
|
sl@0
|
615 |
switch(dRet)
|
sl@0
|
616 |
{
|
sl@0
|
617 |
case 0:
|
sl@0
|
618 |
break;
|
sl@0
|
619 |
case 1:
|
sl@0
|
620 |
iFailed=ETrue;
|
sl@0
|
621 |
NextTest();
|
sl@0
|
622 |
break;
|
sl@0
|
623 |
}
|
sl@0
|
624 |
}
|
sl@0
|
625 |
|
sl@0
|
626 |
TInt CTPointerCapture::doTestFailedL()
|
sl@0
|
627 |
{
|
sl@0
|
628 |
CTDialog *dialog=new(ELeave) CTDialog();
|
sl@0
|
629 |
dialog->SetTitle(_L("Pointer capture test failed"));
|
sl@0
|
630 |
dialog->SetNumButtons(2);
|
sl@0
|
631 |
dialog->SetButtonText(0,_L("Retest"));
|
sl@0
|
632 |
dialog->SetButtonText(1,_L("Fail"));
|
sl@0
|
633 |
dialog->ConstructLD(*Client()->iGroup,*Client()->iGc);
|
sl@0
|
634 |
return dialog->Display();
|
sl@0
|
635 |
}
|
sl@0
|
636 |
|
sl@0
|
637 |
TInt CTPointerCapture::State() const
|
sl@0
|
638 |
{
|
sl@0
|
639 |
return(iTest->iState);
|
sl@0
|
640 |
}
|
sl@0
|
641 |
|
sl@0
|
642 |
TInt CTPointerCapture::SubState() const
|
sl@0
|
643 |
{
|
sl@0
|
644 |
return(iSubState);
|
sl@0
|
645 |
}
|
sl@0
|
646 |
|
sl@0
|
647 |
void CTPointerCapture::doIncSubStateL()
|
sl@0
|
648 |
{
|
sl@0
|
649 |
iSubState++;
|
sl@0
|
650 |
TInt max=0;
|
sl@0
|
651 |
switch(iTest->iState)
|
sl@0
|
652 |
{
|
sl@0
|
653 |
case ECaptureDisabled:
|
sl@0
|
654 |
max=ESubStates1;
|
sl@0
|
655 |
break;
|
sl@0
|
656 |
case ENormalCapture:
|
sl@0
|
657 |
max=ESubStates2;
|
sl@0
|
658 |
break;
|
sl@0
|
659 |
case ECaptureAllGroups:
|
sl@0
|
660 |
max=ESubStates3;
|
sl@0
|
661 |
break;
|
sl@0
|
662 |
case EDragDropCapture:
|
sl@0
|
663 |
max=ESubStates4;
|
sl@0
|
664 |
break;
|
sl@0
|
665 |
case EDragDropCaptureAllGroups:
|
sl@0
|
666 |
max=ESubStates5;
|
sl@0
|
667 |
break;
|
sl@0
|
668 |
case ENormalCaptureWithoutFocus:
|
sl@0
|
669 |
max=ESubStates6;
|
sl@0
|
670 |
break;
|
sl@0
|
671 |
}
|
sl@0
|
672 |
//SubState 4 has been broken by something in the framework
|
sl@0
|
673 |
if (iSubState==max || iSubState==4)
|
sl@0
|
674 |
{
|
sl@0
|
675 |
#if defined(LOGGING)
|
sl@0
|
676 |
_LIT(KLog,"IncState OldState=%d SubState=%d");
|
sl@0
|
677 |
LOG_MESSAGE3(KLog,iTest->iState,iSubState);
|
sl@0
|
678 |
#endif
|
sl@0
|
679 |
NextTest();
|
sl@0
|
680 |
}
|
sl@0
|
681 |
StateChanged();
|
sl@0
|
682 |
TheClient->WaitForRedrawsToFinish();
|
sl@0
|
683 |
if (iSubState>0)
|
sl@0
|
684 |
SendEventsL();
|
sl@0
|
685 |
}
|
sl@0
|
686 |
|
sl@0
|
687 |
void CTPointerCapture::GotDDL()
|
sl@0
|
688 |
{
|
sl@0
|
689 |
if (iDDState==DDStateWaiting)
|
sl@0
|
690 |
doIncSubStateL();
|
sl@0
|
691 |
else
|
sl@0
|
692 |
iDDState=DDStateGot;
|
sl@0
|
693 |
}
|
sl@0
|
694 |
|
sl@0
|
695 |
void CTPointerCapture::IncSubStateL(TBool aNeedsDD)
|
sl@0
|
696 |
{
|
sl@0
|
697 |
if (!aNeedsDD)
|
sl@0
|
698 |
{
|
sl@0
|
699 |
if (iDDState!=DDStateNull)
|
sl@0
|
700 |
TestFailed();
|
sl@0
|
701 |
else
|
sl@0
|
702 |
doIncSubStateL();
|
sl@0
|
703 |
}
|
sl@0
|
704 |
else if (iDDState==DDStateGot)
|
sl@0
|
705 |
doIncSubStateL();
|
sl@0
|
706 |
else
|
sl@0
|
707 |
iDDState=DDStateWaiting;
|
sl@0
|
708 |
}
|
sl@0
|
709 |
|
sl@0
|
710 |
void CTPointerCapture::StateChanged()
|
sl@0
|
711 |
{
|
sl@0
|
712 |
iDDState=DDStateNull;
|
sl@0
|
713 |
iChildWin->SubStateChanged();
|
sl@0
|
714 |
iMainWin->SubStateChanged();
|
sl@0
|
715 |
iAltGroupWin->SubStateChanged();
|
sl@0
|
716 |
iAltConnectionWin->SubStateChanged();
|
sl@0
|
717 |
}
|
sl@0
|
718 |
|
sl@0
|
719 |
void CTPointerCapture::AbortTests()
|
sl@0
|
720 |
{
|
sl@0
|
721 |
iTest->iState=99;
|
sl@0
|
722 |
}
|
sl@0
|
723 |
|
sl@0
|
724 |
void CTPointerCapture::NextTest()
|
sl@0
|
725 |
{
|
sl@0
|
726 |
TEST(!iFailed);
|
sl@0
|
727 |
if (iFailed)
|
sl@0
|
728 |
{
|
sl@0
|
729 |
_LIT(KLog,"SubTest %d failed");
|
sl@0
|
730 |
LOG_MESSAGE2(KLog,iTest->iState);
|
sl@0
|
731 |
}
|
sl@0
|
732 |
++iTest->iState;
|
sl@0
|
733 |
iSubState=0;
|
sl@0
|
734 |
iFailed=EFalse;
|
sl@0
|
735 |
CaseComplete();
|
sl@0
|
736 |
_LIT(KLog,"Done NextTest NewSubTest %d");
|
sl@0
|
737 |
LOG_MESSAGE2(KLog,iTest->iState);
|
sl@0
|
738 |
}
|
sl@0
|
739 |
|
sl@0
|
740 |
void CTPointerCapture::ConstructL()
|
sl@0
|
741 |
{
|
sl@0
|
742 |
TheClient->iWs.SetPointerCursorArea(iTest->iNormalPointerCursorArea);
|
sl@0
|
743 |
iScreenSize=TSize(TheClient->iScreen->SizeInPixels());
|
sl@0
|
744 |
TInt winWidth2=iScreenSize.iWidth/2-EWinBorderSize*2;
|
sl@0
|
745 |
TInt winWidth4=iScreenSize.iWidth/4-EWinBorderSize*2;
|
sl@0
|
746 |
TInt winHeight=iScreenSize.iHeight/2-EWinBorderSize*2;
|
sl@0
|
747 |
//
|
sl@0
|
748 |
iMainGroup=new(ELeave) CTWindowGroup(Client());
|
sl@0
|
749 |
iMainGroup->ConstructL();
|
sl@0
|
750 |
iMainGroup->GroupWin()->SetOrdinalPosition(0,1);
|
sl@0
|
751 |
iMainWin=new(ELeave) CPcWindowMain(this);
|
sl@0
|
752 |
iMainWin->SetUpL(TPoint(EWinBorderSize,EWinBorderSize) ,TSize(winWidth2,winHeight) ,iMainGroup);
|
sl@0
|
753 |
iMainGroup->SetCurrentWindow(iMainWin);
|
sl@0
|
754 |
iChildWin=new(ELeave) CPcWindowChild(this);
|
sl@0
|
755 |
iChildWin->SetUpL(TPoint(0,winHeight/2) ,TSize(winWidth2,winHeight/2) ,iMainWin);
|
sl@0
|
756 |
//
|
sl@0
|
757 |
iAltGroup=new(ELeave) CTWindowGroup(Client());
|
sl@0
|
758 |
iAltGroup->ConstructL();
|
sl@0
|
759 |
iAltGroup->GroupWin()->SetOrdinalPosition(0,1);
|
sl@0
|
760 |
iAltGroup->GroupWin()->EnableReceiptOfFocus(EFalse);
|
sl@0
|
761 |
iAltGroupWin=new(ELeave) CPcWindowAltGroup(this);
|
sl@0
|
762 |
iAltGroupWin->SetUpL(TPoint(iScreenSize.iWidth/2+EWinBorderSize,EWinBorderSize) ,TSize(winWidth4,winHeight) ,iAltGroup);
|
sl@0
|
763 |
//
|
sl@0
|
764 |
iAltConnection=new(ELeave) CPcConnection(this);
|
sl@0
|
765 |
iAltConnection->ConstructL();
|
sl@0
|
766 |
iAltConnectionWin=new(ELeave) CPcWindowAltConnection(this);
|
sl@0
|
767 |
iAltConnectionWin->SetUpL(TPoint(iScreenSize.iWidth/4*3+EWinBorderSize,EWinBorderSize) ,TSize(winWidth4,winHeight),iAltConnection->iGroup,*iAltConnection->iGc);
|
sl@0
|
768 |
iTest->DelayIfFullRomL();
|
sl@0
|
769 |
SetSelfDrive(ETrue);
|
sl@0
|
770 |
}
|
sl@0
|
771 |
|
sl@0
|
772 |
void CTPointerCapture::NickFocusL()
|
sl@0
|
773 |
{
|
sl@0
|
774 |
iNickFocusGroup=new(ELeave) CPcWindowNickFocusGroup(this,Client());
|
sl@0
|
775 |
iNickFocusGroup->ConstructL();
|
sl@0
|
776 |
iNickFocusGroup->GroupWin()->SetOrdinalPosition(0,2);
|
sl@0
|
777 |
iNickFocusBlankWin=new(ELeave) CTBlankWindow();
|
sl@0
|
778 |
iNickFocusBlankWin->ConstructL(*iNickFocusGroup);
|
sl@0
|
779 |
iNickFocusBlankWin->SetSize(TSize(1,1));
|
sl@0
|
780 |
iNickFocusBlankWin->Activate();
|
sl@0
|
781 |
}
|
sl@0
|
782 |
|
sl@0
|
783 |
void CTPointerCapture::SetCapture(TInt aCaptureFlags)
|
sl@0
|
784 |
{
|
sl@0
|
785 |
#if defined(LOGGING)
|
sl@0
|
786 |
_LIT(KLog,"Change Capture State=%d CaptureFlags=0x%x");
|
sl@0
|
787 |
LOG_MESSAGE3(KLog,iTest->iState,aCaptureFlags);
|
sl@0
|
788 |
#endif
|
sl@0
|
789 |
iMainWin->Win()->SetPointerCapture(aCaptureFlags);
|
sl@0
|
790 |
}
|
sl@0
|
791 |
|
sl@0
|
792 |
void CTPointerCapture::SendEventsL()
|
sl@0
|
793 |
{
|
sl@0
|
794 |
#if defined(LOGGING)
|
sl@0
|
795 |
_LIT(KLog,"SendEvent State=%d SubState=%d");
|
sl@0
|
796 |
LOG_MESSAGE3(KLog,iTest->iState,iSubState);
|
sl@0
|
797 |
#endif
|
sl@0
|
798 |
switch (iSubState)
|
sl@0
|
799 |
{
|
sl@0
|
800 |
case 0:
|
sl@0
|
801 |
iTest->SimulatePointerDownUp(iScreenSize.iWidth/4,iScreenSize.iHeight/8+EWinBorderSize/2);
|
sl@0
|
802 |
break;
|
sl@0
|
803 |
case 1:
|
sl@0
|
804 |
if (iTest->iState>ECaptureDisabled)
|
sl@0
|
805 |
{
|
sl@0
|
806 |
iTest->SimulatePointerDownUp(iScreenSize.iWidth/4,3*iScreenSize.iHeight/8-EWinBorderSize/2);
|
sl@0
|
807 |
break;
|
sl@0
|
808 |
}
|
sl@0
|
809 |
case 2:
|
sl@0
|
810 |
iTest->SimulatePointerDownUp(5*iScreenSize.iWidth/8,iScreenSize.iHeight/4);
|
sl@0
|
811 |
break;
|
sl@0
|
812 |
case 3:
|
sl@0
|
813 |
iTest->SimulatePointerDownUp(7*iScreenSize.iWidth/8,iScreenSize.iHeight/4);
|
sl@0
|
814 |
break;
|
sl@0
|
815 |
case 4:
|
sl@0
|
816 |
if (iTest->IsFullRomL())
|
sl@0
|
817 |
iTest->SimulateKeyDownUp(EStdKeyEnter);
|
sl@0
|
818 |
else
|
sl@0
|
819 |
iTest->SimulatePointerDownUp(0,0);
|
sl@0
|
820 |
if (iTest->iState==ENormalCaptureWithoutFocus)
|
sl@0
|
821 |
{
|
sl@0
|
822 |
iTest->SimulateKeyDownUp(EStdKeyEscape);
|
sl@0
|
823 |
break;
|
sl@0
|
824 |
}
|
sl@0
|
825 |
break;
|
sl@0
|
826 |
default:
|
sl@0
|
827 |
TEST(EFalse);
|
sl@0
|
828 |
}
|
sl@0
|
829 |
TheClient->iWs.Flush();
|
sl@0
|
830 |
}
|
sl@0
|
831 |
|
sl@0
|
832 |
void CTPointerCapture::RunTestCaseL(TInt /*aCurTestCase*/)
|
sl@0
|
833 |
{
|
sl@0
|
834 |
_LIT(TestNoCapture,"No capture");
|
sl@0
|
835 |
_LIT(TestNormalCapture,"Normal capture");
|
sl@0
|
836 |
_LIT(TestAllGroups,"All groups");
|
sl@0
|
837 |
_LIT(TestDragDrop,"Drag & Drop");
|
sl@0
|
838 |
_LIT(TestDragDropAllGroups,"Drag & Drop All groups");
|
sl@0
|
839 |
_LIT(TestWithoutFocus,"Without focus");
|
sl@0
|
840 |
StateChanged();
|
sl@0
|
841 |
|
sl@0
|
842 |
if (!TestBase()->ConfigurationSupportsPointerEventTesting())
|
sl@0
|
843 |
{
|
sl@0
|
844 |
INFO_PRINTF1(_L("Test skipped because config does not support pointer event testing"));
|
sl@0
|
845 |
TestComplete();
|
sl@0
|
846 |
return;
|
sl@0
|
847 |
}
|
sl@0
|
848 |
|
sl@0
|
849 |
((CTPointerCaptureStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
|
sl@0
|
850 |
switch(iTest->iState)
|
sl@0
|
851 |
{
|
sl@0
|
852 |
/**
|
sl@0
|
853 |
|
sl@0
|
854 |
@SYMTestCaseID GRAPHICS-WSERV-0290
|
sl@0
|
855 |
|
sl@0
|
856 |
@SYMDEF DEF081259
|
sl@0
|
857 |
|
sl@0
|
858 |
@SYMTestCaseDesc Test pointer capture can be disabled
|
sl@0
|
859 |
|
sl@0
|
860 |
@SYMTestPriority High
|
sl@0
|
861 |
|
sl@0
|
862 |
@SYMTestStatus Implemented
|
sl@0
|
863 |
|
sl@0
|
864 |
@SYMTestActions Disable the pointer capture to the screen and simulate
|
sl@0
|
865 |
capture with the pointer
|
sl@0
|
866 |
|
sl@0
|
867 |
@SYMTestExpectedResults The pointer capture has been disabled
|
sl@0
|
868 |
|
sl@0
|
869 |
*/
|
sl@0
|
870 |
case ECaptureDisabled:
|
sl@0
|
871 |
((CTPointerCaptureStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0290"));
|
sl@0
|
872 |
if (TheClient->iScreen->GetScreenNumber()>0)
|
sl@0
|
873 |
{
|
sl@0
|
874 |
_LIT(KLog,"Cannot run this test on the 2nd screen - all pointer events goto the 1st screen");
|
sl@0
|
875 |
LOG_MESSAGE(KLog);
|
sl@0
|
876 |
TestComplete();
|
sl@0
|
877 |
}
|
sl@0
|
878 |
iTest->LogSubTest(TestNoCapture);
|
sl@0
|
879 |
SetCapture(RWindowBase::TCaptureDisabled);
|
sl@0
|
880 |
break;
|
sl@0
|
881 |
/**
|
sl@0
|
882 |
|
sl@0
|
883 |
@SYMTestCaseID GRAPHICS-WSERV-0291
|
sl@0
|
884 |
|
sl@0
|
885 |
@SYMDEF DEF081259
|
sl@0
|
886 |
|
sl@0
|
887 |
@SYMTestCaseDesc Test pointer capture can be enabled
|
sl@0
|
888 |
|
sl@0
|
889 |
@SYMTestPriority High
|
sl@0
|
890 |
|
sl@0
|
891 |
@SYMTestStatus Implemented
|
sl@0
|
892 |
|
sl@0
|
893 |
@SYMTestActions Enable the pointer capture to the screen and simulate
|
sl@0
|
894 |
capture with the pointer
|
sl@0
|
895 |
|
sl@0
|
896 |
@SYMTestExpectedResults The pointer capture has been enabled and works
|
sl@0
|
897 |
correctly
|
sl@0
|
898 |
|
sl@0
|
899 |
*/
|
sl@0
|
900 |
case ENormalCapture:
|
sl@0
|
901 |
((CTPointerCaptureStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0291"));
|
sl@0
|
902 |
iTest->LogSubTest(TestNormalCapture);
|
sl@0
|
903 |
SetCapture(RWindowBase::TCaptureEnabled);
|
sl@0
|
904 |
break;
|
sl@0
|
905 |
/**
|
sl@0
|
906 |
|
sl@0
|
907 |
@SYMTestCaseID GRAPHICS-WSERV-0292
|
sl@0
|
908 |
|
sl@0
|
909 |
@SYMDEF DEF081259
|
sl@0
|
910 |
|
sl@0
|
911 |
@SYMTestCaseDesc Test pointer capture can be enabled for
|
sl@0
|
912 |
windows belonging to any group
|
sl@0
|
913 |
|
sl@0
|
914 |
@SYMTestPriority High
|
sl@0
|
915 |
|
sl@0
|
916 |
@SYMTestStatus Implemented
|
sl@0
|
917 |
|
sl@0
|
918 |
@SYMTestActions Enable the pointer capture to all windows and simulate
|
sl@0
|
919 |
capture with the pointer
|
sl@0
|
920 |
|
sl@0
|
921 |
@SYMTestExpectedResults The pointer capture has been enabled and works
|
sl@0
|
922 |
correctly
|
sl@0
|
923 |
|
sl@0
|
924 |
*/
|
sl@0
|
925 |
case ECaptureAllGroups:
|
sl@0
|
926 |
((CTPointerCaptureStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0292"));
|
sl@0
|
927 |
iTest->LogSubTest(TestAllGroups);
|
sl@0
|
928 |
SetCapture(RWindowBase::TCaptureEnabled|RWindowBase::TCaptureFlagAllGroups);
|
sl@0
|
929 |
break;
|
sl@0
|
930 |
/**
|
sl@0
|
931 |
|
sl@0
|
932 |
@SYMTestCaseID GRAPHICS-WSERV-0293
|
sl@0
|
933 |
|
sl@0
|
934 |
@SYMDEF DEF081259
|
sl@0
|
935 |
|
sl@0
|
936 |
@SYMTestCaseDesc Test drag and drop pointer capture can be enabled for
|
sl@0
|
937 |
windows belonging to any group
|
sl@0
|
938 |
|
sl@0
|
939 |
@SYMTestPriority High
|
sl@0
|
940 |
|
sl@0
|
941 |
@SYMTestStatus Implemented
|
sl@0
|
942 |
|
sl@0
|
943 |
@SYMTestActions Enable drag and drop pointer capture to all windows and simulate
|
sl@0
|
944 |
capture with the pointer
|
sl@0
|
945 |
|
sl@0
|
946 |
@SYMTestExpectedResults The pointer capture has been enabled and works
|
sl@0
|
947 |
correctly
|
sl@0
|
948 |
|
sl@0
|
949 |
*/
|
sl@0
|
950 |
case EDragDropCapture:
|
sl@0
|
951 |
((CTPointerCaptureStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0293"));
|
sl@0
|
952 |
iTest->LogSubTest(TestDragDrop);
|
sl@0
|
953 |
SetCapture(RWindowBase::TCaptureDragDrop&~RWindowBase::TCaptureFlagAllGroups);
|
sl@0
|
954 |
break;
|
sl@0
|
955 |
/**
|
sl@0
|
956 |
|
sl@0
|
957 |
@SYMTestCaseID GRAPHICS-WSERV-0294
|
sl@0
|
958 |
|
sl@0
|
959 |
@SYMDEF DEF081259
|
sl@0
|
960 |
|
sl@0
|
961 |
@SYMTestCaseDesc Test drag and drop pointer capture can be enabled
|
sl@0
|
962 |
|
sl@0
|
963 |
@SYMTestPriority High
|
sl@0
|
964 |
|
sl@0
|
965 |
@SYMTestStatus Implemented
|
sl@0
|
966 |
|
sl@0
|
967 |
@SYMTestActions Enable drag and drop pointer capture and simulate
|
sl@0
|
968 |
capture with the pointer
|
sl@0
|
969 |
|
sl@0
|
970 |
@SYMTestExpectedResults The pointer capture has been enabled and works
|
sl@0
|
971 |
correctly
|
sl@0
|
972 |
|
sl@0
|
973 |
*/
|
sl@0
|
974 |
case EDragDropCaptureAllGroups:
|
sl@0
|
975 |
((CTPointerCaptureStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0294"));
|
sl@0
|
976 |
iTest->LogSubTest(TestDragDropAllGroups);
|
sl@0
|
977 |
SetCapture(RWindowBase::TCaptureDragDrop);
|
sl@0
|
978 |
break;
|
sl@0
|
979 |
/**
|
sl@0
|
980 |
|
sl@0
|
981 |
@SYMTestCaseID GRAPHICS-WSERV-0295
|
sl@0
|
982 |
|
sl@0
|
983 |
@SYMDEF DEF081259
|
sl@0
|
984 |
|
sl@0
|
985 |
@SYMTestCaseDesc Test pointer capture can be enabled
|
sl@0
|
986 |
|
sl@0
|
987 |
@SYMTestPriority High
|
sl@0
|
988 |
|
sl@0
|
989 |
@SYMTestStatus Implemented
|
sl@0
|
990 |
|
sl@0
|
991 |
@SYMTestActions Enable the pointer capture to the screen and simulate capture
|
sl@0
|
992 |
with the pointer when the screen does not have the focus
|
sl@0
|
993 |
|
sl@0
|
994 |
@SYMTestExpectedResults The pointer capture has been enabled and works
|
sl@0
|
995 |
correctly
|
sl@0
|
996 |
|
sl@0
|
997 |
*/
|
sl@0
|
998 |
case ENormalCaptureWithoutFocus:
|
sl@0
|
999 |
((CTPointerCaptureStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0295"));
|
sl@0
|
1000 |
iTest->LogSubTest(TestWithoutFocus);
|
sl@0
|
1001 |
NickFocusL();
|
sl@0
|
1002 |
SetCapture(RWindowBase::TCaptureEnabled);
|
sl@0
|
1003 |
break;
|
sl@0
|
1004 |
default:
|
sl@0
|
1005 |
((CTPointerCaptureStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
|
sl@0
|
1006 |
((CTPointerCaptureStep*)iStep)->CloseTMSGraphicsStep();
|
sl@0
|
1007 |
TestComplete();
|
sl@0
|
1008 |
return;
|
sl@0
|
1009 |
}
|
sl@0
|
1010 |
((CTPointerCaptureStep*)iStep)->RecordTestResultL();
|
sl@0
|
1011 |
SendEventsL();
|
sl@0
|
1012 |
}
|
sl@0
|
1013 |
|
sl@0
|
1014 |
__WS_CONSTRUCT_STEP__(PointerCapture)
|