on xenial help sign in
add a test to make sure tapping on the closeIcon closes the app
commit47f315e424f11c39e2d4aff07a91c2a642b3da2f authorOmer Akram <om26er@ubuntu.com> dateMon 14 Oct 2013, 16:04 (13 years ago) parent1c0e986
2 files changed+23
Dash/Apps/RunningApplicationTile.qml+1 tests/qmltests/Dash/Apps/tst_RunningApplicationsGrid.qml+22
Dash/Apps/RunningApplicationTile.qml+1
@@ -121,6 +121,7 @@ AbstractButton {
121121 }
122122
123123 CloseIcon {
124+ objectName: "closeIcon " + model.name
124125 anchors {
125126 left: shapedApplicationImage.left
126127 leftMargin: -units.gu(1)
tests/qmltests/Dash/Apps/tst_RunningApplicationsGrid.qml+22
@@ -213,6 +213,28 @@ Item {
213213 tryCompareFunction(checkCalendarTileExists, true)
214214 }
215215
216+ // While in termination mode, clicking on a running application tile's close icon
217+ // causes the corresponding application to be terminated
218+ function test_clickCloseIconToTerminateApp() {
219+ runningApplicationsGrid.terminationModeEnabled = true
220+
221+ var calendarTile = findChild(runningApplicationsGrid, "runningAppTile Calendar")
222+ var calendarTileCloseButton = findChild(runningApplicationsGrid, "closeIcon Calendar")
223+
224+ verify(calendarTile != undefined)
225+ verify(calendarTileCloseButton != undefined)
226+ verify(fakeRunningAppsModel.contains("calendar"))
227+
228+ mouseClick(calendarTileCloseButton, calendarTileCloseButton.width/2, calendarTileCloseButton.height/2)
229+
230+ verify(!fakeRunningAppsModel.contains("calendar"))
231+
232+ // The tile for the Calendar app should eventually vanish since the
233+ // application has been terminated.
234+ tryCompareFunction(checkCalendarTileExists, false)
235+
236+ }
237+
216238 function checkCalendarTileExists() {
217239 return findChild(runningApplicationsGrid, "runningAppTile Calendar")
218240 != undefined