Merge lp:~unity-team/unity/phablet.test_LensView into lp:unity/phablet
- phablet.test_LensView
- Merge into phablet
Status: | Rejected |
---|---|
Rejected by: | Andrea Cimitan |
Proposed branch: | lp:~unity-team/unity/phablet.test_LensView |
Merge into: | lp:unity/phablet |
Diff against target: |
879 lines (+776/-0) 20 files modified
tests/qmluitests/Dash/CMakeLists.txt (+3/-0) tests/qmluitests/Dash/qml/CMakeLists.txt (+1/-0) tests/qmluitests/Dash/qml/FakeLensView.qml (+87/-0) tests/qmluitests/Dash/qml/Unity/CMakeLists.txt (+36/-0) tests/qmluitests/Dash/qml/Unity/fake_lens.cpp (+62/-0) tests/qmluitests/Dash/qml/Unity/fake_lens.h (+56/-0) tests/qmluitests/Dash/qml/Unity/fake_lenses.cpp (+101/-0) tests/qmluitests/Dash/qml/Unity/fake_lenses.h (+69/-0) tests/qmluitests/Dash/qml/Unity/fake_unity_plugin.cpp (+34/-0) tests/qmluitests/Dash/qml/Unity/fake_unity_plugin.h (+34/-0) tests/qmluitests/Dash/qml/Unity/qmldir (+2/-0) tests/qmluitests/Dash/qml/Unity/test_unity_object.cpp (+25/-0) tests/qmluitests/Dash/qml/Unity/test_unity_object.h (+34/-0) tests/qmluitests/Dash/qml/fake_generic_lensView.qml (+24/-0) tests/qmluitests/Dash/qml/fake_lensView1.qml (+24/-0) tests/qmluitests/Dash/qml/fake_lensView2.qml (+24/-0) tests/qmluitests/Dash/qml/fake_lensView3.qml (+24/-0) tests/qmluitests/Dash/qml/fake_lensView4.qml (+24/-0) tests/qmluitests/Dash/tst_DashContent.qml (+60/-0) tests/qmluitests/Dash/tst_LensView.qml (+52/-0) |
To merge this branch: | bzr merge lp:~unity-team/unity/phablet.test_LensView |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Unity Team | Pending | ||
Review via email: mp+159134@code.launchpad.net |
Commit message
Adds fake Unity plugin (mostly done by dednick), and tests searchQuery for LensView
Description of the change
Adds fake Unity plugin (mostly done by dednick), and tests searchQuery for LensView
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:597
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Andrea Cimitan (cimi) wrote : | # |
Preview Diff
1 | === modified file 'tests/qmluitests/Dash/CMakeLists.txt' | |||
2 | --- tests/qmluitests/Dash/CMakeLists.txt 2013-04-11 15:05:45 +0000 | |||
3 | +++ tests/qmluitests/Dash/CMakeLists.txt 2013-04-16 12:13:28 +0000 | |||
4 | @@ -1,2 +1,5 @@ | |||
5 | 1 | add_subdirectory(qml) | ||
6 | 2 | |||
7 | 1 | add_qml_test(DashPreview) | 3 | add_qml_test(DashPreview) |
8 | 4 | add_qml_test(LensView IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${CMAKE_CURRENT_BINARY_DIR}/qml) | ||
9 | 2 | add_qml_test(PeoplePreview) | 5 | add_qml_test(PeoplePreview) |
10 | 3 | 6 | ||
11 | === added directory 'tests/qmluitests/Dash/qml' | |||
12 | === added file 'tests/qmluitests/Dash/qml/CMakeLists.txt' | |||
13 | --- tests/qmluitests/Dash/qml/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
14 | +++ tests/qmluitests/Dash/qml/CMakeLists.txt 2013-04-16 12:13:28 +0000 | |||
15 | @@ -0,0 +1,1 @@ | |||
16 | 1 | add_subdirectory(Unity) | ||
17 | 0 | 2 | ||
18 | === added file 'tests/qmluitests/Dash/qml/FakeLensView.qml' | |||
19 | --- tests/qmluitests/Dash/qml/FakeLensView.qml 1970-01-01 00:00:00 +0000 | |||
20 | +++ tests/qmluitests/Dash/qml/FakeLensView.qml 2013-04-16 12:13:28 +0000 | |||
21 | @@ -0,0 +1,87 @@ | |||
22 | 1 | /* | ||
23 | 2 | * Copyright 2013 Canonical Ltd. | ||
24 | 3 | * | ||
25 | 4 | * This program is free software; you can redistribute it and/or modify | ||
26 | 5 | * it under the terms of the GNU General Public License as published by | ||
27 | 6 | * the Free Software Foundation; version 3. | ||
28 | 7 | * | ||
29 | 8 | * This program is distributed in the hope that it will be useful, | ||
30 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
31 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
32 | 11 | * GNU General Public License for more details. | ||
33 | 12 | * | ||
34 | 13 | * You should have received a copy of the GNU General Public License | ||
35 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
36 | 15 | */ | ||
37 | 16 | |||
38 | 17 | import QtQuick 2.0 | ||
39 | 18 | import Unity 0.1 | ||
40 | 19 | import Ubuntu.Components 0.1 | ||
41 | 20 | |||
42 | 21 | FocusScope { | ||
43 | 22 | property Lens lens | ||
44 | 23 | property bool isCurrent : false | ||
45 | 24 | |||
46 | 25 | property var ball_color | ||
47 | 26 | |||
48 | 27 | Text { | ||
49 | 28 | id: label | ||
50 | 29 | anchors { | ||
51 | 30 | top: parent.top | ||
52 | 31 | left: parent.left | ||
53 | 32 | right: parent.right | ||
54 | 33 | } | ||
55 | 34 | height: units.gu(5) | ||
56 | 35 | text: lens.id | ||
57 | 36 | |||
58 | 37 | verticalAlignment: Text.AlignVCenter | ||
59 | 38 | horizontalAlignment: Text.AlignHCenter | ||
60 | 39 | } | ||
61 | 40 | |||
62 | 41 | Rectangle { | ||
63 | 42 | id: bounce_area | ||
64 | 43 | anchors { | ||
65 | 44 | top: label.bottom | ||
66 | 45 | left: parent.left | ||
67 | 46 | right: parent.right | ||
68 | 47 | bottom: parent.bottom | ||
69 | 48 | } | ||
70 | 49 | clip: true | ||
71 | 50 | |||
72 | 51 | Rectangle { | ||
73 | 52 | id: ball | ||
74 | 53 | width: units.gu(5) | ||
75 | 54 | height: units.gu(5) | ||
76 | 55 | radius: width*0.5 | ||
77 | 56 | |||
78 | 57 | border.width: 1 | ||
79 | 58 | border.color: "black" | ||
80 | 59 | color: ball_color | ||
81 | 60 | |||
82 | 61 | Component.onCompleted: { x = 100; y = 100; } | ||
83 | 62 | |||
84 | 63 | Behavior on x { | ||
85 | 64 | NumberAnimation { | ||
86 | 65 | id: x_animate; duration: 500 | ||
87 | 66 | |||
88 | 67 | onRunningChanged: { | ||
89 | 68 | if (!running) { | ||
90 | 69 | ball.x = ball.radius + Math.random() * (bounce_area.width - ball.width); | ||
91 | 70 | } | ||
92 | 71 | } | ||
93 | 72 | } | ||
94 | 73 | } | ||
95 | 74 | Behavior on y { | ||
96 | 75 | NumberAnimation { | ||
97 | 76 | id: y_animate; duration: 500 | ||
98 | 77 | |||
99 | 78 | onRunningChanged: { | ||
100 | 79 | if (!running) { | ||
101 | 80 | ball.y = ball.radius + Math.random() * (bounce_area.height - ball.height); | ||
102 | 81 | } | ||
103 | 82 | } | ||
104 | 83 | } | ||
105 | 84 | } | ||
106 | 85 | } | ||
107 | 86 | } | ||
108 | 87 | } | ||
109 | 0 | 88 | ||
110 | === added directory 'tests/qmluitests/Dash/qml/Unity' | |||
111 | === added file 'tests/qmluitests/Dash/qml/Unity/CMakeLists.txt' | |||
112 | --- tests/qmluitests/Dash/qml/Unity/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
113 | +++ tests/qmluitests/Dash/qml/Unity/CMakeLists.txt 2013-04-16 12:13:28 +0000 | |||
114 | @@ -0,0 +1,36 @@ | |||
115 | 1 | set(CMAKE_AUTOMOC ON) | ||
116 | 2 | |||
117 | 3 | include(FindPkgConfig) | ||
118 | 4 | find_package(Qt5Core REQUIRED) | ||
119 | 5 | find_package(Qt5Quick REQUIRED) | ||
120 | 6 | |||
121 | 7 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -Wall -Wextra -std=c++11") | ||
122 | 8 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs") | ||
123 | 9 | |||
124 | 10 | include_directories( | ||
125 | 11 | ${CMAKE_CURRENT_BINARY_DIR} | ||
126 | 12 | ${Qt5Core_INCLUDE_DIRS} | ||
127 | 13 | ${Qt5Quick_INCLUDE_DIRS} | ||
128 | 14 | ) | ||
129 | 15 | |||
130 | 16 | add_definitions(-DQT_NO_KEYWORDS) | ||
131 | 17 | |||
132 | 18 | set(UnityQML_SOURCES | ||
133 | 19 | fake_lens.cpp | ||
134 | 20 | fake_lenses.cpp | ||
135 | 21 | fake_unity_plugin.cpp | ||
136 | 22 | test_unity_object.cpp | ||
137 | 23 | ) | ||
138 | 24 | |||
139 | 25 | add_library(FakeUnityQml MODULE ${UnityQML_SOURCES}) | ||
140 | 26 | target_link_libraries(FakeUnityQml | ||
141 | 27 | ${Qt5Core_LIBRARIES} | ||
142 | 28 | ${Qt5Quick_LIBRARIES} | ||
143 | 29 | ) | ||
144 | 30 | |||
145 | 31 | qt5_use_modules(FakeUnityQml Qml) | ||
146 | 32 | |||
147 | 33 | # copy qmldir file into build directory for shadow builds | ||
148 | 34 | file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir" | ||
149 | 35 | DESTINATION ${CMAKE_CURRENT_BINARY_DIR} | ||
150 | 36 | ) | ||
151 | 0 | 37 | ||
152 | === added file 'tests/qmluitests/Dash/qml/Unity/fake_lens.cpp' | |||
153 | --- tests/qmluitests/Dash/qml/Unity/fake_lens.cpp 1970-01-01 00:00:00 +0000 | |||
154 | +++ tests/qmluitests/Dash/qml/Unity/fake_lens.cpp 2013-04-16 12:13:28 +0000 | |||
155 | @@ -0,0 +1,62 @@ | |||
156 | 1 | /* | ||
157 | 2 | * Copyright (C) 2013 Canonical, Ltd. | ||
158 | 3 | * | ||
159 | 4 | * This program is free software; you can redistribute it and/or modify | ||
160 | 5 | * it under the terms of the GNU General Public License as published by | ||
161 | 6 | * the Free Software Foundation; version 3. | ||
162 | 7 | * | ||
163 | 8 | * This program is distributed in the hope that it will be useful, | ||
164 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
165 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
166 | 11 | * GNU General Public License for more details. | ||
167 | 12 | * | ||
168 | 13 | * You should have received a copy of the GNU General Public License | ||
169 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
170 | 15 | */ | ||
171 | 16 | |||
172 | 17 | // Self | ||
173 | 18 | #include "fake_lens.h" | ||
174 | 19 | |||
175 | 20 | // TODO: Implement remaining pieces | ||
176 | 21 | |||
177 | 22 | Lens::Lens() | ||
178 | 23 | : m_visible(false) | ||
179 | 24 | {} | ||
180 | 25 | |||
181 | 26 | Lens::Lens(QString const& id, | ||
182 | 27 | QString const& name, | ||
183 | 28 | bool visible) | ||
184 | 29 | : m_id(id), | ||
185 | 30 | m_name(name), | ||
186 | 31 | m_visible(visible) | ||
187 | 32 | {} | ||
188 | 33 | |||
189 | 34 | QString Lens::id() const { | ||
190 | 35 | return m_id; | ||
191 | 36 | } | ||
192 | 37 | |||
193 | 38 | QString Lens::name() const { | ||
194 | 39 | return m_name; | ||
195 | 40 | } | ||
196 | 41 | |||
197 | 42 | QString Lens::searchQuery() const { | ||
198 | 43 | return m_searchQuery; | ||
199 | 44 | } | ||
200 | 45 | |||
201 | 46 | void Lens::setName(const QString &str) { | ||
202 | 47 | if (str != m_name) { | ||
203 | 48 | m_name = str; | ||
204 | 49 | Q_EMIT nameChanged(m_name); | ||
205 | 50 | } | ||
206 | 51 | } | ||
207 | 52 | |||
208 | 53 | void Lens::setSearchQuery(const QString &str) { | ||
209 | 54 | if (str != m_searchQuery) { | ||
210 | 55 | m_searchQuery = str; | ||
211 | 56 | Q_EMIT searchQueryChanged(m_searchQuery); | ||
212 | 57 | } | ||
213 | 58 | } | ||
214 | 59 | |||
215 | 60 | bool Lens::visible() const { | ||
216 | 61 | return m_visible; | ||
217 | 62 | } | ||
218 | 0 | 63 | ||
219 | === added file 'tests/qmluitests/Dash/qml/Unity/fake_lens.h' | |||
220 | --- tests/qmluitests/Dash/qml/Unity/fake_lens.h 1970-01-01 00:00:00 +0000 | |||
221 | +++ tests/qmluitests/Dash/qml/Unity/fake_lens.h 2013-04-16 12:13:28 +0000 | |||
222 | @@ -0,0 +1,56 @@ | |||
223 | 1 | /* | ||
224 | 2 | * Copyright (C) 2013 Canonical, Ltd. | ||
225 | 3 | * | ||
226 | 4 | * This program is free software; you can redistribute it and/or modify | ||
227 | 5 | * it under the terms of the GNU General Public License as published by | ||
228 | 6 | * the Free Software Foundation; version 3. | ||
229 | 7 | * | ||
230 | 8 | * This program is distributed in the hope that it will be useful, | ||
231 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
232 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
233 | 11 | * GNU General Public License for more details. | ||
234 | 12 | * | ||
235 | 13 | * You should have received a copy of the GNU General Public License | ||
236 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
237 | 15 | */ | ||
238 | 16 | |||
239 | 17 | #ifndef FAKE_LENS_H | ||
240 | 18 | #define FAKE_LENS_H | ||
241 | 19 | |||
242 | 20 | // Qt | ||
243 | 21 | #include <QObject> | ||
244 | 22 | |||
245 | 23 | class Lens : public QObject | ||
246 | 24 | { | ||
247 | 25 | Q_OBJECT | ||
248 | 26 | Q_PROPERTY(QString id READ id NOTIFY idChanged) | ||
249 | 27 | Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) | ||
250 | 28 | Q_PROPERTY(QString searchQuery READ searchQuery WRITE setSearchQuery NOTIFY searchQueryChanged) | ||
251 | 29 | Q_PROPERTY(bool visible READ visible NOTIFY visibleChanged) | ||
252 | 30 | |||
253 | 31 | public: | ||
254 | 32 | Lens(); | ||
255 | 33 | Lens(QString const& id, QString const& name, bool visible); | ||
256 | 34 | |||
257 | 35 | QString id() const; | ||
258 | 36 | QString name() const; | ||
259 | 37 | QString searchQuery() const; | ||
260 | 38 | bool visible() const; | ||
261 | 39 | |||
262 | 40 | void setName(const QString &str); | ||
263 | 41 | void setSearchQuery(const QString &str); | ||
264 | 42 | |||
265 | 43 | Q_SIGNALS: | ||
266 | 44 | void idChanged(QString); | ||
267 | 45 | void nameChanged(QString); | ||
268 | 46 | void searchQueryChanged(QString); | ||
269 | 47 | void visibleChanged(bool); | ||
270 | 48 | |||
271 | 49 | private: | ||
272 | 50 | QString m_id; | ||
273 | 51 | QString m_name; | ||
274 | 52 | QString m_searchQuery; | ||
275 | 53 | bool m_visible; | ||
276 | 54 | }; | ||
277 | 55 | |||
278 | 56 | #endif // FAKE_LENS_H | ||
279 | 0 | 57 | ||
280 | === added file 'tests/qmluitests/Dash/qml/Unity/fake_lenses.cpp' | |||
281 | --- tests/qmluitests/Dash/qml/Unity/fake_lenses.cpp 1970-01-01 00:00:00 +0000 | |||
282 | +++ tests/qmluitests/Dash/qml/Unity/fake_lenses.cpp 2013-04-16 12:13:28 +0000 | |||
283 | @@ -0,0 +1,101 @@ | |||
284 | 1 | /* | ||
285 | 2 | * Copyright (C) 2013 Canonical, Ltd. | ||
286 | 3 | * | ||
287 | 4 | * This program is free software; you can redistribute it and/or modify | ||
288 | 5 | * it under the terms of the GNU General Public License as published by | ||
289 | 6 | * the Free Software Foundation; version 3. | ||
290 | 7 | * | ||
291 | 8 | * This program is distributed in the hope that it will be useful, | ||
292 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
293 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
294 | 11 | * GNU General Public License for more details. | ||
295 | 12 | * | ||
296 | 13 | * You should have received a copy of the GNU General Public License | ||
297 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
298 | 15 | * | ||
299 | 16 | * Author: Nick Dedekind <nick.dedekind@canonical.com> | ||
300 | 17 | */ | ||
301 | 18 | |||
302 | 19 | // Self | ||
303 | 20 | #include "fake_lenses.h" | ||
304 | 21 | |||
305 | 22 | // TODO: Implement remaining pieces, like Categories (i.e. LensView now gives warnings) | ||
306 | 23 | |||
307 | 24 | Lenses::Lenses(QObject *parent) | ||
308 | 25 | : QAbstractListModel(parent) | ||
309 | 26 | { | ||
310 | 27 | m_roles[Lenses::RoleLens] = "lens"; | ||
311 | 28 | m_roles[Lenses::RoleId] = "id"; | ||
312 | 29 | m_roles[Lenses::RoleVisible] = "visible"; | ||
313 | 30 | |||
314 | 31 | m_lenses << (new Lens("MockLens1", "People", true)) | ||
315 | 32 | << (new Lens("MockLens2", "Music", true)) | ||
316 | 33 | << (new Lens("MockLens3", "Home", false)) | ||
317 | 34 | << (new Lens("MockLens4", "Apps", true)) | ||
318 | 35 | << (new Lens("MockLens5", "Video", true)); | ||
319 | 36 | } | ||
320 | 37 | |||
321 | 38 | Lenses::~Lenses() | ||
322 | 39 | { | ||
323 | 40 | qDeleteAll(m_lenses); | ||
324 | 41 | m_lenses.clear(); | ||
325 | 42 | } | ||
326 | 43 | |||
327 | 44 | QHash<int, QByteArray> Lenses::roleNames() const | ||
328 | 45 | { | ||
329 | 46 | return m_roles; | ||
330 | 47 | } | ||
331 | 48 | |||
332 | 49 | int Lenses::rowCount(const QModelIndex&) const | ||
333 | 50 | { | ||
334 | 51 | return m_lenses.count(); | ||
335 | 52 | } | ||
336 | 53 | |||
337 | 54 | QVariant Lenses::data(const QModelIndex& index, int role) const | ||
338 | 55 | { | ||
339 | 56 | Q_UNUSED(role) | ||
340 | 57 | |||
341 | 58 | if (!index.isValid() || index.row() >= m_lenses.size()) { | ||
342 | 59 | return QVariant(); | ||
343 | 60 | } | ||
344 | 61 | |||
345 | 62 | Lens* lens = m_lenses.at(index.row()); | ||
346 | 63 | |||
347 | 64 | if (role == Lenses::RoleLens) { | ||
348 | 65 | return QVariant::fromValue(lens); | ||
349 | 66 | } else if (role == Lenses::RoleId) { | ||
350 | 67 | return QVariant::fromValue(lens->id()); | ||
351 | 68 | } else if (role == Lenses::RoleVisible) { | ||
352 | 69 | return QVariant::fromValue(lens->visible()); | ||
353 | 70 | } else { | ||
354 | 71 | return QVariant(); | ||
355 | 72 | } | ||
356 | 73 | } | ||
357 | 74 | |||
358 | 75 | QVariant Lenses::get(int row) const | ||
359 | 76 | { | ||
360 | 77 | return data(QAbstractListModel::index(row), 0); | ||
361 | 78 | } | ||
362 | 79 | |||
363 | 80 | QVariant Lenses::get(QString const&) const | ||
364 | 81 | { | ||
365 | 82 | return QVariant(); | ||
366 | 83 | } | ||
367 | 84 | |||
368 | 85 | QModelIndex Lenses::parent(const QModelIndex&) const | ||
369 | 86 | { | ||
370 | 87 | return QModelIndex(); | ||
371 | 88 | } | ||
372 | 89 | |||
373 | 90 | bool Lenses::loaded() const | ||
374 | 91 | { | ||
375 | 92 | return true; | ||
376 | 93 | } | ||
377 | 94 | |||
378 | 95 | void Lenses::addLens(Lens* lens) | ||
379 | 96 | { | ||
380 | 97 | int index = rowCount(); | ||
381 | 98 | beginInsertRows(QModelIndex(), index, index); | ||
382 | 99 | m_lenses.append(lens); | ||
383 | 100 | endInsertRows(); | ||
384 | 101 | } | ||
385 | 0 | 102 | ||
386 | === added file 'tests/qmluitests/Dash/qml/Unity/fake_lenses.h' | |||
387 | --- tests/qmluitests/Dash/qml/Unity/fake_lenses.h 1970-01-01 00:00:00 +0000 | |||
388 | +++ tests/qmluitests/Dash/qml/Unity/fake_lenses.h 2013-04-16 12:13:28 +0000 | |||
389 | @@ -0,0 +1,69 @@ | |||
390 | 1 | /* | ||
391 | 2 | * Copyright (C) 2013 Canonical, Ltd. | ||
392 | 3 | * | ||
393 | 4 | * This program is free software; you can redistribute it and/or modify | ||
394 | 5 | * it under the terms of the GNU General Public License as published by | ||
395 | 6 | * the Free Software Foundation; version 3. | ||
396 | 7 | * | ||
397 | 8 | * This program is distributed in the hope that it will be useful, | ||
398 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
399 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
400 | 11 | * GNU General Public License for more details. | ||
401 | 12 | * | ||
402 | 13 | * You should have received a copy of the GNU General Public License | ||
403 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
404 | 15 | * | ||
405 | 16 | * Author: Nick Dedekind <nick.dedekind@canonical.com> | ||
406 | 17 | */ | ||
407 | 18 | |||
408 | 19 | #ifndef FAKE_LENSES_H | ||
409 | 20 | #define FAKE_LENSES_H | ||
410 | 21 | |||
411 | 22 | // Local | ||
412 | 23 | #include "fake_lens.h" | ||
413 | 24 | |||
414 | 25 | // Qt | ||
415 | 26 | #include <QAbstractListModel> | ||
416 | 27 | #include <QList> | ||
417 | 28 | |||
418 | 29 | class Lenses : public QAbstractListModel | ||
419 | 30 | { | ||
420 | 31 | Q_OBJECT | ||
421 | 32 | Q_ENUMS(Roles) | ||
422 | 33 | Q_PROPERTY(bool loaded READ loaded NOTIFY loadedChanged) | ||
423 | 34 | |||
424 | 35 | public: | ||
425 | 36 | explicit Lenses(QObject *parent = 0); | ||
426 | 37 | ~Lenses(); | ||
427 | 38 | |||
428 | 39 | enum Roles { | ||
429 | 40 | RoleLens, | ||
430 | 41 | RoleId, | ||
431 | 42 | RoleVisible | ||
432 | 43 | }; | ||
433 | 44 | |||
434 | 45 | Q_INVOKABLE int rowCount(const QModelIndex& parent = QModelIndex()) const; | ||
435 | 46 | |||
436 | 47 | Q_INVOKABLE QVariant get(int row) const; | ||
437 | 48 | Q_INVOKABLE QVariant get(const QString& lens_id) const; | ||
438 | 49 | |||
439 | 50 | Q_INVOKABLE void addLens(Lens* lens); | ||
440 | 51 | |||
441 | 52 | |||
442 | 53 | QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; | ||
443 | 54 | QHash<int, QByteArray> roleNames() const; | ||
444 | 55 | QModelIndex parent ( const QModelIndex & index ) const; | ||
445 | 56 | |||
446 | 57 | bool loaded() const; | ||
447 | 58 | |||
448 | 59 | Q_SIGNALS: | ||
449 | 60 | void activateLensRequested(const QString& lens_id); | ||
450 | 61 | void loadedChanged(bool); | ||
451 | 62 | |||
452 | 63 | private: | ||
453 | 64 | QList<Lens*> m_lenses; | ||
454 | 65 | QHash<int, QByteArray> m_roles; | ||
455 | 66 | bool m_loaded; | ||
456 | 67 | }; | ||
457 | 68 | |||
458 | 69 | #endif // LENSES_H | ||
459 | 0 | 70 | ||
460 | === added file 'tests/qmluitests/Dash/qml/Unity/fake_unity_plugin.cpp' | |||
461 | --- tests/qmluitests/Dash/qml/Unity/fake_unity_plugin.cpp 1970-01-01 00:00:00 +0000 | |||
462 | +++ tests/qmluitests/Dash/qml/Unity/fake_unity_plugin.cpp 2013-04-16 12:13:28 +0000 | |||
463 | @@ -0,0 +1,34 @@ | |||
464 | 1 | /* | ||
465 | 2 | * Copyright (C) 2013 Canonical, Ltd. | ||
466 | 3 | * | ||
467 | 4 | * This program is free software; you can redistribute it and/or modify | ||
468 | 5 | * it under the terms of the GNU General Public License as published by | ||
469 | 6 | * the Free Software Foundation; version 3. | ||
470 | 7 | * | ||
471 | 8 | * This program is distributed in the hope that it will be useful, | ||
472 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
473 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
474 | 11 | * GNU General Public License for more details. | ||
475 | 12 | * | ||
476 | 13 | * You should have received a copy of the GNU General Public License | ||
477 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
478 | 15 | * | ||
479 | 16 | * Author: Nick Dedekind <nick.dedekind@canonical.com> | ||
480 | 17 | */ | ||
481 | 18 | |||
482 | 19 | // Self | ||
483 | 20 | #include "fake_unity_plugin.h" | ||
484 | 21 | #include "fake_lenses.h" | ||
485 | 22 | #include "test_unity_object.h" | ||
486 | 23 | |||
487 | 24 | // Qt | ||
488 | 25 | #include <QtQml> | ||
489 | 26 | |||
490 | 27 | void FakeUnityPlugin::registerTypes(const char *uri) | ||
491 | 28 | { | ||
492 | 29 | Q_ASSERT(uri == QLatin1String("Unity")); | ||
493 | 30 | |||
494 | 31 | qmlRegisterType<UnityTestObject>(uri, 0, 1, "UnityTestObject"); | ||
495 | 32 | qmlRegisterType<Lenses>(uri, 0, 1, "Lenses"); | ||
496 | 33 | qmlRegisterType<Lens>(uri, 0, 1, "Lens"); | ||
497 | 34 | } | ||
498 | 0 | 35 | ||
499 | === added file 'tests/qmluitests/Dash/qml/Unity/fake_unity_plugin.h' | |||
500 | --- tests/qmluitests/Dash/qml/Unity/fake_unity_plugin.h 1970-01-01 00:00:00 +0000 | |||
501 | +++ tests/qmluitests/Dash/qml/Unity/fake_unity_plugin.h 2013-04-16 12:13:28 +0000 | |||
502 | @@ -0,0 +1,34 @@ | |||
503 | 1 | /* | ||
504 | 2 | * Copyright (C) 2013 Canonical, Ltd. | ||
505 | 3 | * | ||
506 | 4 | * This program is free software; you can redistribute it and/or modify | ||
507 | 5 | * it under the terms of the GNU General Public License as published by | ||
508 | 6 | * the Free Software Foundation; version 3. | ||
509 | 7 | * | ||
510 | 8 | * This program is distributed in the hope that it will be useful, | ||
511 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
512 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
513 | 11 | * GNU General Public License for more details. | ||
514 | 12 | * | ||
515 | 13 | * You should have received a copy of the GNU General Public License | ||
516 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
517 | 15 | * | ||
518 | 16 | * Author: Nick Dedekind <nick.dedekind@canonical.com> | ||
519 | 17 | */ | ||
520 | 18 | |||
521 | 19 | #ifndef FAKE_UNITY_PLUGIN_H | ||
522 | 20 | #define FAKE_UNITY_PLUGIN_H | ||
523 | 21 | |||
524 | 22 | // Qt | ||
525 | 23 | #include <QtQml/QQmlExtensionPlugin> | ||
526 | 24 | |||
527 | 25 | class FakeUnityPlugin : public QQmlExtensionPlugin | ||
528 | 26 | { | ||
529 | 27 | Q_OBJECT | ||
530 | 28 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") | ||
531 | 29 | |||
532 | 30 | public: | ||
533 | 31 | void registerTypes(const char *uri); | ||
534 | 32 | }; | ||
535 | 33 | |||
536 | 34 | #endif | ||
537 | 0 | 35 | ||
538 | === added file 'tests/qmluitests/Dash/qml/Unity/qmldir' | |||
539 | --- tests/qmluitests/Dash/qml/Unity/qmldir 1970-01-01 00:00:00 +0000 | |||
540 | +++ tests/qmluitests/Dash/qml/Unity/qmldir 2013-04-16 12:13:28 +0000 | |||
541 | @@ -0,0 +1,2 @@ | |||
542 | 1 | module Unity | ||
543 | 2 | plugin FakeUnityQml | ||
544 | 0 | 3 | ||
545 | === added file 'tests/qmluitests/Dash/qml/Unity/test_unity_object.cpp' | |||
546 | --- tests/qmluitests/Dash/qml/Unity/test_unity_object.cpp 1970-01-01 00:00:00 +0000 | |||
547 | +++ tests/qmluitests/Dash/qml/Unity/test_unity_object.cpp 2013-04-16 12:13:28 +0000 | |||
548 | @@ -0,0 +1,25 @@ | |||
549 | 1 | /* | ||
550 | 2 | * Copyright (C) 2012 Canonical, Ltd. | ||
551 | 3 | * | ||
552 | 4 | * This program is free software; you can redistribute it and/or modify | ||
553 | 5 | * it under the terms of the GNU General Public License as published by | ||
554 | 6 | * the Free Software Foundation; version 3. | ||
555 | 7 | * | ||
556 | 8 | * This program is distributed in the hope that it will be useful, | ||
557 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
558 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
559 | 11 | * GNU General Public License for more details. | ||
560 | 12 | * | ||
561 | 13 | * You should have received a copy of the GNU General Public License | ||
562 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
563 | 15 | * | ||
564 | 16 | * Author: Nick Dedekind <nick.dedekind@canonical.com> | ||
565 | 17 | */ | ||
566 | 18 | |||
567 | 19 | // Self | ||
568 | 20 | #include "test_unity_object.h" | ||
569 | 21 | |||
570 | 22 | QString UnityTestObject::testParameter() const | ||
571 | 23 | { | ||
572 | 24 | return "test_result"; | ||
573 | 25 | } | ||
574 | 0 | 26 | ||
575 | === added file 'tests/qmluitests/Dash/qml/Unity/test_unity_object.h' | |||
576 | --- tests/qmluitests/Dash/qml/Unity/test_unity_object.h 1970-01-01 00:00:00 +0000 | |||
577 | +++ tests/qmluitests/Dash/qml/Unity/test_unity_object.h 2013-04-16 12:13:28 +0000 | |||
578 | @@ -0,0 +1,34 @@ | |||
579 | 1 | /* | ||
580 | 2 | * Copyright (C) 2012 Canonical, Ltd. | ||
581 | 3 | * | ||
582 | 4 | * This program is free software; you can redistribute it and/or modify | ||
583 | 5 | * it under the terms of the GNU General Public License as published by | ||
584 | 6 | * the Free Software Foundation; version 3. | ||
585 | 7 | * | ||
586 | 8 | * This program is distributed in the hope that it will be useful, | ||
587 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
588 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
589 | 11 | * GNU General Public License for more details. | ||
590 | 12 | * | ||
591 | 13 | * You should have received a copy of the GNU General Public License | ||
592 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
593 | 15 | * | ||
594 | 16 | * Author: Nick Dedekind <nick.dedekind@canonical.com> | ||
595 | 17 | */ | ||
596 | 18 | |||
597 | 19 | #ifndef PLUGIN_H | ||
598 | 20 | #define PLUGIN_H | ||
599 | 21 | |||
600 | 22 | // Qt | ||
601 | 23 | #include <QObject> | ||
602 | 24 | |||
603 | 25 | class UnityTestObject : public QObject | ||
604 | 26 | { | ||
605 | 27 | Q_OBJECT | ||
606 | 28 | Q_PROPERTY(QString testParameter READ testParameter) | ||
607 | 29 | |||
608 | 30 | public: | ||
609 | 31 | QString testParameter() const; | ||
610 | 32 | }; | ||
611 | 33 | |||
612 | 34 | #endif // PLUGIN_H | ||
613 | 0 | 35 | ||
614 | === added file 'tests/qmluitests/Dash/qml/fake_generic_lensView.qml' | |||
615 | --- tests/qmluitests/Dash/qml/fake_generic_lensView.qml 1970-01-01 00:00:00 +0000 | |||
616 | +++ tests/qmluitests/Dash/qml/fake_generic_lensView.qml 2013-04-16 12:13:28 +0000 | |||
617 | @@ -0,0 +1,24 @@ | |||
618 | 1 | /* | ||
619 | 2 | * Copyright 2013 Canonical Ltd. | ||
620 | 3 | * | ||
621 | 4 | * This program is free software; you can redistribute it and/or modify | ||
622 | 5 | * it under the terms of the GNU General Public License as published by | ||
623 | 6 | * the Free Software Foundation; version 3. | ||
624 | 7 | * | ||
625 | 8 | * This program is distributed in the hope that it will be useful, | ||
626 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
627 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
628 | 11 | * GNU General Public License for more details. | ||
629 | 12 | * | ||
630 | 13 | * You should have received a copy of the GNU General Public License | ||
631 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
632 | 15 | */ | ||
633 | 16 | |||
634 | 17 | import QtQuick 2.0 | ||
635 | 18 | |||
636 | 19 | FakeLensView { | ||
637 | 20 | id: fake_generic_lensView | ||
638 | 21 | objectName: "fake_generic_lensView" | ||
639 | 22 | |||
640 | 23 | ball_color: "orange" | ||
641 | 24 | } | ||
642 | 0 | 25 | ||
643 | === added file 'tests/qmluitests/Dash/qml/fake_lensView1.qml' | |||
644 | --- tests/qmluitests/Dash/qml/fake_lensView1.qml 1970-01-01 00:00:00 +0000 | |||
645 | +++ tests/qmluitests/Dash/qml/fake_lensView1.qml 2013-04-16 12:13:28 +0000 | |||
646 | @@ -0,0 +1,24 @@ | |||
647 | 1 | /* | ||
648 | 2 | * Copyright 2013 Canonical Ltd. | ||
649 | 3 | * | ||
650 | 4 | * This program is free software; you can redistribute it and/or modify | ||
651 | 5 | * it under the terms of the GNU General Public License as published by | ||
652 | 6 | * the Free Software Foundation; version 3. | ||
653 | 7 | * | ||
654 | 8 | * This program is distributed in the hope that it will be useful, | ||
655 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
656 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
657 | 11 | * GNU General Public License for more details. | ||
658 | 12 | * | ||
659 | 13 | * You should have received a copy of the GNU General Public License | ||
660 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
661 | 15 | */ | ||
662 | 16 | |||
663 | 17 | import QtQuick 2.0 | ||
664 | 18 | |||
665 | 19 | FakeLensView { | ||
666 | 20 | id: fake_lensView1 | ||
667 | 21 | objectName: "fake_lensView1" | ||
668 | 22 | |||
669 | 23 | ball_color: "red" | ||
670 | 24 | } | ||
671 | 0 | 25 | ||
672 | === added file 'tests/qmluitests/Dash/qml/fake_lensView2.qml' | |||
673 | --- tests/qmluitests/Dash/qml/fake_lensView2.qml 1970-01-01 00:00:00 +0000 | |||
674 | +++ tests/qmluitests/Dash/qml/fake_lensView2.qml 2013-04-16 12:13:28 +0000 | |||
675 | @@ -0,0 +1,24 @@ | |||
676 | 1 | /* | ||
677 | 2 | * Copyright 2013 Canonical Ltd. | ||
678 | 3 | * | ||
679 | 4 | * This program is free software; you can redistribute it and/or modify | ||
680 | 5 | * it under the terms of the GNU General Public License as published by | ||
681 | 6 | * the Free Software Foundation; version 3. | ||
682 | 7 | * | ||
683 | 8 | * This program is distributed in the hope that it will be useful, | ||
684 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
685 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
686 | 11 | * GNU General Public License for more details. | ||
687 | 12 | * | ||
688 | 13 | * You should have received a copy of the GNU General Public License | ||
689 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
690 | 15 | */ | ||
691 | 16 | |||
692 | 17 | import QtQuick 2.0 | ||
693 | 18 | |||
694 | 19 | FakeLensView { | ||
695 | 20 | id: fake_lensView2 | ||
696 | 21 | objectName: "fake_lensView2" | ||
697 | 22 | |||
698 | 23 | ball_color: "blue" | ||
699 | 24 | } | ||
700 | 0 | 25 | ||
701 | === added file 'tests/qmluitests/Dash/qml/fake_lensView3.qml' | |||
702 | --- tests/qmluitests/Dash/qml/fake_lensView3.qml 1970-01-01 00:00:00 +0000 | |||
703 | +++ tests/qmluitests/Dash/qml/fake_lensView3.qml 2013-04-16 12:13:28 +0000 | |||
704 | @@ -0,0 +1,24 @@ | |||
705 | 1 | /* | ||
706 | 2 | * Copyright 2013 Canonical Ltd. | ||
707 | 3 | * | ||
708 | 4 | * This program is free software; you can redistribute it and/or modify | ||
709 | 5 | * it under the terms of the GNU General Public License as published by | ||
710 | 6 | * the Free Software Foundation; version 3. | ||
711 | 7 | * | ||
712 | 8 | * This program is distributed in the hope that it will be useful, | ||
713 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
714 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
715 | 11 | * GNU General Public License for more details. | ||
716 | 12 | * | ||
717 | 13 | * You should have received a copy of the GNU General Public License | ||
718 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
719 | 15 | */ | ||
720 | 16 | |||
721 | 17 | import QtQuick 2.0 | ||
722 | 18 | |||
723 | 19 | FakeLensView { | ||
724 | 20 | id: fake_lensView3 | ||
725 | 21 | objectName: "fake_lensView3" | ||
726 | 22 | |||
727 | 23 | ball_color: "green" | ||
728 | 24 | } | ||
729 | 0 | 25 | ||
730 | === added file 'tests/qmluitests/Dash/qml/fake_lensView4.qml' | |||
731 | --- tests/qmluitests/Dash/qml/fake_lensView4.qml 1970-01-01 00:00:00 +0000 | |||
732 | +++ tests/qmluitests/Dash/qml/fake_lensView4.qml 2013-04-16 12:13:28 +0000 | |||
733 | @@ -0,0 +1,24 @@ | |||
734 | 1 | /* | ||
735 | 2 | * Copyright 2013 Canonical Ltd. | ||
736 | 3 | * | ||
737 | 4 | * This program is free software; you can redistribute it and/or modify | ||
738 | 5 | * it under the terms of the GNU General Public License as published by | ||
739 | 6 | * the Free Software Foundation; version 3. | ||
740 | 7 | * | ||
741 | 8 | * This program is distributed in the hope that it will be useful, | ||
742 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
743 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
744 | 11 | * GNU General Public License for more details. | ||
745 | 12 | * | ||
746 | 13 | * You should have received a copy of the GNU General Public License | ||
747 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
748 | 15 | */ | ||
749 | 16 | |||
750 | 17 | import QtQuick 2.0 | ||
751 | 18 | |||
752 | 19 | FakeLensView { | ||
753 | 20 | id: fake_lensView4 | ||
754 | 21 | objectName: "fake_lensView4" | ||
755 | 22 | |||
756 | 23 | ball_color: "grey" | ||
757 | 24 | } | ||
758 | 0 | 25 | ||
759 | === added file 'tests/qmluitests/Dash/tst_DashContent.qml' | |||
760 | --- tests/qmluitests/Dash/tst_DashContent.qml 1970-01-01 00:00:00 +0000 | |||
761 | +++ tests/qmluitests/Dash/tst_DashContent.qml 2013-04-16 12:13:28 +0000 | |||
762 | @@ -0,0 +1,60 @@ | |||
763 | 1 | /* | ||
764 | 2 | * Copyright 2013 Canonical Ltd. | ||
765 | 3 | * | ||
766 | 4 | * This program is free software; you can redistribute it and/or modify | ||
767 | 5 | * it under the terms of the GNU General Public License as published by | ||
768 | 6 | * the Free Software Foundation; version 3. | ||
769 | 7 | * | ||
770 | 8 | * This program is distributed in the hope that it will be useful, | ||
771 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
772 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
773 | 11 | * GNU General Public License for more details. | ||
774 | 12 | * | ||
775 | 13 | * You should have received a copy of the GNU General Public License | ||
776 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
777 | 15 | */ | ||
778 | 16 | |||
779 | 17 | import QtQuick 2.0 | ||
780 | 18 | import QtTest 1.0 | ||
781 | 19 | import ".." | ||
782 | 20 | import "../../../Dash" | ||
783 | 21 | |||
784 | 22 | import Unity 0.1 | ||
785 | 23 | |||
786 | 24 | Item { | ||
787 | 25 | id: shell | ||
788 | 26 | width: units.gu(40) | ||
789 | 27 | height: units.gu(80) | ||
790 | 28 | |||
791 | 29 | property ListModel searchHistory: ListModel {} | ||
792 | 30 | |||
793 | 31 | Lenses { | ||
794 | 32 | id: lensesModel | ||
795 | 33 | } | ||
796 | 34 | |||
797 | 35 | DashContent { | ||
798 | 36 | id: dash_content | ||
799 | 37 | anchors.fill: parent | ||
800 | 38 | |||
801 | 39 | model: lensesModel | ||
802 | 40 | lenses : lensesModel | ||
803 | 41 | |||
804 | 42 | |||
805 | 43 | lensDelegateMapping: { "MockLens1" : "../tests/qmluitests/Dash/qml/fake_lensView1.qml", | ||
806 | 44 | "MockLens2" : "../tests/qmluitests/Dash/qml/fake_lensView2.qml", | ||
807 | 45 | "MockLens3" : "../tests/qmluitests/Dash/qml/fake_lensView3.qml", | ||
808 | 46 | "MockLens4" : "../tests/qmluitests/Dash/qml/fake_lensView4.qml" | ||
809 | 47 | } | ||
810 | 48 | |||
811 | 49 | genericLens: "../tests/qmluitests/Dash/qml/fake_generic_lensView.qml" | ||
812 | 50 | } | ||
813 | 51 | |||
814 | 52 | UnityTestCase { | ||
815 | 53 | name: "DashContentTest" | ||
816 | 54 | when: windowShown | ||
817 | 55 | |||
818 | 56 | function test_() { | ||
819 | 57 | |||
820 | 58 | } | ||
821 | 59 | } | ||
822 | 60 | } | ||
823 | 0 | 61 | ||
824 | === added file 'tests/qmluitests/Dash/tst_LensView.qml' | |||
825 | --- tests/qmluitests/Dash/tst_LensView.qml 1970-01-01 00:00:00 +0000 | |||
826 | +++ tests/qmluitests/Dash/tst_LensView.qml 2013-04-16 12:13:28 +0000 | |||
827 | @@ -0,0 +1,52 @@ | |||
828 | 1 | /* | ||
829 | 2 | * Copyright 2013 Canonical Ltd. | ||
830 | 3 | * | ||
831 | 4 | * This program is free software; you can redistribute it and/or modify | ||
832 | 5 | * it under the terms of the GNU General Public License as published by | ||
833 | 6 | * the Free Software Foundation; version 3. | ||
834 | 7 | * | ||
835 | 8 | * This program is distributed in the hope that it will be useful, | ||
836 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
837 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
838 | 11 | * GNU General Public License for more details. | ||
839 | 12 | * | ||
840 | 13 | * You should have received a copy of the GNU General Public License | ||
841 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
842 | 15 | */ | ||
843 | 16 | |||
844 | 17 | import QtQuick 2.0 | ||
845 | 18 | import QtTest 1.0 | ||
846 | 19 | import Unity 0.1 | ||
847 | 20 | import ".." | ||
848 | 21 | import "../../../Dash" | ||
849 | 22 | import Ubuntu.Components 0.1 | ||
850 | 23 | |||
851 | 24 | Item { | ||
852 | 25 | width: units.gu(120) | ||
853 | 26 | height: units.gu(80) | ||
854 | 27 | |||
855 | 28 | Lenses { | ||
856 | 29 | id: lenses | ||
857 | 30 | } | ||
858 | 31 | |||
859 | 32 | LensView { | ||
860 | 33 | id: lensView | ||
861 | 34 | anchors.fill: parent | ||
862 | 35 | |||
863 | 36 | Component.onCompleted: lens = lenses.get(0) | ||
864 | 37 | |||
865 | 38 | TestCase { | ||
866 | 39 | name: "LensView" | ||
867 | 40 | |||
868 | 41 | function init() { | ||
869 | 42 | lensView.lens = lenses.get(0) | ||
870 | 43 | } | ||
871 | 44 | |||
872 | 45 | function test_changeLens() { | ||
873 | 46 | lensView.lens.searchQuery = "test" | ||
874 | 47 | lensView.lens = lenses.get(1) | ||
875 | 48 | compare(lensView.lens.searchQuery, "", "searchQuery should be empty") | ||
876 | 49 | } | ||
877 | 50 | } | ||
878 | 51 | } | ||
879 | 52 | } |
PASSED: Continuous integration, rev:594 jenkins. qa.ubuntu. com/job/ unity-phablet- ci/554/ s-jenkins: 8080/job/ unity-phablet- qmluitests/ 349 jenkins. qa.ubuntu. com/job/ unity-phablet- quantal- armhf-ci/ 555 jenkins. qa.ubuntu. com/job/ unity-phablet- quantal- armhf-ci/ 555/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ unity-phablet- quantal- i386-ci/ 554 jenkins. qa.ubuntu. com/job/ unity-phablet- raring- armhf-ci/ 430 jenkins. qa.ubuntu. com/job/ unity-phablet- raring- armhf-ci/ 430/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ unity-phablet- raring- i386-ci/ 434 jenkins. qa.ubuntu. com/job/ generic- mediumtests- runner/ 1050
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins: 8080/job/ unity-phablet- ci/554/ rebuild
http://