Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
cac402bb
Commit
cac402bb
authored
Dec 08, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test disallow of close if active connections
parent
125f125a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
MainWindowTest.cc
src/qgcunittest/MainWindowTest.cc
+27
-0
MainWindowTest.h
src/qgcunittest/MainWindowTest.h
+1
-0
No files found.
src/qgcunittest/MainWindowTest.cc
View file @
cac402bb
...
@@ -28,6 +28,8 @@
...
@@ -28,6 +28,8 @@
#include "MainWindowTest.h"
#include "MainWindowTest.h"
#include "QGCToolBar.h"
#include "QGCToolBar.h"
#include "MockLink.h"
#include "QGCMessageBox.h"
UT_REGISTER_TEST
(
MainWindowTest
)
UT_REGISTER_TEST
(
MainWindowTest
)
...
@@ -66,3 +68,28 @@ void MainWindowTest::_clickThrough_test(void)
...
@@ -66,3 +68,28 @@ void MainWindowTest::_clickThrough_test(void)
}
}
}
}
void
MainWindowTest
::
_connectWindowClose_test
(
void
)
{
LinkManager
*
linkMgr
=
LinkManager
::
instance
();
Q_CHECK_PTR
(
linkMgr
);
MockLink
*
link
=
new
MockLink
();
Q_CHECK_PTR
(
link
);
// FIXME: LinkManager/MainWindow needs to be re-architected so that you don't have to addLink to MainWindow to get things to work
_mainWindow
->
addLink
(
link
);
linkMgr
->
connectLink
(
link
);
QTest
::
qWait
(
5000
);
// Give enough time for UI to settle and heartbeats to go through
// On MainWindow close we should get a message box telling the user to disconnect first
setExpectedMessageBox
(
QGCMessageBox
::
Ok
);
_mainWindow
->
close
();
QTest
::
qWait
(
1000
);
// Need to allow signals to move between threads
checkExpectedMessageBox
();
// We are going to disconnect the link which is going to pop a save file dialog
setExpectedFileDialog
(
getSaveFileName
,
QStringList
());
linkMgr
->
disconnectLink
(
link
);
QTest
::
qWait
(
1000
);
// Need to allow signals to move between threads
checkExpectedFileDialog
();
}
src/qgcunittest/MainWindowTest.h
View file @
cac402bb
...
@@ -44,6 +44,7 @@ private slots:
...
@@ -44,6 +44,7 @@ private slots:
void
cleanup
(
void
);
void
cleanup
(
void
);
void
_clickThrough_test
(
void
);
void
_clickThrough_test
(
void
);
void
_connectWindowClose_test
(
void
);
private:
private:
MainWindow
*
_mainWindow
;
MainWindow
*
_mainWindow
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment