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
31f2ec67
Commit
31f2ec67
authored
Jul 18, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(tests/MainViewTest): close popup in `showManageAccountsPopup`
parent
c7509acd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
TestUtils.cpp
src/tests/TestUtils.cpp
+2
-8
MainViewTest.cpp
src/tests/main-view/MainViewTest.cpp
+10
-3
No files found.
src/tests/TestUtils.cpp
View file @
31f2ec67
...
...
@@ -50,10 +50,7 @@ void TestUtils::printItemTree (const QQuickItem *item) {
// -----------------------------------------------------------------------------
QQuickItem
*
TestUtils
::
getMainLoaderFromMainWindow
()
{
QQuickWindow
*
window
=
App
::
getInstance
()
->
getMainWindow
();
Q_CHECK_PTR
(
window
);
QList
<
QQuickItem
*>
items
=
window
->
contentItem
()
->
childItems
();
QList
<
QQuickItem
*>
items
=
App
::
getInstance
()
->
getMainWindow
()
->
contentItem
()
->
childItems
();
Q_ASSERT
(
!
items
.
empty
());
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
...
...
@@ -96,8 +93,5 @@ QQuickItem *TestUtils::getVirtualWindowContainer (const QQuickItem *virtualWindo
QList
<
QQuickItem
*>
items
=
virtualWindow
->
childItems
();
Q_ASSERT
(
items
.
size
()
==
2
);
QQuickItem
*
container
=
items
.
at
(
1
);
Q_ASSERT
(
!
container
->
childItems
().
empty
());
return
container
;
return
items
.
at
(
1
);
}
src/tests/main-view/MainViewTest.cpp
View file @
31f2ec67
...
...
@@ -32,14 +32,21 @@
void
MainViewTest
::
showManageAccountsPopup
()
{
QQuickWindow
*
mainWindow
=
App
::
getInstance
()
->
getMainWindow
();
// Open popup.
QTest
::
mouseClick
(
mainWindow
,
Qt
::
LeftButton
,
Qt
::
KeyboardModifiers
(),
QPoint
(
100
,
35
));
QTest
::
qWait
(
1000
);
const
char
name
[]
=
"DialogPlus_QMLTYPE_"
;
QQuickItem
*
virtualWindowContent
=
TestUtils
::
getVirtualWindowContainer
(
TestUtils
::
getVirtualWindow
(
mainWindow
)
)
->
childItems
().
at
(
0
);
QQuickItem
*
virtualWindow
=
TestUtils
::
getVirtualWindow
(
mainWindow
);
QQuickItem
*
virtualWindowContent
=
TestUtils
::
getVirtualWindowContainer
(
virtualWindow
)
->
childItems
().
at
(
0
);
QVERIFY
(
virtualWindowContent
);
QVERIFY
(
!
strncmp
(
virtualWindowContent
->
metaObject
()
->
className
(),
name
,
sizeof
name
-
1
));
QVERIFY
(
virtualWindowContent
->
objectName
()
==
"manageAccounts"
);
// Close popup.
QTest
::
mouseClick
(
mainWindow
,
Qt
::
LeftButton
,
Qt
::
KeyboardModifiers
(),
QPoint
(
476
,
392
));
QTest
::
qWait
(
1000
);
QVERIFY
(
TestUtils
::
getVirtualWindowContainer
(
virtualWindow
)
->
childItems
().
empty
());
}
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