Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
c8441884
Commit
c8441884
authored
Dec 02, 2014
by
Don Gagne
Browse files
Merge pull request #1050 from DonLakeFlyer/ToolbarClickThrough
Test all views on the toolbar
parents
61dd6f09
027e9675
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/qgcunittest/MainWindowTest.cc
View file @
c8441884
...
...
@@ -27,7 +27,7 @@
/// @author Don Gagne <don@thegagnes.com>
#include
"MainWindowTest.h"
#include
"
MainWindow
.h"
#include
"
QGCToolBar
.h"
UT_REGISTER_TEST
(
MainWindowTest
)
...
...
@@ -39,19 +39,30 @@ MainWindowTest::MainWindowTest(void)
void
MainWindowTest
::
init
(
void
)
{
UnitTest
::
init
();
_mainWindow
=
MainWindow
::
_create
(
NULL
,
MainWindow
::
CUSTOM_MODE_PX4
);
Q_CHECK_PTR
(
_mainWindow
);
}
void
MainWindowTest
::
cleanup
(
void
)
{
_mainWindow
->
close
();
delete
_mainWindow
;
UnitTest
::
cleanup
();
}
void
MainWindowTest
::
_
simpleDisplay
_test
(
void
)
void
MainWindowTest
::
_
clickThrough
_test
(
void
)
{
MainWindow
*
mainWindow
=
M
ainWindow
::
_create
(
NULL
,
MainWindow
::
CUSTOM_MODE_PX4
);
Q_
CHECK_PTR
(
mainWindow
);
QGCToolBar
*
toolbar
=
_m
ainWindow
->
findChild
<
QGCToolBar
*>
(
);
Q_
ASSERT
(
toolbar
);
mainWindow
->
close
();
QList
<
QToolButton
*>
buttons
=
toolbar
->
findChildren
<
QToolButton
*>
();
foreach
(
QToolButton
*
button
,
buttons
)
{
if
(
!
button
->
menu
())
{
QTest
::
mouseClick
(
button
,
Qt
::
LeftButton
);
QTest
::
qWait
(
1000
);
}
}
delete
mainWindow
;
}
src/qgcunittest/MainWindowTest.h
View file @
c8441884
...
...
@@ -30,6 +30,7 @@
#define MAINWINDOWTEST_H
#include
"UnitTest.h"
#include
"MainWindow.h"
class
MainWindowTest
:
public
UnitTest
{
...
...
@@ -42,7 +43,10 @@ private slots:
void
init
(
void
);
void
cleanup
(
void
);
void
_simpleDisplay_test
(
void
);
void
_clickThrough_test
(
void
);
private:
MainWindow
*
_mainWindow
;
};
#endif
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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