diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2018-10-05 09:14:47 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2018-10-05 07:46:32 +0000 |
commit | bc2260ab29c3ca0491a63790af106000faa1f53a (patch) | |
tree | 55c31574afffcf673619ec79b2d77f8dbe51aa1a /src/plugins/qmlprofiler | |
parent | e8f28dbef34adbbb46c04ca1f497f5a07d5c3ae7 (diff) |
QmlProfiler: Make the tool test more robust
Apparently there is a different message box that commonly pops up while
we are waiting for the attach dialog. Just close it and try again. Also,
stop the timer once we have seen the dialog. Otherwise we might fail on
extra message boxes that pop up afterwards.
Change-Id: I06ae16eb3ad89c9a022ac6fae781f8465425d96f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/qmlprofiler')
-rw-r--r-- | src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp b/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp index ea27c3cb505..a519f6a775a 100644 --- a/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp +++ b/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp @@ -71,8 +71,6 @@ void QmlProfilerToolTest::testAttachToWaitingApplication() timer.setInterval(100); bool modalSeen = false; - bool dialogAccepted = false; - connect(&timer, &QTimer::timeout, this, [&]() { if (QWidget *activeModal = QApplication::activeModalWidget()) { modalSeen = true; @@ -80,10 +78,10 @@ void QmlProfilerToolTest::testAttachToWaitingApplication() if (dialog) { dialog->setPort(serverUrl.port()); dialog->accept(); - dialogAccepted = true; + timer.stop(); } else { qWarning() << "Some other modal widget popped up:" << activeModal; - QFAIL("Interference from unrelated code."); + activeModal->close(); } } }); @@ -95,7 +93,7 @@ void QmlProfilerToolTest::testAttachToWaitingApplication() QTRY_VERIFY(connection); QTRY_VERIFY(runControl->isRunning()); QTRY_VERIFY(modalSeen); - QTRY_VERIFY(dialogAccepted); + QTRY_VERIFY(!timer.isActive()); QTRY_VERIFY(profilerTool.clientManager()->isConnected()); connection.reset(); |