Commit 05613ab8 authored by Don Gagne's avatar Don Gagne

Wait for pluginReady

parent 29e114fd
...@@ -71,6 +71,15 @@ void SetupViewTest::_clickThrough_test(void) ...@@ -71,6 +71,15 @@ void SetupViewTest::_clickThrough_test(void)
linkMgr->connectLink(link); linkMgr->connectLink(link);
QTest::qWait(5000); // Give enough time for UI to settle and heartbeats to go through QTest::qWait(5000); // Give enough time for UI to settle and heartbeats to go through
AutoPilotPlugin* autopilot = AutoPilotPluginManager::instance()->getInstanceForAutoPilotPlugin(UASManager::instance()->getActiveUAS());
Q_ASSERT(autopilot);
QSignalSpy spyPlugin(autopilot, SIGNAL(pluginReadyChanged(bool)));
if (!autopilot->pluginReady()) {
QCOMPARE(spyPlugin.wait(10000), true);
}
Q_ASSERT(autopilot->pluginReady());
// Switch to the Setup view // Switch to the Setup view
_mainToolBar->onSetupView(); _mainToolBar->onSetupView();
QTest::qWait(1000); QTest::qWait(1000);
...@@ -90,11 +99,6 @@ void SetupViewTest::_clickThrough_test(void) ...@@ -90,11 +99,6 @@ void SetupViewTest::_clickThrough_test(void)
setupView->summaryButtonClicked(); setupView->summaryButtonClicked();
QTest::qWait(1000); QTest::qWait(1000);
// Click through component buttons
UASInterface* uas = UASManager::instance()->getActiveUAS();
Q_ASSERT(uas);
AutoPilotPlugin* autopilot = AutoPilotPluginManager::instance()->getInstanceForAutoPilotPlugin(uas);
Q_ASSERT(autopilot);
const QVariantList& components = autopilot->vehicleComponents(); const QVariantList& components = autopilot->vehicleComponents();
foreach(QVariant varComponent, components) { foreach(QVariant varComponent, components) {
setupView->setupButtonClicked(varComponent); setupView->setupButtonClicked(varComponent);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment