##// END OF EJS Templates
autotests: try to fix bar hover failures in bamboo
Jani Honkonen -
r1466:730672220f94
parent child
Show More
@@ -23,6 +23,7
23 #include <qbarset.h>
23 #include <qbarset.h>
24 #include <qchartview.h>
24 #include <qchartview.h>
25 #include <qchart.h>
25 #include <qchart.h>
26 #include "tst_definitions.h"
26
27
27 QTCOMMERCIALCHART_USE_NAMESPACE
28 QTCOMMERCIALCHART_USE_NAMESPACE
28
29
@@ -437,14 +438,13 void tst_QBarSeries::mousehovered()
437 //=======================================================================
438 //=======================================================================
438 // move mouse to left border
439 // move mouse to left border
439 QTest::mouseMove(view.viewport(), QPoint(0, 142));
440 QTest::mouseMove(view.viewport(), QPoint(0, 142));
440
441 QCoreApplication::processEvents(QEventLoop::AllEvents, 10000);
441 QVERIFY(seriesSpy.count() == 0);
442 TRY_COMPARE(seriesSpy.count(), 0);
442
443
443 //=======================================================================
444 //=======================================================================
444 // move mouse on top of set1
445 // move mouse on top of set1
445 QTest::mouseMove(view.viewport(), QPoint(102,142));
446 QTest::mouseMove(view.viewport(), QPoint(102,142));
446
447 TRY_COMPARE(seriesSpy.count(), 1);
447 QVERIFY(seriesSpy.count() == 1);
448
448
449 QList<QVariant> seriesSpyArg = seriesSpy.takeFirst();
449 QList<QVariant> seriesSpyArg = seriesSpy.takeFirst();
450 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(0)), set1);
450 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(0)), set1);
@@ -454,8 +454,7 void tst_QBarSeries::mousehovered()
454 //=======================================================================
454 //=======================================================================
455 // move mouse from top of set1 to top of set2
455 // move mouse from top of set1 to top of set2
456 QTest::mouseMove(view.viewport(), QPoint(127,142));
456 QTest::mouseMove(view.viewport(), QPoint(127,142));
457
457 TRY_COMPARE(seriesSpy.count(), 2);
458 QVERIFY(seriesSpy.count() == 2);
459
458
460 // should leave set1
459 // should leave set1
461 seriesSpyArg = seriesSpy.takeFirst();
460 seriesSpyArg = seriesSpy.takeFirst();
@@ -472,7 +471,7 void tst_QBarSeries::mousehovered()
472 //=======================================================================
471 //=======================================================================
473 // move mouse from top of set2 to background
472 // move mouse from top of set2 to background
474 QTest::mouseMove(view.viewport(), QPoint(127,0));
473 QTest::mouseMove(view.viewport(), QPoint(127,0));
475 QVERIFY(seriesSpy.count() == 1);
474 TRY_COMPARE(seriesSpy.count(), 1);
476
475
477 // should leave set2
476 // should leave set2
478 seriesSpyArg = seriesSpy.takeFirst();
477 seriesSpyArg = seriesSpy.takeFirst();
@@ -25,6 +25,7
25 #include <qchart.h>
25 #include <qchart.h>
26 #include <QBarModelMapper>
26 #include <QBarModelMapper>
27 #include <QStandardItemModel>
27 #include <QStandardItemModel>
28 #include "tst_definitions.h"
28
29
29 QTCOMMERCIALCHART_USE_NAMESPACE
30 QTCOMMERCIALCHART_USE_NAMESPACE
30
31
@@ -224,17 +225,14 void tst_QGroupedBarSeries::mousehovered()
224 // move mouse to left border
225 // move mouse to left border
225 qDebug() << "move mouse to left border";
226 qDebug() << "move mouse to left border";
226 QTest::mouseMove(view.viewport(), QPoint(0, 143));
227 QTest::mouseMove(view.viewport(), QPoint(0, 143));
227 QCoreApplication::processEvents(QEventLoop::AllEvents, 1000);
228 QCoreApplication::processEvents(QEventLoop::AllEvents, 10000);
228
229 TRY_COMPARE(seriesSpy.count(), 0);
229 QVERIFY(seriesSpy.count() == 0);
230
230
231 //=======================================================================
231 //=======================================================================
232 // move mouse on top of set1
232 // move mouse on top of set1
233 qDebug() << "move mouse on top of set1";
233 qDebug() << "move mouse on top of set1";
234 QTest::mouseMove(view.viewport(), QPoint(95,143));
234 QTest::mouseMove(view.viewport(), QPoint(95,143));
235 QCoreApplication::processEvents(QEventLoop::AllEvents, 10000);
235 TRY_COMPARE(seriesSpy.count(), 1);
236
237 QVERIFY(seriesSpy.count() == 1);
238
236
239 QList<QVariant> seriesSpyArg = seriesSpy.takeFirst();
237 QList<QVariant> seriesSpyArg = seriesSpy.takeFirst();
240 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(0)), set1);
238 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(0)), set1);
@@ -245,9 +243,7 void tst_QGroupedBarSeries::mousehovered()
245 // move mouse from top of set1 to top of set2
243 // move mouse from top of set1 to top of set2
246 qDebug() << "move mouse from top of set1 to top of set2";
244 qDebug() << "move mouse from top of set1 to top of set2";
247 QTest::mouseMove(view.viewport(), QPoint(118,143));
245 QTest::mouseMove(view.viewport(), QPoint(118,143));
248 QCoreApplication::processEvents(QEventLoop::AllEvents, 10000);
246 TRY_COMPARE(seriesSpy.count(), 2);
249
250 QVERIFY(seriesSpy.count() == 2);
251
247
252 // should leave set1
248 // should leave set1
253 seriesSpyArg = seriesSpy.takeFirst();
249 seriesSpyArg = seriesSpy.takeFirst();
@@ -266,9 +262,7 void tst_QGroupedBarSeries::mousehovered()
266 qDebug() << "move mouse from top of set2 to background";
262 qDebug() << "move mouse from top of set2 to background";
267
263
268 QTest::mouseMove(view.viewport(), QPoint(118,0));
264 QTest::mouseMove(view.viewport(), QPoint(118,0));
269 QCoreApplication::processEvents(QEventLoop::AllEvents, 10000);
265 TRY_COMPARE(seriesSpy.count(), 1);
270
271 QVERIFY(seriesSpy.count() == 1);
272
266
273 // should leave set2
267 // should leave set2
274 seriesSpyArg = seriesSpy.takeFirst();
268 seriesSpyArg = seriesSpy.takeFirst();
@@ -23,6 +23,7
23 #include <qbarset.h>
23 #include <qbarset.h>
24 #include <qchartview.h>
24 #include <qchartview.h>
25 #include <qchart.h>
25 #include <qchart.h>
26 #include "tst_definitions.h"
26
27
27 QTCOMMERCIALCHART_USE_NAMESPACE
28 QTCOMMERCIALCHART_USE_NAMESPACE
28
29
@@ -221,14 +222,13 void tst_QPercentBarSeries::mousehovered()
221 //=======================================================================
222 //=======================================================================
222 // move mouse to left border
223 // move mouse to left border
223 QTest::mouseMove(view.viewport(), QPoint(0, 190));
224 QTest::mouseMove(view.viewport(), QPoint(0, 190));
224
225 QCoreApplication::processEvents(QEventLoop::AllEvents, 10000);
225 QVERIFY(seriesSpy.count() == 0);
226 TRY_COMPARE(seriesSpy.count(), 0);
226
227
227 //=======================================================================
228 //=======================================================================
228 // move mouse on top of set1
229 // move mouse on top of set1
229 QTest::mouseMove(view.viewport(), QPoint(106,190));
230 QTest::mouseMove(view.viewport(), QPoint(106,190));
230
231 TRY_COMPARE(seriesSpy.count(), 1);
231 QVERIFY(seriesSpy.count() == 1);
232
232
233 QList<QVariant> seriesSpyArg = seriesSpy.takeFirst();
233 QList<QVariant> seriesSpyArg = seriesSpy.takeFirst();
234 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(0)), set1);
234 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(0)), set1);
@@ -238,8 +238,7 void tst_QPercentBarSeries::mousehovered()
238 //=======================================================================
238 //=======================================================================
239 // move mouse from top of set1 to top of set2
239 // move mouse from top of set1 to top of set2
240 QTest::mouseMove(view.viewport(), QPoint(106,95));
240 QTest::mouseMove(view.viewport(), QPoint(106,95));
241
241 TRY_COMPARE(seriesSpy.count(), 2);
242 QVERIFY(seriesSpy.count() == 2);
243
242
244 // should leave set1
243 // should leave set1
245 seriesSpyArg = seriesSpy.takeFirst();
244 seriesSpyArg = seriesSpy.takeFirst();
@@ -256,8 +255,7 void tst_QPercentBarSeries::mousehovered()
256 //=======================================================================
255 //=======================================================================
257 // move mouse from top of set2 to background
256 // move mouse from top of set2 to background
258 QTest::mouseMove(view.viewport(), QPoint(106,0));
257 QTest::mouseMove(view.viewport(), QPoint(106,0));
259
258 TRY_COMPARE(seriesSpy.count(), 1);
260 QVERIFY(seriesSpy.count() == 1);
261
259
262 // should leave set2
260 // should leave set2
263 seriesSpyArg = seriesSpy.takeFirst();
261 seriesSpyArg = seriesSpy.takeFirst();
@@ -23,6 +23,7
23 #include <qbarset.h>
23 #include <qbarset.h>
24 #include <qchartview.h>
24 #include <qchartview.h>
25 #include <qchart.h>
25 #include <qchart.h>
26 #include "tst_definitions.h"
26
27
27 QTCOMMERCIALCHART_USE_NAMESPACE
28 QTCOMMERCIALCHART_USE_NAMESPACE
28
29
@@ -221,14 +222,13 void tst_QStackedBarSeries::mousehovered()
221 //=======================================================================
222 //=======================================================================
222 // move mouse to left border
223 // move mouse to left border
223 QTest::mouseMove(view.viewport(), QPoint(0, 190));
224 QTest::mouseMove(view.viewport(), QPoint(0, 190));
224
225 QCoreApplication::processEvents(QEventLoop::AllEvents, 10000);
225 QVERIFY(seriesSpy.count() == 0);
226 TRY_COMPARE(seriesSpy.count(), 0);
226
227
227 //=======================================================================
228 //=======================================================================
228 // move mouse on top of set1
229 // move mouse on top of set1
229 QTest::mouseMove(view.viewport(), QPoint(106,190));
230 QTest::mouseMove(view.viewport(), QPoint(106,190));
230
231 TRY_COMPARE(seriesSpy.count(), 1);
231 QVERIFY(seriesSpy.count() == 1);
232
232
233 QList<QVariant> seriesSpyArg = seriesSpy.takeFirst();
233 QList<QVariant> seriesSpyArg = seriesSpy.takeFirst();
234 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(0)), set1);
234 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(0)), set1);
@@ -238,8 +238,7 void tst_QStackedBarSeries::mousehovered()
238 //=======================================================================
238 //=======================================================================
239 // move mouse from top of set1 to top of set2
239 // move mouse from top of set1 to top of set2
240 QTest::mouseMove(view.viewport(), QPoint(106,95));
240 QTest::mouseMove(view.viewport(), QPoint(106,95));
241
241 TRY_COMPARE(seriesSpy.count(), 2);
242 QVERIFY(seriesSpy.count() == 2);
243
242
244 // should leave set1
243 // should leave set1
245 seriesSpyArg = seriesSpy.takeFirst();
244 seriesSpyArg = seriesSpy.takeFirst();
@@ -256,8 +255,7 void tst_QStackedBarSeries::mousehovered()
256 //=======================================================================
255 //=======================================================================
257 // move mouse from top of set2 to background
256 // move mouse from top of set2 to background
258 QTest::mouseMove(view.viewport(), QPoint(106,0));
257 QTest::mouseMove(view.viewport(), QPoint(106,0));
259
258 TRY_COMPARE(seriesSpy.count(), 1);
260 QVERIFY(seriesSpy.count() == 1);
261
259
262 // should leave set2
260 // should leave set2
263 seriesSpyArg = seriesSpy.takeFirst();
261 seriesSpyArg = seriesSpy.takeFirst();
General Comments 0
You need to be logged in to leave comments. Login now