@@ -16,13 +16,14 @@
1616
1717#include <QtTest/QtTest>
1818#include <QtCore/QObject>
19−#include <qpa/qwindowsysteminterface.h>
2019#include <QtQuick/QQuickView>
2120#include <QtQml/QQmlEngine>
2221#include <QPointer>
2322
2423#include <DirectionalDragArea.h>
2524
25+#include "GestureTest.h"
26+
2627using namespace UbuntuGestures;
2728
2829class FakeTimer : public AbstractTimer
@@ -61,15 +62,12 @@ public:
6162 qint64 m_msecsSinceReference;
6263};
6364
64−class tst_DirectionalDragArea: public QObject
65+class tst_DirectionalDragArea: public GestureTest
6566{
6667 Q_OBJECT
6768public:
68− tst_DirectionalDragArea() : device(0) { }
69+ tst_DirectionalDragArea();
6970private Q_SLOTS:
70− void initTestCase(); // will be called before the first test function is executed
71− void cleanupTestCase(); // will be called after the last test function was executed.
72−
7371 void init(); // called right before each and every test function is executed
7472 void cleanup(); // called right after each and every test function is executed
7573
@@ -87,37 +85,19 @@ private Q_SLOTS:
8785 void ignoreOldFinger();
8886
8987private:
90− QQuickView *createView();
9188 void passTime(qint64 timeSpan);
92− QQuickView *view;
93− QTouchDevice *device;
9489 FakeTimer *fakeTimer;
9590 QSharedPointer<FakeTimeSource> fakeTimeSource;
9691};
9792
98−void tst_DirectionalDragArea::initTestCase()
99−{
100− if (!device) {
101− device = new QTouchDevice;
102− device->setType(QTouchDevice::TouchScreen);
103− QWindowSystemInterface::registerTouchDevice(device);
104− }
105−
106− view = 0;
107−}
108−
109−void tst_DirectionalDragArea::cleanupTestCase()
93+tst_DirectionalDragArea::tst_DirectionalDragArea()
94+ : GestureTest(QStringLiteral("tst_DirectionalDragArea.qml"))
11095{
11196}
11297
11398void tst_DirectionalDragArea::init()
11499{
115− view = createView();
116− view->setSource(QUrl::fromLocalFile("edgeDragExample.qml"));
117− view->show();
118− QVERIFY(QTest::qWaitForWindowExposed(view));
119− QVERIFY(view->rootObject() != 0);
120− qApp->processEvents();
100+ GestureTest::init();
121101
122102 fakeTimeSource.reset(new FakeTimeSource);
123103 fakeTimer = new FakeTimer(fakeTimeSource);
@@ -125,23 +105,12 @@ void tst_DirectionalDragArea::init()
125105
126106void tst_DirectionalDragArea::cleanup()
127107{
128− delete view;
129− view = 0;
130−
131108 delete fakeTimer;
132109 fakeTimer = 0;
133110
134111 fakeTimeSource.reset();
135−}
136−
137−QQuickView *tst_DirectionalDragArea::createView()
138−{
139− QQuickView *window = new QQuickView(0);
140− window->setResizeMode(QQuickView::SizeRootObjectToView);
141− window->resize(600, 600);
142− window->engine()->addImportPath(QLatin1String(UBUNTU_GESTURES_PLUGIN_DIR));
143112
144− return window;
113+ GestureTest::cleanup();
145114}
146115
147116void tst_DirectionalDragArea::passTime(qint64 timeSpan)
@@ -217,14 +186,14 @@ void tst_DirectionalDragArea::edgeDrag()
217186 QFETCH(bool, expectGestureRecognition);
218187
219188 DirectionalDragArea *edgeDragArea =
220− view->rootObject()->findChild<DirectionalDragArea*>(dragAreaObjectName);
189+ m_view->rootObject()->findChild<DirectionalDragArea*>(dragAreaObjectName);
221190 QVERIFY(edgeDragArea != 0);
222191 edgeDragArea->setRecognitionTimer(fakeTimer);
223192 edgeDragArea->setTimeSource(fakeTimeSource);
224193
225194 QSignalSpy draggingSpy(edgeDragArea, SIGNAL(draggingChanged(bool)));
226195
227− QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea, view);
196+ QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea, m_view);
228197 QPointF touchPoint = initialTouchPos;
229198
230199 qreal desiredDragDistance = edgeDragArea->distanceThreshold()*dragDistanceFactor;
@@ -235,7 +204,7 @@ void tst_DirectionalDragArea::edgeDrag()
235204 int totalMovementSteps = qCeil(desiredDragDistance / movementStepDistance);
236205 int movementTimeStepMs = (edgeDragArea->compositionTime() * 1.5f) / totalMovementSteps;
237206
238− QTest::touchEvent(view, device).press(0, touchPoint.toPoint());
207+ QTest::touchEvent(m_view, m_device).press(0, touchPoint.toPoint());
239208
240209 QCOMPARE(draggingSpy.count(), 1);
241210 QCOMPARE(edgeDragArea->dragging(), true);
@@ -245,13 +214,13 @@ void tst_DirectionalDragArea::edgeDrag()
245214 // in order to make it easier to leave it by dragging at an angle
246215 // slightly bigger than the widening angle
247216 touchPoint += createTouchDeviation(edgeDragArea);
248− QTest::touchEvent(view, device).move(0, touchPoint.toPoint());
217+ QTest::touchEvent(m_view, m_device).move(0, touchPoint.toPoint());
249218 }
250219
251220 for (int i = 0; i < totalMovementSteps; ++i) {
252221 touchPoint += touchMovement;
253222 passTime(movementTimeStepMs);
254− QTest::touchEvent(view, device).move(0, touchPoint.toPoint());
223+ QTest::touchEvent(m_view, m_device).move(0, touchPoint.toPoint());
255224 }
256225
257226 if (expectGestureRecognition)
@@ -262,7 +231,7 @@ void tst_DirectionalDragArea::edgeDrag()
262231 QCOMPARE(draggingSpy.count(), 2);
263232 }
264233
265− QTest::touchEvent(view, device).release(0, touchPoint.toPoint());
234+ QTest::touchEvent(m_view, m_device).release(0, touchPoint.toPoint());
266235
267236 QCOMPARE(draggingSpy.count(), 2);
268237 QCOMPARE(edgeDragArea->dragging(), false);
@@ -326,12 +295,12 @@ void tst_DirectionalDragArea::edgeDrag_data()
326295void tst_DirectionalDragArea::dragWithShortDirectionChange()
327296{
328297 DirectionalDragArea *edgeDragArea =
329− view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
298+ m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
330299 QVERIFY(edgeDragArea != 0);
331300 edgeDragArea->setRecognitionTimer(fakeTimer);
332301 edgeDragArea->setTimeSource(fakeTimeSource);
333302
334− QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea, view);
303+ QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea, m_view);
335304 QPointF touchPoint = initialTouchPos;
336305
337306 qreal desiredDragDistance = edgeDragArea->distanceThreshold()*2.0;
@@ -341,32 +310,32 @@ void tst_DirectionalDragArea::dragWithShortDirectionChange()
341310 int touchStepTimeMs = (touchStepDistance / (edgeDragArea->minSpeed() * 5.0f)) * 1000.0f;
342311 QPointF touchMovement = dragDirectionVector * touchStepDistance;
343312
344− QTest::touchEvent(view, device).press(0, touchPoint.toPoint());
313+ QTest::touchEvent(m_view, m_device).press(0, touchPoint.toPoint());
345314
346315 // Move a bit in the proper direction
347316 for (int i=0; i < 3; ++i) {
348317 touchPoint += touchMovement;
349318 passTime(touchStepTimeMs);
350− QTest::touchEvent(view, device).move(0, touchPoint.toPoint());
319+ QTest::touchEvent(m_view, m_device).move(0, touchPoint.toPoint());
351320 }
352321
353322 // Then a sudden and small movement to the opposite direction
354323 touchPoint -= touchMovement*0.2;
355324 passTime(touchStepTimeMs*0.2);
356− QTest::touchEvent(view, device).move(0, touchPoint.toPoint());
325+ QTest::touchEvent(m_view, m_device).move(0, touchPoint.toPoint());
357326
358327 // And then resume movment in the correct direction until it crosses the distance and time
359328 // thresholds.
360329 do {
361330 touchPoint += touchMovement;
362331 passTime(touchStepTimeMs);
363− QTest::touchEvent(view, device).move(0, touchPoint.toPoint());
332+ QTest::touchEvent(m_view, m_device).move(0, touchPoint.toPoint());
364333 } while ((touchPoint - initialTouchPos).manhattanLength() < desiredDragDistance
365334 || fakeTimeSource->m_msecsSinceReference < (edgeDragArea->compositionTime() * 1.5f));
366335
367336 QCOMPARE((int)edgeDragArea->status(), (int)DirectionalDragArea::Recognized);
368337
369− QTest::touchEvent(view, device).release(0, touchPoint.toPoint());
338+ QTest::touchEvent(m_view, m_device).release(0, touchPoint.toPoint());
370339}
371340
372341/*
@@ -380,7 +349,7 @@ void tst_DirectionalDragArea::minSpeed()
380349 QFETCH(int, expectedStatusAfterSpeedCheck);
381350
382351 DirectionalDragArea *edgeDragArea =
383− view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
352+ m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
384353 QVERIFY(edgeDragArea != 0);
385354 edgeDragArea->setRecognitionTimer(fakeTimer);
386355 edgeDragArea->setTimeSource(fakeTimeSource);
@@ -391,7 +360,7 @@ void tst_DirectionalDragArea::minSpeed()
391360
392361 edgeDragArea->setMinSpeed(minSpeed);
393362
394− QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea, view);
363+ QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea, m_view);
395364 QPointF touchPoint = initialTouchPos;
396365
397366 QPointF dragDirectionVector(1.0, 0.0);
@@ -399,13 +368,13 @@ void tst_DirectionalDragArea::minSpeed()
399368 qreal distanceStep = (speed / 1000.0f) * timeStepMsecs;
400369 QPointF touchMovement = dragDirectionVector * distanceStep;
401370
402− QTest::touchEvent(view, device).press(0, touchPoint.toPoint());
371+ QTest::touchEvent(m_view, m_device).press(0, touchPoint.toPoint());
403372
404373 // Move for a while to ensure our speed check is performed a couple of times
405374 for (int i=0; i < 20; ++i) {
406375 touchPoint += touchMovement;
407376 passTime(timeStepMsecs);
408− QTest::touchEvent(view, device).move(0, touchPoint.toPoint());
377+ QTest::touchEvent(m_view, m_device).move(0, touchPoint.toPoint());
409378 }
410379
411380 QCOMPARE((int)edgeDragArea->status(), expectedStatusAfterSpeedCheck);
@@ -429,7 +398,7 @@ void tst_DirectionalDragArea::minSpeed_data()
429398void tst_DirectionalDragArea::recognitionTimerUsage()
430399{
431400 DirectionalDragArea *edgeDragArea =
432− view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
401+ m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
433402 QVERIFY(edgeDragArea != 0);
434403 edgeDragArea->setRecognitionTimer(fakeTimer);
435404 edgeDragArea->setTimeSource(fakeTimeSource);
@@ -439,7 +408,7 @@ void tst_DirectionalDragArea::recognitionTimerUsage()
439408
440409 int timeStepMs = 5; // some arbitrary small value.
441410
442− QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea, view);
411+ QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea, m_view);
443412 QPointF touchPoint = initialTouchPos;
444413
445414 QPointF dragDirectionVector(1.0, 0.0);
@@ -448,7 +417,7 @@ void tst_DirectionalDragArea::recognitionTimerUsage()
448417 QCOMPARE((int)edgeDragArea->status(), (int)DirectionalDragArea::WaitingForTouch);
449418 QVERIFY(!fakeTimer->isRunning());
450419
451− QTest::touchEvent(view, device).press(0, touchPoint.toPoint());
420+ QTest::touchEvent(m_view, m_device).press(0, touchPoint.toPoint());
452421
453422 QCOMPARE((int)edgeDragArea->status(), (int)DirectionalDragArea::Undecided);
454423 QVERIFY(fakeTimer->isRunning());
@@ -461,7 +430,7 @@ void tst_DirectionalDragArea::recognitionTimerUsage()
461430
462431 touchPoint += touchMovement;
463432 passTime(timeStepMs);
464− QTest::touchEvent(view, device).move(0, touchPoint.toPoint());
433+ QTest::touchEvent(m_view, m_device).move(0, touchPoint.toPoint());
465434 }
466435
467436 QCOMPARE((int)edgeDragArea->status(), (int)DirectionalDragArea::Recognized);
@@ -475,7 +444,7 @@ void tst_DirectionalDragArea::recognitionTimerUsage()
475444void tst_DirectionalDragArea::maxSilenceTime()
476445{
477446 DirectionalDragArea *edgeDragArea =
478− view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
447+ m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
479448 QVERIFY(edgeDragArea != 0);
480449 edgeDragArea->setRecognitionTimer(fakeTimer);
481450 edgeDragArea->setTimeSource(fakeTimeSource);
@@ -483,10 +452,10 @@ void tst_DirectionalDragArea::maxSilenceTime()
483452 // Make sure this property is not disabled
484453 edgeDragArea->setMaxSilenceTime(100);
485454
486− QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea, view);
455+ QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea, m_view);
487456 QPointF touchPoint = initialTouchPos;
488457
489− QTest::touchEvent(view, device).press(0, touchPoint.toPoint());
458+ QTest::touchEvent(m_view, m_device).press(0, touchPoint.toPoint());
490459
491460 QCOMPARE((int)edgeDragArea->status(), (int)DirectionalDragArea::Undecided);
492461 QVERIFY(fakeTimer->isRunning());
@@ -506,20 +475,20 @@ void tst_DirectionalDragArea::maxSilenceTime()
506475void tst_DirectionalDragArea::sceneXAndX()
507476{
508477 DirectionalDragArea *edgeDragArea =
509− view->rootObject()->findChild<DirectionalDragArea*>("hnDragArea");
478+ m_view->rootObject()->findChild<DirectionalDragArea*>("hnDragArea");
510479 QVERIFY(edgeDragArea != 0);
511480 edgeDragArea->setRecognitionTimer(fakeTimer);
512481 edgeDragArea->setTimeSource(fakeTimeSource);
513482
514− QPointF touchScenePos(view->width() - (edgeDragArea->width()/2.0f), view->height()/2.0f);
483+ QPointF touchScenePos(m_view->width() - (edgeDragArea->width()/2.0f), m_view->height()/2.0f);
515484
516− QTest::touchEvent(view, device).press(0, touchScenePos.toPoint());
485+ QTest::touchEvent(m_view, m_device).press(0, touchScenePos.toPoint());
517486
518487 QSignalSpy touchXSpy(edgeDragArea, SIGNAL(touchXChanged(qreal)));
519488 QSignalSpy touchSceneXSpy(edgeDragArea, SIGNAL(touchSceneXChanged(qreal)));
520489
521− touchScenePos.rx() = view->width() / 2;
522− QTest::touchEvent(view, device).move(0, touchScenePos.toPoint());
490+ touchScenePos.rx() = m_view->width() / 2;
491+ QTest::touchEvent(m_view, m_device).move(0, touchScenePos.toPoint());
523492
524493 QCOMPARE(touchXSpy.count(), 1);
525494 QCOMPARE(touchSceneXSpy.count(), 1);
@@ -534,20 +503,20 @@ void tst_DirectionalDragArea::sceneXAndX()
534503void tst_DirectionalDragArea::sceneYAndY()
535504{
536505 DirectionalDragArea *edgeDragArea =
537− view->rootObject()->findChild<DirectionalDragArea*>("vnDragArea");
506+ m_view->rootObject()->findChild<DirectionalDragArea*>("vnDragArea");
538507 QVERIFY(edgeDragArea != 0);
539508 edgeDragArea->setRecognitionTimer(fakeTimer);
540509 edgeDragArea->setTimeSource(fakeTimeSource);
541510
542− QPointF touchScenePos(view->width()/2.0f, view->height() - (edgeDragArea->height()/2.0f));
511+ QPointF touchScenePos(m_view->width()/2.0f, m_view->height() - (edgeDragArea->height()/2.0f));
543512
544− QTest::touchEvent(view, device).press(0, touchScenePos.toPoint());
513+ QTest::touchEvent(m_view, m_device).press(0, touchScenePos.toPoint());
545514
546515 QSignalSpy touchYSpy(edgeDragArea, SIGNAL(touchYChanged(qreal)));
547516 QSignalSpy touchSceneYSpy(edgeDragArea, SIGNAL(touchSceneYChanged(qreal)));
548517
549− touchScenePos.ry() = view->height() / 2;
550− QTest::touchEvent(view, device).move(0, touchScenePos.toPoint());
518+ touchScenePos.ry() = m_view->height() / 2;
519+ QTest::touchEvent(m_view, m_device).move(0, touchScenePos.toPoint());
551520
552521 QCOMPARE(touchYSpy.count(), 1);
553522 QCOMPARE(touchSceneYSpy.count(), 1);
@@ -564,27 +533,27 @@ void tst_DirectionalDragArea::sceneYAndY()
564533void tst_DirectionalDragArea::twoFingerTap()
565534{
566535 DirectionalDragArea *edgeDragArea =
567− view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
536+ m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
568537 QVERIFY(edgeDragArea != 0);
569538 edgeDragArea->setRecognitionTimer(fakeTimer);
570539 edgeDragArea->setTimeSource(fakeTimeSource);
571540
572541 // Make touches evenly spaced along the edgeDragArea
573− QPoint touchAPos(edgeDragArea->width()/2.0f, view->height()*0.33f);
574− QPoint touchBPos(edgeDragArea->width()/2.0f, view->height()*0.66f);
542+ QPoint touchAPos(edgeDragArea->width()/2.0f, m_view->height()*0.33f);
543+ QPoint touchBPos(edgeDragArea->width()/2.0f, m_view->height()*0.66f);
575544
576545 qint64 timeStepMsecs = 5; // some arbitrary, small value
577546
578547 // Perform the first two-finger tap
579548 // NB: using move() instead of stationary() becasue in the latter you cannot provide
580549 // the touch position and therefore it's left with some garbage numbers.
581− QTest::touchEvent(view, device)
550+ QTest::touchEvent(m_view, m_device)
582551 .press(0, touchAPos);
583552
584553 QCOMPARE((int)edgeDragArea->status(), (int)DirectionalDragArea::Undecided);
585554
586555 passTime(timeStepMsecs);
587− QTest::touchEvent(view, device)
556+ QTest::touchEvent(m_view, m_device)
588557 .move(0, touchAPos)
589558 .press(1, touchBPos);
590559
@@ -593,14 +562,14 @@ void tst_DirectionalDragArea::twoFingerTap()
593562 QCOMPARE((int)edgeDragArea->status(), (int)DirectionalDragArea::WaitingForTouch);
594563
595564 passTime(timeStepMsecs);
596− QTest::touchEvent(view, device)
565+ QTest::touchEvent(m_view, m_device)
597566 .release(0, touchAPos)
598567 .move(1, touchBPos);
599568
600569 QCOMPARE((int)edgeDragArea->status(), (int)DirectionalDragArea::WaitingForTouch);
601570
602571 passTime(timeStepMsecs);
603− QTest::touchEvent(view, device)
572+ QTest::touchEvent(m_view, m_device)
604573 .release(1, touchBPos);
605574
606575 QCOMPARE((int)edgeDragArea->status(), (int)DirectionalDragArea::WaitingForTouch);
@@ -608,27 +577,27 @@ void tst_DirectionalDragArea::twoFingerTap()
608577 // Perform the second two-finger tap
609578
610579 passTime(timeStepMsecs);
611− QTest::touchEvent(view, device)
580+ QTest::touchEvent(m_view, m_device)
612581 .press(0, touchAPos);
613582
614583 QCOMPARE((int)edgeDragArea->status(), (int)DirectionalDragArea::Undecided);
615584
616585 passTime(timeStepMsecs);
617− QTest::touchEvent(view, device)
586+ QTest::touchEvent(m_view, m_device)
618587 .move(0, touchAPos)
619588 .press(1, touchBPos);
620589
621590 QCOMPARE((int)edgeDragArea->status(), (int)DirectionalDragArea::WaitingForTouch);
622591
623592 passTime(timeStepMsecs);
624− QTest::touchEvent(view, device)
593+ QTest::touchEvent(m_view, m_device)
625594 .release(0, touchAPos)
626595 .move(1, touchBPos);
627596
628597 QCOMPARE((int)edgeDragArea->status(), (int)DirectionalDragArea::WaitingForTouch);
629598
630599 passTime(timeStepMsecs);
631− QTest::touchEvent(view, device)
600+ QTest::touchEvent(m_view, m_device)
632601 .release(1, touchBPos);
633602
634603 QCOMPARE((int)edgeDragArea->status(), (int)DirectionalDragArea::WaitingForTouch);
@@ -642,7 +611,7 @@ void tst_DirectionalDragArea::twoFingerTap()
642611 */
643612void tst_DirectionalDragArea::movingDDA()
644613{
645− QQuickItem *rightwardsLauncher = view->rootObject()->findChild<QQuickItem*>("rightwardsLauncher");
614+ QQuickItem *rightwardsLauncher = m_view->rootObject()->findChild<QQuickItem*>("rightwardsLauncher");
646615 Q_ASSERT(rightwardsLauncher != 0);
647616
648617 DirectionalDragArea *edgeDragArea =
@@ -651,7 +620,7 @@ void tst_DirectionalDragArea::movingDDA()
651620 edgeDragArea->setRecognitionTimer(fakeTimer);
652621 edgeDragArea->setTimeSource(fakeTimeSource);
653622
654− QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea, view);
623+ QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea, m_view);
655624 QPointF touchPoint = initialTouchPos;
656625
657626 qreal desiredDragDistance = edgeDragArea->distanceThreshold()*2.0f;
@@ -662,7 +631,7 @@ void tst_DirectionalDragArea::movingDDA()
662631 int totalMovementSteps = qCeil(desiredDragDistance / movementStepDistance);
663632 int movementTimeStepMs = (edgeDragArea->compositionTime() * 1.5f) / totalMovementSteps;
664633
665− QTest::touchEvent(view, device).press(0, touchPoint.toPoint());
634+ QTest::touchEvent(m_view, m_device).press(0, touchPoint.toPoint());
666635
667636 // Move it far ahead along the direction of the gesture
668637 // rightwardsLauncher is a parent of our DirectionalDragArea. So moving it will move our DDA
@@ -671,12 +640,12 @@ void tst_DirectionalDragArea::movingDDA()
671640 for (int i = 0; i < totalMovementSteps; ++i) {
672641 touchPoint += touchMovement;
673642 passTime(movementTimeStepMs);
674− QTest::touchEvent(view, device).move(0, touchPoint.toPoint());
643+ QTest::touchEvent(m_view, m_device).move(0, touchPoint.toPoint());
675644 }
676645
677646 QCOMPARE((int)edgeDragArea->status(), (int)DirectionalDragArea::Recognized);
678647
679− QTest::touchEvent(view, device).release(0, touchPoint.toPoint());
648+ QTest::touchEvent(m_view, m_device).release(0, touchPoint.toPoint());
680649}
681650
682651/*
@@ -686,16 +655,16 @@ void tst_DirectionalDragArea::movingDDA()
686655void tst_DirectionalDragArea::ignoreOldFinger()
687656{
688657 DirectionalDragArea *edgeDragArea =
689− view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
658+ m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
690659 Q_ASSERT(edgeDragArea != 0);
691660 edgeDragArea->setRecognitionTimer(fakeTimer);
692661 edgeDragArea->setTimeSource(fakeTimeSource);
693662
694663 // Make touches evenly spaced along the edgeDragArea
695− QPoint touch0Pos(edgeDragArea->width()/2.0f, view->height()*0.33f);
696− QPoint touch1Pos(edgeDragArea->width()/2.0f, view->height()*0.66f);
664+ QPoint touch0Pos(edgeDragArea->width()/2.0f, m_view->height()*0.33f);
665+ QPoint touch1Pos(edgeDragArea->width()/2.0f, m_view->height()*0.66f);
697666
698− QTest::touchEvent(view, device).press(0, touch0Pos);
667+ QTest::touchEvent(m_view, m_device).press(0, touch0Pos);
699668
700669 QCOMPARE((int)edgeDragArea->status(), (int)DirectionalDragArea::Undecided);
701670
@@ -712,7 +681,7 @@ void tst_DirectionalDragArea::ignoreOldFinger()
712681 int totalMovementSteps = qCeil(desiredDragDistance / movementStepDistance);
713682 int movementTimeStepMs = (edgeDragArea->compositionTime() * 1.5f) / totalMovementSteps;
714683
715− QTest::touchEvent(view, device)
684+ QTest::touchEvent(m_view, m_device)
716685 .move(0, touch0Pos)
717686 .press(1, touch1Pos);
718687
@@ -721,14 +690,14 @@ void tst_DirectionalDragArea::ignoreOldFinger()
721690 for (int i = 0; i < totalMovementSteps; ++i) {
722691 touch1Pos += touchMovement.toPoint();
723692 passTime(movementTimeStepMs);
724− QTest::touchEvent(view, device)
693+ QTest::touchEvent(m_view, m_device)
725694 .move(0, touch0Pos)
726695 .move(1, touch1Pos);
727696 }
728697
729698 QCOMPARE((int)edgeDragArea->status(), (int)DirectionalDragArea::Recognized);
730699
731− QTest::touchEvent(view, device)
700+ QTest::touchEvent(m_view, m_device)
732701 .move(0, touch0Pos)
733702 .release(1, touch1Pos);
734703