Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
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
Administrator
linphone-desktop
Commits
dd794f92
Commit
dd794f92
authored
Jul 19, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(tests/main-view): add a `showSettingsWindow` method
parent
38a4df60
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
9 deletions
+18
-9
TestUtils.hpp
src/tests/TestUtils.hpp
+2
-2
MainViewTest.cpp
src/tests/main-view/MainViewTest.cpp
+15
-7
MainViewTest.hpp
src/tests/main-view/MainViewTest.hpp
+1
-0
No files found.
src/tests/TestUtils.hpp
View file @
dd794f92
...
...
@@ -27,8 +27,8 @@
#define CHECK_VIRTUAL_WINDOW_CONTENT_INFO(WINDOW, TYPE, NAME) \
do { \
QQuickItem *virtualWindowContent
= TestUtils::getVirtualWindowContent(WINDOW)
; \
Q
VERIFY(virtualWindowContent
); \
QQuickItem *virtualWindowContent; \
Q
TRY_VERIFY_WITH_TIMEOUT(virtualWindowContent = TestUtils::getVirtualWindowContent(WINDOW), 1000
); \
QVERIFY(!strncmp(virtualWindowContent->metaObject()->className(), TYPE, sizeof TYPE - 1)); \
QCOMPARE(virtualWindowContent->objectName(), QStringLiteral(NAME)); \
} while (0)
...
...
src/tests/main-view/MainViewTest.cpp
View file @
dd794f92
...
...
@@ -34,15 +34,12 @@ void MainViewTest::showAboutPopup () {
// Open popup.
TestUtils
::
executeKeySequence
(
mainWindow
,
QKeySequence
::
HelpContents
);
QTest
::
qWait
(
1000
);
CHECK_VIRTUAL_WINDOW_CONTENT_INFO
(
mainWindow
,
"DialogPlus_QMLTYPE_"
,
"__about"
);
// Close popup.
QTest
::
mouseClick
(
mainWindow
,
Qt
::
LeftButton
,
Qt
::
KeyboardModifiers
(),
QPoint
(
476
,
392
));
QTest
::
qWait
(
1000
);
QVERIFY
(
!
TestUtils
::
getVirtualWindowContent
(
mainWindow
));
QTRY_VERIFY_WITH_TIMEOUT
(
!
TestUtils
::
getVirtualWindowContent
(
mainWindow
),
1000
);
}
void
MainViewTest
::
showManageAccountsPopup
()
{
...
...
@@ -50,13 +47,24 @@ void MainViewTest::showManageAccountsPopup () {
// Open popup.
QTest
::
mouseClick
(
mainWindow
,
Qt
::
LeftButton
,
Qt
::
KeyboardModifiers
(),
QPoint
(
100
,
35
));
QTest
::
qWait
(
1000
);
CHECK_VIRTUAL_WINDOW_CONTENT_INFO
(
mainWindow
,
"DialogPlus_QMLTYPE_"
,
"__manageAccounts"
);
// Close popup.
QTest
::
mouseClick
(
mainWindow
,
Qt
::
LeftButton
,
Qt
::
KeyboardModifiers
(),
QPoint
(
476
,
392
));
QTest
::
qWait
(
1000
);
QTRY_VERIFY_WITH_TIMEOUT
(
!
TestUtils
::
getVirtualWindowContent
(
mainWindow
),
1000
);
}
void
MainViewTest
::
showSettingsWindow
()
{
App
*
app
=
App
::
getInstance
();
// Open window.
QTest
::
keyClick
(
app
->
getMainWindow
(),
Qt
::
Key_P
,
Qt
::
ControlModifier
);
QQuickWindow
*
settingsWindow
=
app
->
getSettingsWindow
();
QVERIFY
(
QTest
::
qWaitForWindowExposed
(
settingsWindow
));
QVERIFY
(
!
TestUtils
::
getVirtualWindowContent
(
mainWindow
));
// Hide window.
TestUtils
::
executeKeySequence
(
settingsWindow
,
QKeySequence
::
Close
);
QVERIFY
(
!
settingsWindow
->
isVisible
());
}
src/tests/main-view/MainViewTest.hpp
View file @
dd794f92
...
...
@@ -34,4 +34,5 @@ public:
private
slots
:
void
showAboutPopup
();
void
showManageAccountsPopup
();
void
showSettingsWindow
();
};
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