diff --git a/QGCApplication.pro b/QGCApplication.pro index 3f2564f2ef4379c4fc6ad5bc77dfc78c6fa62a54..baad46158b3eed9b85ea9504fe3a3a5fac40a637 100644 --- a/QGCApplication.pro +++ b/QGCApplication.pro @@ -457,6 +457,7 @@ HEADERS += \ src/qgcunittest/FileManagerTest.h \ src/qgcunittest/FlightGearTest.h \ src/qgcunittest/LinkManagerTest.h \ + src/qgcunittest/MainWindowTest.h \ src/qgcunittest/MavlinkLogTest.h \ src/qgcunittest/MessageBoxTest.h \ src/qgcunittest/MultiSignalSpy.h \ @@ -476,6 +477,7 @@ SOURCES += \ src/qgcunittest/FileManagerTest.cc \ src/qgcunittest/FlightGearTest.cc \ src/qgcunittest/LinkManagerTest.cc \ + src/qgcunittest/MainWindowTest.cc \ src/qgcunittest/MavlinkLogTest.cc \ src/qgcunittest/MessageBoxTest.cc \ src/qgcunittest/MultiSignalSpy.cc \ @@ -484,20 +486,6 @@ SOURCES += \ src/qgcunittest/TCPLoopBackServer.cc \ src/qgcunittest/UnitTest.cc \ src/VehicleSetup/SetupViewTest.cc \ - -!WindowsDebugAndRelease { -# This specific unit test seems to create havoc on Windows. Likely due to -# creating/destroying a main window multiple times without destorying the -# QApplication. The Qml destruction sequence is quite odd in that it is -# all delayed until it gets back the event loop. Which likely has something -# to do with the issue. -HEADERS += \ - src/qgcunittest/MainWindowTest.h \ - -SOURCES += \ - src/qgcunittest/MainWindowTest.cc \ -} - } # DebugBuild|WindowsDebugAndRelease } # MobileBuild diff --git a/src/qgcunittest/MainWindowTest.cc b/src/qgcunittest/MainWindowTest.cc index dde471578383f07efe9f4d9f76f69e3b855a1b79..6288292bc75cf7fa39e27c5ab8b1780f2cfb100c 100644 --- a/src/qgcunittest/MainWindowTest.cc +++ b/src/qgcunittest/MainWindowTest.cc @@ -73,15 +73,6 @@ void MainWindowTest::_connectWindowClose_test(MAV_AUTOPILOT autopilot) QSignalSpy spyVehicle(MultiVehicleManager::instance(), SIGNAL(activeVehicleChanged(Vehicle*))); QCOMPARE(spyVehicle.wait(5000), true); - // Cycle through all the top level views - - _mainWindow->showSetupView(); - QTest::qWait(200); - _mainWindow->showPlanView(); - QTest::qWait(200); - _mainWindow->showFlyView(); - QTest::qWait(200); - // On MainWindow close we should get a message box telling the user to disconnect first. Cancel should do nothing. setExpectedMessageBox(QGCMessageBox::Cancel); _mainWindow->close(); diff --git a/src/qgcunittest/MainWindowTest.h b/src/qgcunittest/MainWindowTest.h index c2d634660bfcc9fbf19ed7d72493a3b08dc7faaf..8c9d3fafd622107dad0a2952e58b7a717c419418 100644 --- a/src/qgcunittest/MainWindowTest.h +++ b/src/qgcunittest/MainWindowTest.h @@ -44,13 +44,9 @@ private slots: void cleanup(void); void _connectWindowClosePX4_test(void); - -private: - // This is moved to private so that it does not run. It exposes - // a strange ASSERT inthe jscript engine which seems to be only - // related to running this Qml in unit tests. void _connectWindowCloseGeneric_test(void); +private: void _connectWindowClose_test(MAV_AUTOPILOT autopilot); MainWindow* _mainWindow;