Merge lp:~diegosarmentero/unity8/app-error-handling into lp:unity8

Proposed by Diego Sarmentero
Status: Merged
Approved by: Michał Sawicz
Approved revision: 342
Merged at revision: 351
Proposed branch: lp:~diegosarmentero/unity8/app-error-handling
Merge into: lp:unity8
Diff against target: 123 lines (+62/-2)
3 files modified
Dash/Apps/AppPreview.qml (+4/-0)
tests/mocks/Ubuntu/DownloadDaemonListener/MockDownloadTracker.cpp (+5/-0)
tests/qmltests/Dash/Apps/tst_AppPreview.qml (+53/-2)
To merge this branch: bzr merge lp:~diegosarmentero/unity8/app-error-handling
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michał Sawicz Approve
Roberto Alsina (community) Approve
Review via email: mp+187240@code.launchpad.net

Commit message

- Handling error signal from the DownloadTracker plugin (BUG: #1229744).

Description of the change

When the DownloadManager finds an error a signal is emitted to the DownloadTracker, and this one propagate that signal. AppPreview will take the error signal and trigger the proper action in the scope.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:341
http://jenkins.qa.ubuntu.com/job/unity8-ci/1098/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/3929
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/1508
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/1838
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/122
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1099
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1099/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1098
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/261
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-i386/3992
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-i386/3992/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/1510
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/1510/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/1276
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/1287

Click here to trigger a rebuild:
http://s-jenkins:8080/job/unity8-ci/1098/rebuild

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:342
http://jenkins.qa.ubuntu.com/job/unity8-ci/1123/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/4010
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/1619
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/1870
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/146
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1123
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1123/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1122
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/326
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-i386/4102
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-i386/4102/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/1621
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/1621/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/1360
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/1372

Click here to trigger a rebuild:
http://s-jenkins:8080/job/unity8-ci/1123/rebuild

review: Approve (continuous-integration)
Revision history for this message
Roberto Alsina (ralsina) :
review: Approve
Revision history for this message
Michał Sawicz (saviq) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/unity8-autolanding/492/
Executed test runs:
    SUCCESS: http://s-jenkins:8080/job/generic-cleanup-mbs/2481
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/4032
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/1645
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/1881/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-autolanding/78
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-autolanding/496
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-autolanding/496/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-autolanding/497
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/344
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-i386/4128
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-i386/4128/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/1647
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/1647/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/1380
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/1392

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Dash/Apps/AppPreview.qml'
2--- Dash/Apps/AppPreview.qml 2013-09-05 10:02:00 +0000
3+++ Dash/Apps/AppPreview.qml 2013-09-25 19:59:58 +0000
4@@ -110,6 +110,10 @@
5 onFinished: {
6 root.previewData.execute(progressBar.model[0].id, { })
7 }
8+
9+ onError: {
10+ root.previewData.execute(progressBar.model[1].id, { "error": error });
11+ }
12 }
13
14 }
15
16=== modified file 'tests/mocks/Ubuntu/DownloadDaemonListener/MockDownloadTracker.cpp'
17--- tests/mocks/Ubuntu/DownloadDaemonListener/MockDownloadTracker.cpp 2013-08-13 08:50:50 +0000
18+++ tests/mocks/Ubuntu/DownloadDaemonListener/MockDownloadTracker.cpp 2013-09-25 19:59:58 +0000
19@@ -63,5 +63,10 @@
20 if(!m_service.isEmpty() && !m_dbusPath.isEmpty()) {
21 m_active = true;
22 Q_EMIT serviceReadyChanged(m_active);
23+ if(m_dbusPath == "finish") {
24+ Q_EMIT finished("downloadComplete");
25+ }else if(m_dbusPath == "error") {
26+ Q_EMIT error("DOWNLOAD ERROR");
27+ }
28 }
29 }
30
31=== modified file 'tests/qmltests/Dash/Apps/tst_AppPreview.qml'
32--- tests/qmltests/Dash/Apps/tst_AppPreview.qml 2013-08-19 16:55:28 +0000
33+++ tests/qmltests/Dash/Apps/tst_AppPreview.qml 2013-09-25 19:59:58 +0000
34@@ -45,6 +45,8 @@
35 ["Unity User", 10, "10/02/2013", root.commentary],
36 ]
37 }
38+ QtObject { id: showProgress; property bool value: true }
39+ QtObject { id: progressSource; property string value: "service" }
40
41 QtObject {
42 id: data
43@@ -66,8 +68,30 @@
44 ]
45 }
46
47+ QtObject {
48+ id: dataProgress
49+ property string title: "Unity App"
50+ property string appIcon: "fake_image.png"
51+ property string description: "This is an Application description"
52+ property real rating: rating.value
53+ property int numRatings: reviews.value
54+ property var execute: root.fake_call
55+ property var infoMap: {
56+ "show_progressbar": showProgress,
57+ "more-screenshots": screenshots,
58+ "rated": rated,
59+ "comments": comments,
60+ "progressbar_source": progressSource
61+ }
62+ property var actions: [
63+ { "id": 123, "displayName": "action1" },
64+ { "id": 456, "displayName": "action2" },
65+ { "id": 789, "displayName": "action3" },
66+ ]
67+ }
68+
69 function fake_call(id, data){
70- root.calls[root.calls.length] = id;
71+ root.calls[root.calls.length] = [id, data];
72 }
73
74 // The component under test
75@@ -89,6 +113,7 @@
76 reviewField.focus = false;
77 reviewField.text = "";
78 data.rating = rating.value;
79+ dataProgress.infoMap["progressbar_source"].value = "service";
80 }
81
82 function test_actions() {
83@@ -102,7 +127,7 @@
84
85 var actions = data.actions;
86 for(var i = 0; i < actions.length; i++) {
87- compare(root.calls[i], actions[i].id, "Id of action not found.");
88+ compare(root.calls[i][0], actions[i].id, "Id of action not found.");
89 }
90 }
91
92@@ -162,5 +187,31 @@
93 verify(buttons.visible == true);
94 }
95
96+ function test_progress_show() {
97+ appPreview.previewData = dataProgress;
98+ var progress = findChild(appPreview, "progressBar");
99+ verify(progress.visible == true);
100+ }
101+
102+ function test_progress_download_finish() {
103+ appPreview.previewData = dataProgress;
104+ var progress = findChild(appPreview, "progressBar");
105+ dataProgress.infoMap["progressbar_source"].value = "finish";
106+
107+ var actions = dataProgress.actions;
108+ compare(root.calls[0][0], actions[0].id, "Id of action not found.");
109+ compare(root.calls[0][1], {}, "Data of action not found.");
110+ }
111+
112+ function test_progress_download_error() {
113+ appPreview.previewData = dataProgress;
114+ var progress = findChild(appPreview, "progressBar");
115+ dataProgress.infoMap["progressbar_source"].value = "error";
116+
117+ var actions = dataProgress.actions;
118+ compare(root.calls[0][0], actions[1].id, "Id of action not found.");
119+ compare(root.calls[0][1], {"error": "DOWNLOAD ERROR"}, "Data of action not found.");
120+ }
121+
122 }
123 }

Subscribers

People subscribed via source and target branches