2
* Copyright 2013 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21
import "../../../../Dash/People"
22
import Ubuntu.Components 0.1
23
import Unity.Test 0.1 as UT
38
target: peopleFilterGrid
46
column_0: 'user://001'
55
column_0: 'user://002'
64
column_0: 'user://003'
73
column_0: 'user://004'
82
column_0: 'user://005'
94
name: "DashPeopleFilterGrid"
100
function test_clickCell_data() {
103
x: peopleFilterGrid.minimumHorizontalSpacing+peopleFilterGrid.cellWidth/2,
104
y: peopleFilterGrid.verticalSpacing+peopleFilterGrid.cellHeight/2,
109
x: 2*peopleFilterGrid.minimumHorizontalSpacing+peopleFilterGrid.cellWidth+peopleFilterGrid.cellWidth/2,
110
y: peopleFilterGrid.verticalSpacing+peopleFilterGrid.cellHeight/2,
115
x: 3*peopleFilterGrid.minimumHorizontalSpacing+2*peopleFilterGrid.cellWidth+peopleFilterGrid.cellWidth/2,
116
y: peopleFilterGrid.verticalSpacing+peopleFilterGrid.cellHeight/2,
121
x: peopleFilterGrid.minimumHorizontalSpacing+peopleFilterGrid.cellWidth/2,
122
y: 2*peopleFilterGrid.verticalSpacing+peopleFilterGrid.cellHeight+peopleFilterGrid.cellHeight/2,
127
x: 2*peopleFilterGrid.minimumHorizontalSpacing+peopleFilterGrid.cellWidth+peopleFilterGrid.cellWidth/2,
128
y: 2*peopleFilterGrid.verticalSpacing+peopleFilterGrid.cellHeight+peopleFilterGrid.cellHeight/2,
135
function test_columns() {
136
compare(peopleFilterGrid.columns,3)
139
function test_clickCell(data) {
140
tryCompare(peopleFilterGrid, "flicking", false)
141
tryCompare(peopleFilterGrid, "moving", false)
143
wait(peopleFilterGrid.pressDelay > 0 ? peopleFilterGrid.pressDelay : 5)
144
mouseClick(peopleFilterGrid, data.x, data.y)
145
tryCompare(peopleFilterGrid, "flicking", false)
146
tryCompare(peopleFilterGrid, "moving", false)
147
compare(signalSpy.count, 1)
148
compare(signalSpy.signalArguments.length, 1, "signalArguments.length != 1")
149
compare(signalSpy.signalArguments[0][0], data.index)
150
compare(signalSpy.signalArguments[0][1]["uri"], data.uri)