Merge lp:~artmello/webbrowser-app/webbrowser-app-fix_1484562 into lp:webbrowser-app
- webbrowser-app-fix_1484562
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Olivier Tilloy |
Approved revision: | 1155 |
Merged at revision: | 1148 |
Proposed branch: | lp:~artmello/webbrowser-app/webbrowser-app-fix_1484562 |
Merge into: | lp:webbrowser-app |
Diff against target: |
359 lines (+148/-53) 6 files modified
src/app/webbrowser/Browser.qml (+0/-1) src/app/webbrowser/HistoryViewWide.qml (+60/-36) src/app/webbrowser/history-model.cpp (+31/-0) src/app/webbrowser/history-model.h (+2/-0) tests/unittests/history-model/tst_HistoryModelTests.cpp (+11/-0) tests/unittests/qml/tst_HistoryViewWide.qml (+44/-16) |
To merge this branch: | bzr merge lp:~artmello/webbrowser-app/webbrowser-app-fix_1484562 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Needs Fixing | |
Olivier Tilloy | Approve | ||
Review via email: mp+268165@code.launchpad.net |
Commit message
Add support for removing history entries with delete key in HistoryViewWide
Description of the change
Add support for removing history entries with delete key in HistoryViewWide
PS Jenkins bot (ps-jenkins) wrote : | # |
- 1141. By Arthur Mello
-
Improve qml tests
- 1142. By Arthur Mello
-
Merge with trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1142
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Olivier Tilloy (osomon) wrote : | # |
If I press Delete repeatedly to manually delete all history entries for a given day (just tried with Today), the corresponding date entry in the left panel disappears as expected, however the right panel isn’t updated, it remains empty, until I focus the left panel with the left arrow and move up/down.
When the last entry is deleted, the selection should probably be reset to All History.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1142
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1143. By Arthur Mello
-
Set left panel to "All History" when the last entry is deleted
- 1144. By Arthur Mello
-
Merge with trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1144
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Olivier Tilloy (osomon) wrote : | # |
In the two new test functions, checking that the 'count' property of a spy is 0 right after calling clear() on that spy is useless. This is guaranteed to be true, by definition.
In onDeletePressed, if the left panel has active focus and the current index is 0 ("All History"), you could call historyModel.
Similarly, it might be interesting to add a 'clearByDate()' method to the history model to allow deleting all the entries for one given date, instead of iterating. This would be faster and cleaner.
- 1145. By Arthur Mello
-
Remove unnecessary checks
- 1146. By Arthur Mello
-
Use clearAll when deleting all entries from history
- 1147. By Arthur Mello
-
Add a removeEntriesByDate to the HistoryModel
- 1148. By Arthur Mello
-
Add unittests for the HistoryModel new method
- 1149. By Arthur Mello
-
Use signals to call changes on the history model to keep consistency
- 1150. By Arthur Mello
-
Add qml tests to HistoryViewWide
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1150
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Olivier Tilloy (osomon) wrote : | # |
> 1149. By Arthur Mello 12 hours ago
> Use signals to call changes on the history model to keep consistency
Actually, I would have done the opposite: the history model is already exposed to the component, so there is no need to add signals (and the existing ones could be removed): calling methods on the model directly is absolutely fine, and makes the code easier to read. Unit tests won’t be able to monitor signal emissions, but they can still check that after deleting entries the count of the listviews is correctly updated.
Olivier Tilloy (osomon) wrote : | # |
193 + dateTime.
The time should also include milliseconds (999).
- 1151. By Arthur Mello
-
Time used to rmeove entries from database should also include milliseconds
- 1152. By Arthur Mello
-
Merge with trunk
- 1153. By Arthur Mello
-
Stop using signals for changes on the HistoryModel
- 1154. By Arthur Mello
-
Update QML tests
Olivier Tilloy (osomon) wrote : | # |
Not strictly necessary for tests to pass, but it would be better for the sake of completeness to re-implement the cleanup() method and have it clear historyMockModel.
- 1155. By Arthur Mello
-
Clean all history entries in the cleanup method
Olivier Tilloy (osomon) wrote : | # |
Thanks, that looks good to me now.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1154
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'src/app/webbrowser/Browser.qml' | |||
2 | --- src/app/webbrowser/Browser.qml 2015-08-16 01:37:08 +0000 | |||
3 | +++ src/app/webbrowser/Browser.qml 2015-08-18 13:59:06 +0000 | |||
4 | @@ -830,7 +830,6 @@ | |||
5 | 830 | browser.openUrlInNewTab(url, true) | 830 | browser.openUrlInNewTab(url, true) |
6 | 831 | done() | 831 | done() |
7 | 832 | } | 832 | } |
8 | 833 | onHistoryEntryRemoved: browser.historyModel.removeEntryByUrl(url) | ||
9 | 834 | onNewTabRequested: browser.openUrlInNewTab("", true) | 833 | onNewTabRequested: browser.openUrlInNewTab("", true) |
10 | 835 | onDone: historyViewLoader.active = false | 834 | onDone: historyViewLoader.active = false |
11 | 836 | } | 835 | } |
12 | 837 | 836 | ||
13 | === modified file 'src/app/webbrowser/HistoryViewWide.qml' | |||
14 | --- src/app/webbrowser/HistoryViewWide.qml 2015-08-11 21:05:38 +0000 | |||
15 | +++ src/app/webbrowser/HistoryViewWide.qml 2015-08-18 13:59:06 +0000 | |||
16 | @@ -28,11 +28,29 @@ | |||
17 | 28 | 28 | ||
18 | 29 | signal done() | 29 | signal done() |
19 | 30 | signal historyEntryClicked(url url) | 30 | signal historyEntryClicked(url url) |
20 | 31 | signal historyEntryRemoved(url url) | ||
21 | 32 | signal newTabRequested() | 31 | signal newTabRequested() |
22 | 33 | 32 | ||
23 | 34 | Keys.onLeftPressed: lastVisitDateListView.forceActiveFocus() | 33 | Keys.onLeftPressed: lastVisitDateListView.forceActiveFocus() |
24 | 35 | Keys.onRightPressed: urlsListView.forceActiveFocus() | 34 | Keys.onRightPressed: urlsListView.forceActiveFocus() |
25 | 35 | Keys.onDeletePressed: { | ||
26 | 36 | if (urlsListView.ViewItems.selectMode) { | ||
27 | 37 | internal.removeSelected() | ||
28 | 38 | } else { | ||
29 | 39 | if (urlsListView.activeFocus) { | ||
30 | 40 | historyViewWide.historyModel.removeEntryByUrl(urlsListView.currentItem.url) | ||
31 | 41 | if (urlsListView.count == 0) { | ||
32 | 42 | lastVisitDateListView.currentIndex = 0 | ||
33 | 43 | } | ||
34 | 44 | } else { | ||
35 | 45 | if (lastVisitDateListView.currentIndex == 0) { | ||
36 | 46 | historyViewWide.historyModel.clearAll() | ||
37 | 47 | } else { | ||
38 | 48 | historyViewWide.historyModel.removeEntriesByDate(lastVisitDateListView.currentItem.lastVisitDate) | ||
39 | 49 | lastVisitDateListView.currentIndex = 0 | ||
40 | 50 | } | ||
41 | 51 | } | ||
42 | 52 | } | ||
43 | 53 | } | ||
44 | 36 | 54 | ||
45 | 37 | onActiveFocusChanged: { | 55 | onActiveFocusChanged: { |
46 | 38 | if (activeFocus) { | 56 | if (activeFocus) { |
47 | @@ -227,11 +245,9 @@ | |||
48 | 227 | } | 245 | } |
49 | 228 | 246 | ||
50 | 229 | onRemoved: { | 247 | onRemoved: { |
53 | 230 | if (urlsListView.count == 1) { | 248 | historyViewWide.historyModel.removeEntryByUrl(model.url) |
54 | 231 | historyViewWide.historyEntryRemoved(model.url) | 249 | if (urlsListView.count == 0) { |
55 | 232 | lastVisitDateListView.currentIndex = 0 | 250 | lastVisitDateListView.currentIndex = 0 |
56 | 233 | } else { | ||
57 | 234 | historyViewWide.historyEntryRemoved(model.url) | ||
58 | 235 | } | 251 | } |
59 | 236 | } | 252 | } |
60 | 237 | 253 | ||
61 | @@ -311,19 +327,7 @@ | |||
62 | 311 | iconName: "select" | 327 | iconName: "select" |
63 | 312 | text: i18n.tr("Select all") | 328 | text: i18n.tr("Select all") |
64 | 313 | 329 | ||
78 | 314 | onClicked: { | 330 | onClicked: internal.toggleSelectAll() |
66 | 315 | if (urlsListView.ViewItems.selectedIndices.length === urlsListView.count) { | ||
67 | 316 | urlsListView.ViewItems.selectedIndices = [] | ||
68 | 317 | } else { | ||
69 | 318 | var indices = [] | ||
70 | 319 | for (var i = 0; i < urlsListView.count; ++i) { | ||
71 | 320 | indices.push(i) | ||
72 | 321 | } | ||
73 | 322 | urlsListView.ViewItems.selectedIndices = indices | ||
74 | 323 | } | ||
75 | 324 | |||
76 | 325 | urlsListView.forceActiveFocus() | ||
77 | 326 | } | ||
79 | 327 | } | 331 | } |
80 | 328 | 332 | ||
81 | 329 | ToolbarAction { | 333 | ToolbarAction { |
82 | @@ -342,24 +346,7 @@ | |||
83 | 342 | iconName: "delete" | 346 | iconName: "delete" |
84 | 343 | text: i18n.tr("Delete") | 347 | text: i18n.tr("Delete") |
85 | 344 | enabled: urlsListView.ViewItems.selectedIndices.length > 0 | 348 | enabled: urlsListView.ViewItems.selectedIndices.length > 0 |
104 | 345 | onClicked: { | 349 | onClicked: internal.removeSelected() |
87 | 346 | var indices = urlsListView.ViewItems.selectedIndices | ||
88 | 347 | var urls = [] | ||
89 | 348 | for (var i in indices) { | ||
90 | 349 | urls.push(urlsListView.model.get(indices[i])["url"]) | ||
91 | 350 | } | ||
92 | 351 | |||
93 | 352 | if (urlsListView.count == urls.length) { | ||
94 | 353 | lastVisitDateListView.currentIndex = 0 | ||
95 | 354 | } | ||
96 | 355 | |||
97 | 356 | urlsListView.ViewItems.selectMode = false | ||
98 | 357 | for (var j in urls) { | ||
99 | 358 | historyViewWide.historyEntryRemoved(urls[j]) | ||
100 | 359 | } | ||
101 | 360 | |||
102 | 361 | lastVisitDateListView.forceActiveFocus() | ||
103 | 362 | } | ||
105 | 363 | } | 350 | } |
106 | 364 | 351 | ||
107 | 365 | ListItems.ThinDivider { | 352 | ListItems.ThinDivider { |
108 | @@ -415,4 +402,41 @@ | |||
109 | 415 | } | 402 | } |
110 | 416 | } | 403 | } |
111 | 417 | } | 404 | } |
112 | 405 | |||
113 | 406 | QtObject { | ||
114 | 407 | id: internal | ||
115 | 408 | |||
116 | 409 | function toggleSelectAll() { | ||
117 | 410 | if (urlsListView.ViewItems.selectedIndices.length === urlsListView.count) { | ||
118 | 411 | urlsListView.ViewItems.selectedIndices = [] | ||
119 | 412 | } else { | ||
120 | 413 | var indices = [] | ||
121 | 414 | for (var i = 0; i < urlsListView.count; ++i) { | ||
122 | 415 | indices.push(i) | ||
123 | 416 | } | ||
124 | 417 | urlsListView.ViewItems.selectedIndices = indices | ||
125 | 418 | } | ||
126 | 419 | |||
127 | 420 | urlsListView.forceActiveFocus() | ||
128 | 421 | } | ||
129 | 422 | |||
130 | 423 | function removeSelected() { | ||
131 | 424 | var indices = urlsListView.ViewItems.selectedIndices | ||
132 | 425 | var urls = [] | ||
133 | 426 | for (var i in indices) { | ||
134 | 427 | urls.push(urlsListView.model.get(indices[i])["url"]) | ||
135 | 428 | } | ||
136 | 429 | |||
137 | 430 | if (urlsListView.count == urls.length) { | ||
138 | 431 | lastVisitDateListView.currentIndex = 0 | ||
139 | 432 | } | ||
140 | 433 | |||
141 | 434 | urlsListView.ViewItems.selectMode = false | ||
142 | 435 | for (var j in urls) { | ||
143 | 436 | historyViewWide.historyModel.removeEntryByUrl(urls[j]) | ||
144 | 437 | } | ||
145 | 438 | |||
146 | 439 | lastVisitDateListView.forceActiveFocus() | ||
147 | 440 | } | ||
148 | 441 | } | ||
149 | 418 | } | 442 | } |
150 | 419 | 443 | ||
151 | === modified file 'src/app/webbrowser/history-model.cpp' | |||
152 | --- src/app/webbrowser/history-model.cpp 2015-07-14 22:16:41 +0000 | |||
153 | +++ src/app/webbrowser/history-model.cpp 2015-08-18 13:59:06 +0000 | |||
154 | @@ -309,6 +309,24 @@ | |||
155 | 309 | } | 309 | } |
156 | 310 | 310 | ||
157 | 311 | /*! | 311 | /*! |
158 | 312 | Remove all urls last visited in a given DATE from the history model. | ||
159 | 313 | */ | ||
160 | 314 | void HistoryModel::removeEntriesByDate(const QDate& date) | ||
161 | 315 | { | ||
162 | 316 | if (!date.isValid()) { | ||
163 | 317 | return; | ||
164 | 318 | } | ||
165 | 319 | |||
166 | 320 | for (int i = m_entries.count() - 1; i >= 0; --i) { | ||
167 | 321 | if (m_entries.at(i).lastVisit.toLocalTime().date() == date) { | ||
168 | 322 | removeByIndex(i); | ||
169 | 323 | } | ||
170 | 324 | } | ||
171 | 325 | removeEntriesFromDatabaseByDate(date); | ||
172 | 326 | Q_EMIT rowCountChanged(); | ||
173 | 327 | } | ||
174 | 328 | |||
175 | 329 | /*! | ||
176 | 312 | Remove all urls from a given DOMAIN from the history model. | 330 | Remove all urls from a given DOMAIN from the history model. |
177 | 313 | */ | 331 | */ |
178 | 314 | void HistoryModel::removeEntriesByDomain(const QString& domain) | 332 | void HistoryModel::removeEntriesByDomain(const QString& domain) |
179 | @@ -396,6 +414,19 @@ | |||
180 | 396 | query.exec(); | 414 | query.exec(); |
181 | 397 | } | 415 | } |
182 | 398 | 416 | ||
183 | 417 | void HistoryModel::removeEntriesFromDatabaseByDate(const QDate& date) | ||
184 | 418 | { | ||
185 | 419 | QMutexLocker ml(&m_dbMutex); | ||
186 | 420 | QSqlQuery query(m_database); | ||
187 | 421 | static QString deleteStatement = QLatin1String("DELETE FROM history WHERE lastVisit BETWEEN ? AND ?;"); | ||
188 | 422 | query.prepare(deleteStatement); | ||
189 | 423 | QDateTime dateTime = QDateTime(date); | ||
190 | 424 | query.addBindValue(dateTime.toTime_t()); | ||
191 | 425 | dateTime.setTime(QTime(23, 59, 59, 999)); | ||
192 | 426 | query.addBindValue(dateTime.toTime_t()); | ||
193 | 427 | query.exec(); | ||
194 | 428 | } | ||
195 | 429 | |||
196 | 399 | void HistoryModel::removeEntriesFromDatabaseByDomain(const QString& domain) | 430 | void HistoryModel::removeEntriesFromDatabaseByDomain(const QString& domain) |
197 | 400 | { | 431 | { |
198 | 401 | QMutexLocker ml(&m_dbMutex); | 432 | QMutexLocker ml(&m_dbMutex); |
199 | 402 | 433 | ||
200 | === modified file 'src/app/webbrowser/history-model.h' | |||
201 | --- src/app/webbrowser/history-model.h 2015-07-14 22:16:41 +0000 | |||
202 | +++ src/app/webbrowser/history-model.h 2015-08-18 13:59:06 +0000 | |||
203 | @@ -62,6 +62,7 @@ | |||
204 | 62 | 62 | ||
205 | 63 | Q_INVOKABLE int add(const QUrl& url, const QString& title, const QUrl& icon); | 63 | Q_INVOKABLE int add(const QUrl& url, const QString& title, const QUrl& icon); |
206 | 64 | Q_INVOKABLE void removeEntryByUrl(const QUrl& url); | 64 | Q_INVOKABLE void removeEntryByUrl(const QUrl& url); |
207 | 65 | Q_INVOKABLE void removeEntriesByDate(const QDate& date); | ||
208 | 65 | Q_INVOKABLE void removeEntriesByDomain(const QString& domain); | 66 | Q_INVOKABLE void removeEntriesByDomain(const QString& domain); |
209 | 66 | Q_INVOKABLE void clearAll(); | 67 | Q_INVOKABLE void clearAll(); |
210 | 67 | Q_INVOKABLE void hide(const QUrl& url); | 68 | Q_INVOKABLE void hide(const QUrl& url); |
211 | @@ -99,6 +100,7 @@ | |||
212 | 99 | void updateExistingEntryInDatabase(const HistoryEntry& entry); | 100 | void updateExistingEntryInDatabase(const HistoryEntry& entry); |
213 | 100 | void removeEntryFromDatabaseByUrl(const QUrl& url); | 101 | void removeEntryFromDatabaseByUrl(const QUrl& url); |
214 | 101 | void removeEntryFromHiddenDatabaseByUrl(const QUrl& url); | 102 | void removeEntryFromHiddenDatabaseByUrl(const QUrl& url); |
215 | 103 | void removeEntriesFromDatabaseByDate(const QDate& date); | ||
216 | 102 | void removeEntriesFromDatabaseByDomain(const QString& domain); | 104 | void removeEntriesFromDatabaseByDomain(const QString& domain); |
217 | 103 | void clearDatabase(); | 105 | void clearDatabase(); |
218 | 104 | }; | 106 | }; |
219 | 105 | 107 | ||
220 | === modified file 'tests/unittests/history-model/tst_HistoryModelTests.cpp' | |||
221 | --- tests/unittests/history-model/tst_HistoryModelTests.cpp 2015-04-15 13:27:23 +0000 | |||
222 | +++ tests/unittests/history-model/tst_HistoryModelTests.cpp 2015-08-18 13:59:06 +0000 | |||
223 | @@ -256,6 +256,17 @@ | |||
224 | 256 | QCOMPARE(model->rowCount(), 0); | 256 | QCOMPARE(model->rowCount(), 0); |
225 | 257 | } | 257 | } |
226 | 258 | 258 | ||
227 | 259 | void shouldRemoveByDate() | ||
228 | 260 | { | ||
229 | 261 | QCOMPARE(model->add(QUrl("http://example.org/"), "Example Domain", QUrl()), 1); | ||
230 | 262 | QCOMPARE(model->rowCount(), 1); | ||
231 | 263 | QCOMPARE(model->add(QUrl("http://example.com/"), "Example Domain", QUrl()), 1); | ||
232 | 264 | QCOMPARE(model->rowCount(), 2); | ||
233 | 265 | |||
234 | 266 | model->removeEntriesByDate(QDate::currentDate()); | ||
235 | 267 | QCOMPARE(model->rowCount(), 0); | ||
236 | 268 | } | ||
237 | 269 | |||
238 | 259 | void shouldRemoveByDomain() | 270 | void shouldRemoveByDomain() |
239 | 260 | { | 271 | { |
240 | 261 | QCOMPARE(model->add(QUrl("http://example.org/page1"), "Example Domain Page 1", QUrl()), 1); | 272 | QCOMPARE(model->add(QUrl("http://example.org/page1"), "Example Domain Page 1", QUrl()), 1); |
241 | 262 | 273 | ||
242 | === modified file 'tests/unittests/qml/tst_HistoryViewWide.qml' | |||
243 | --- tests/unittests/qml/tst_HistoryViewWide.qml 2015-08-11 16:16:07 +0000 | |||
244 | +++ tests/unittests/qml/tst_HistoryViewWide.qml 2015-08-18 13:59:06 +0000 | |||
245 | @@ -56,12 +56,6 @@ | |||
246 | 56 | signalName: "historyEntryClicked" | 56 | signalName: "historyEntryClicked" |
247 | 57 | } | 57 | } |
248 | 58 | 58 | ||
249 | 59 | SignalSpy { | ||
250 | 60 | id: historyEntryRemovedSpy | ||
251 | 61 | target: historyViewWide | ||
252 | 62 | signalName: "historyEntryRemoved" | ||
253 | 63 | } | ||
254 | 64 | |||
255 | 65 | UbuntuTestCase { | 59 | UbuntuTestCase { |
256 | 66 | name: "HistoryViewWide" | 60 | name: "HistoryViewWide" |
257 | 67 | when: windowShown | 61 | when: windowShown |
258 | @@ -83,7 +77,7 @@ | |||
259 | 83 | mouseRelease(item, center.x + 100, center.y, Qt.LeftButton, Qt.NoModifier, 2000) | 77 | mouseRelease(item, center.x + 100, center.y, Qt.LeftButton, Qt.NoModifier, 2000) |
260 | 84 | } | 78 | } |
261 | 85 | 79 | ||
263 | 86 | function initTestCase() { | 80 | function init() { |
264 | 87 | for (var i = 0; i < 3; ++i) { | 81 | for (var i = 0; i < 3; ++i) { |
265 | 88 | historyMockModel.add("http://example.org/" + i, "Example Domain " + i, "") | 82 | historyMockModel.add("http://example.org/" + i, "Example Domain " + i, "") |
266 | 89 | } | 83 | } |
267 | @@ -92,11 +86,14 @@ | |||
268 | 92 | waitForRendering(urlsList) | 86 | waitForRendering(urlsList) |
269 | 93 | } | 87 | } |
270 | 94 | 88 | ||
271 | 89 | function cleanup() { | ||
272 | 90 | historyMockModel.clearAll() | ||
273 | 91 | } | ||
274 | 92 | |||
275 | 95 | function test_done_button() { | 93 | function test_done_button() { |
276 | 96 | var doneButton = findChild(historyViewWide, "doneButton") | 94 | var doneButton = findChild(historyViewWide, "doneButton") |
277 | 97 | verify(doneButton != null) | 95 | verify(doneButton != null) |
278 | 98 | doneSpy.clear() | 96 | doneSpy.clear() |
279 | 99 | compare(doneSpy.count, 0) | ||
280 | 100 | clickItem(doneButton) | 97 | clickItem(doneButton) |
281 | 101 | compare(doneSpy.count, 1) | 98 | compare(doneSpy.count, 1) |
282 | 102 | } | 99 | } |
283 | @@ -106,8 +103,6 @@ | |||
284 | 106 | verify(newTabButton != null) | 103 | verify(newTabButton != null) |
285 | 107 | doneSpy.clear() | 104 | doneSpy.clear() |
286 | 108 | newTabRequestedSpy.clear() | 105 | newTabRequestedSpy.clear() |
287 | 109 | compare(doneSpy.count, 0) | ||
288 | 110 | compare(newTabRequestedSpy.count, 0) | ||
289 | 111 | clickItem(newTabButton) | 106 | clickItem(newTabButton) |
290 | 112 | compare(newTabRequestedSpy.count, 1) | 107 | compare(newTabRequestedSpy.count, 1) |
291 | 113 | compare(doneSpy.count, 1) | 108 | compare(doneSpy.count, 1) |
292 | @@ -116,7 +111,7 @@ | |||
293 | 116 | function test_history_entry_clicked() { | 111 | function test_history_entry_clicked() { |
294 | 117 | var urlsList = findChild(historyViewWide, "urlsListView") | 112 | var urlsList = findChild(historyViewWide, "urlsListView") |
295 | 118 | compare(urlsList.count, 3) | 113 | compare(urlsList.count, 3) |
297 | 119 | compare(historyEntryClickedSpy.count, 0) | 114 | historyEntryClickedSpy.clear() |
298 | 120 | clickItem(urlsList.children[0]) | 115 | clickItem(urlsList.children[0]) |
299 | 121 | compare(historyEntryClickedSpy.count, 1) | 116 | compare(historyEntryClickedSpy.count, 1) |
300 | 122 | var args = historyEntryClickedSpy.signalArguments[0] | 117 | var args = historyEntryClickedSpy.signalArguments[0] |
301 | @@ -160,14 +155,14 @@ | |||
302 | 160 | function test_delete_button() { | 155 | function test_delete_button() { |
303 | 161 | var urlsList = findChild(historyViewWide, "urlsListView") | 156 | var urlsList = findChild(historyViewWide, "urlsListView") |
304 | 162 | compare(urlsList.count, 3) | 157 | compare(urlsList.count, 3) |
305 | 158 | var deletedUrl = urlsList.model.get(0).url | ||
306 | 163 | longPressItem(urlsList.children[0]) | 159 | longPressItem(urlsList.children[0]) |
307 | 164 | var deleteButton = findChild(historyViewWide, "deleteButton") | 160 | var deleteButton = findChild(historyViewWide, "deleteButton") |
308 | 165 | compare(historyEntryRemovedSpy.count, 0) | ||
309 | 166 | clickItem(deleteButton) | 161 | clickItem(deleteButton) |
314 | 167 | compare(historyEntryRemovedSpy.count, 1) | 162 | compare(urlsList.count, 2) |
315 | 168 | var args = historyEntryRemovedSpy.signalArguments[0] | 163 | for (var i = 0; i < urlsList.count; ++i) { |
316 | 169 | var entry = urlsList.model.get(0) | 164 | verify(urlsList.model.get(i).url != deletedUrl) |
317 | 170 | compare(args[0], entry.url) | 165 | } |
318 | 171 | } | 166 | } |
319 | 172 | 167 | ||
320 | 173 | function test_keyboard_navigation_between_lists() { | 168 | function test_keyboard_navigation_between_lists() { |
321 | @@ -180,5 +175,38 @@ | |||
322 | 180 | keyClick(Qt.Key_Right) | 175 | keyClick(Qt.Key_Right) |
323 | 181 | verify(urlsList.activeFocus) | 176 | verify(urlsList.activeFocus) |
324 | 182 | } | 177 | } |
325 | 178 | |||
326 | 179 | function test_delete_key_at_urls_list_view() { | ||
327 | 180 | var urlsList = findChild(historyViewWide, "urlsListView") | ||
328 | 181 | keyClick(Qt.Key_Right) | ||
329 | 182 | verify(urlsList.activeFocus) | ||
330 | 183 | compare(urlsList.count, 3) | ||
331 | 184 | keyClick(Qt.Key_Delete) | ||
332 | 185 | compare(urlsList.count, 2) | ||
333 | 186 | } | ||
334 | 187 | |||
335 | 188 | function test_delete_key_at_last_visit_date() { | ||
336 | 189 | var lastVisitDateList = findChild(historyViewWide, "lastVisitDateListView") | ||
337 | 190 | var urlsList = findChild(historyViewWide, "urlsListView") | ||
338 | 191 | keyClick(Qt.Key_Left) | ||
339 | 192 | verify(lastVisitDateList.activeFocus) | ||
340 | 193 | compare(lastVisitDateList.currentIndex, 0) | ||
341 | 194 | keyClick(Qt.Key_Down) | ||
342 | 195 | compare(lastVisitDateList.currentIndex, 1) | ||
343 | 196 | compare(urlsList.count, 3) | ||
344 | 197 | keyClick(Qt.Key_Delete) | ||
345 | 198 | compare(urlsList.count, 0) | ||
346 | 199 | } | ||
347 | 200 | |||
348 | 201 | function test_delete_key_at_all_history() { | ||
349 | 202 | var lastVisitDateList = findChild(historyViewWide, "lastVisitDateListView") | ||
350 | 203 | var urlsList = findChild(historyViewWide, "urlsListView") | ||
351 | 204 | keyClick(Qt.Key_Left) | ||
352 | 205 | verify(lastVisitDateList.activeFocus) | ||
353 | 206 | compare(lastVisitDateList.currentIndex, 0) | ||
354 | 207 | compare(urlsList.count, 3) | ||
355 | 208 | keyClick(Qt.Key_Delete) | ||
356 | 209 | compare(urlsList.count, 0) | ||
357 | 210 | } | ||
358 | 183 | } | 211 | } |
359 | 184 | } | 212 | } |
FAILED: Continuous integration, rev:1140 jenkins. qa.ubuntu. com/job/ webbrowser- app-ci/ 2101/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- vivid-touch/ 3741 jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- amd64-ci/ 855 jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- armhf-ci/ 855 jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- armhf-ci/ 855/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- i386-ci/ 855 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- vivid-mako/ 3090 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 3738 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 3738/artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 22599
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/webbrowser- app-ci/ 2101/rebuild
http://