Merge lp:~cimi/unity8/preview-sharing-fix-broken-binding into lp:unity8

Proposed by Andrea Cimitan
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 2084
Merged at revision: 2125
Proposed branch: lp:~cimi/unity8/preview-sharing-fix-broken-binding
Merge into: lp:unity8
Prerequisite: lp:~stolowski/unity8/shareData-rename
Diff against target: 160 lines (+74/-16)
5 files modified
qml/Dash/Previews/PreviewMediaToolbar.qml (+2/-1)
qml/Dash/Previews/PreviewSharing.qml (+2/-3)
tests/qmltests/CMakeLists.txt (+1/-0)
tests/qmltests/Dash/Previews/tst_PreviewMediaToolbar.qml (+69/-0)
tests/qmltests/Dash/Previews/tst_PreviewSharing.qml (+0/-12)
To merge this branch: bzr merge lp:~cimi/unity8/preview-sharing-fix-broken-binding
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+280875@code.launchpad.net

Commit message

Fix a broken binding

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
from the prerequisite
 * Did you perform an exploratory manual test run of your code change and any related functionality?
y
 * Did you make sure that your branch does not contain spurious tags?
y
 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
n/a
 * If you changed the UI, has there been a design review?
n/a

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

FAILED: Continuous integration, rev:2082
http://jenkins.qa.ubuntu.com/job/unity8-ci/6974/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5851
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/389/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1684
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/387
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1579
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1579
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/386
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/385
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4510
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5862
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5862/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26167
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/150/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/387
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/387/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26168

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Is the problem here is that the visible of PreviewSharing got overwritten when some of the parents changed visibility?

Maybe you can write a test that shows it works now?

review: Needs Information
Revision history for this message
Albert Astals Cid (aacid) wrote :

"Maybe you can write a test that shows it works now?" -> i.e. a test that fails with this patch and works with it

2083. By Andrea Cimitan

Added test

Revision history for this message
Andrea Cimitan (cimi) wrote :

> "Maybe you can write a test that shows it works now?" -> i.e. a test that
> fails with this patch and works with it
added

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

23/23 Test #22: Whitespace .......................***Failed 1.04 sec
/tmp/buildd/unity8-8.11+16.04.20151208.1bzr2084pkg0vivid1714/tests/qmltests/Dash/Previews/tst_PreviewMediaToolbar.qml: multiple new lines at end of file

review: Needs Fixing
2084. By Andrea Cimitan

fix whitespace

Revision history for this message
Andrea Cimitan (cimi) wrote :

> 23/23 Test #22: Whitespace .......................***Failed 1.04 sec
> /tmp/buildd/unity8-8.11+16.04.20151208.1bzr2084pkg0vivid1714/tests/qmltests/Da
> sh/Previews/tst_PreviewMediaToolbar.qml: multiple new lines at end of file
fixed

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2084
http://jenkins.qa.ubuntu.com/job/unity8-ci/7014/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5926
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/429/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1719
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/422
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1614
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1614
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/421
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/420
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4574
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5937
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5937/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26411
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/183/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/427
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/427/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26412

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Code looks good and tests pass.

Is there a way this can be tested in real life or no scope uses this yet?

review: Needs Information
Revision history for this message
Albert Astals Cid (aacid) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes

 * Did CI run pass?
Didn't regress

 * Did you make sure that the branch does not contain spurious tags?
Yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Dash/Previews/PreviewMediaToolbar.qml'
2--- qml/Dash/Previews/PreviewMediaToolbar.qml 2015-10-26 18:32:19 +0000
3+++ qml/Dash/Previews/PreviewMediaToolbar.qml 2016-01-05 09:52:40 +0000
4@@ -23,10 +23,11 @@
5
6 implicitHeight: units.gu(6)
7 color: Qt.rgba(0, 0, 0, 0.8)
8- visible: sharingWidget.visible
9+ visible: sharingWidget.active
10
11 PreviewSharing {
12 id: sharingWidget
13+ objectName: "sharingWidget"
14 anchors {
15 left: parent.left
16 verticalCenter: parent.verticalCenter
17
18=== modified file 'qml/Dash/Previews/PreviewSharing.qml'
19--- qml/Dash/Previews/PreviewSharing.qml 2016-01-05 09:52:40 +0000
20+++ qml/Dash/Previews/PreviewSharing.qml 2016-01-05 09:52:40 +0000
21@@ -24,13 +24,12 @@
22 implicitWidth: button.width
23
24 property var shareData
25+ property alias active: peerPicker.active
26 readonly property bool isUrlExternal: url && url.indexOf("file:///") != 0 && url.indexOf("/") != 0
27 readonly property string contentType: shareData ? shareData["content-type"] : ""
28 readonly property var url: shareData ? shareData["uri"] : ""
29 readonly property Item rootItem: QuickUtils.rootItem(root)
30
31- visible: url != ""
32-
33 AbstractButton {
34 id: button
35 height: units.gu(4)
36@@ -98,7 +97,7 @@
37 parent: rootItem
38 anchors.fill: parent
39 visible: false
40- active: root.visible
41+ active: root.url != ""
42
43 sourceComponent: contentPeerComponent
44 }
45
46=== modified file 'tests/qmltests/CMakeLists.txt'
47--- tests/qmltests/CMakeLists.txt 2015-11-26 16:36:53 +0000
48+++ tests/qmltests/CMakeLists.txt 2016-01-05 09:52:40 +0000
49@@ -38,6 +38,7 @@
50 add_unity8_qmltest(Dash/Previews PreviewHeader)
51 add_unity8_qmltest(Dash/Previews PreviewIconActions)
52 add_unity8_qmltest(Dash/Previews PreviewImageGallery)
53+add_unity8_qmltest(Dash/Previews PreviewMediaToolbar)
54 add_unity8_qmltest(Dash/Previews PreviewPayments)
55 add_unity8_qmltest(Dash/Previews PreviewProgress)
56 add_unity8_qmltest(Dash/Previews PreviewRatingDisplay)
57
58=== added file 'tests/qmltests/Dash/Previews/tst_PreviewMediaToolbar.qml'
59--- tests/qmltests/Dash/Previews/tst_PreviewMediaToolbar.qml 1970-01-01 00:00:00 +0000
60+++ tests/qmltests/Dash/Previews/tst_PreviewMediaToolbar.qml 2016-01-05 09:52:40 +0000
61@@ -0,0 +1,69 @@
62+/*
63+ * Copyright 2014 Canonical Ltd.
64+ *
65+ * This program is free software; you can redistribute it and/or modify
66+ * it under the terms of the GNU General Public License as published by
67+ * the Free Software Foundation; version 3.
68+ *
69+ * This program is distributed in the hope that it will be useful,
70+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
71+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
72+ * GNU General Public License for more details.
73+ *
74+ * You should have received a copy of the GNU General Public License
75+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
76+ */
77+
78+import QtQuick 2.4
79+import QtTest 1.0
80+import Ubuntu.Components 1.3
81+import "../../../../qml/Dash/Previews"
82+import Unity.Test 0.1 as UT
83+
84+Rectangle {
85+ id: root
86+ width: units.gu(40)
87+ height: units.gu(80)
88+ color: "black"
89+
90+ property var shareData: {
91+ "uri": [
92+ "Text here",
93+ "text here 2",
94+ "text here 3"
95+ ],
96+ "content-type": "text"
97+ }
98+
99+ property var shareDataNoUri: {
100+ "uri": "",
101+ "content-type": "text"
102+ }
103+
104+
105+ PreviewMediaToolbar {
106+ id: previewMediaToolbar
107+ anchors { left: parent.left; bottom: parent.bottom; }
108+ shareData: root.shareData
109+ }
110+
111+ UT.UnityTestCase {
112+ name: "PreviewMediaToolbarTest"
113+ when: windowShown
114+
115+ property Item sharingWidget: findChild(previewMediaToolbar, "sharingWidget")
116+
117+ function cleanup() {
118+ previewMediaToolbar.shareData = root.shareData;
119+ }
120+
121+ function test_visible() {
122+ previewMediaToolbar.shareData = shareDataNoUri;
123+ compare(previewMediaToolbar.visible, false);
124+ compare(sharingWidget.visible, false);
125+ previewMediaToolbar.shareData = shareData;
126+ compare(previewMediaToolbar.visible, true);
127+ compare(sharingWidget.visible, true);
128+ }
129+ }
130+}
131
132=== modified file 'tests/qmltests/Dash/Previews/tst_PreviewSharing.qml'
133--- tests/qmltests/Dash/Previews/tst_PreviewSharing.qml 2016-01-05 09:52:40 +0000
134+++ tests/qmltests/Dash/Previews/tst_PreviewSharing.qml 2016-01-05 09:52:40 +0000
135@@ -35,11 +35,6 @@
136 "content-type": "text"
137 }
138
139- property var shareDataNoUri: {
140- "uri": "",
141- "content-type": "text"
142- }
143-
144 PreviewSharing {
145 id: previewSharing
146 anchors { left: parent.left; bottom: parent.bottom; }
147@@ -54,13 +49,6 @@
148
149 function cleanup() {
150 peerPicker.visible = false;
151- previewSharing.shareData = root.shareData;
152- }
153-
154- function test_visible() {
155- compare(previewSharing.visible, true);
156- previewSharing.shareData = shareDataNoUri;
157- compare(previewSharing.visible, false);
158 }
159
160 function test_open_picker() {

Subscribers

People subscribed via source and target branches