Merge lp:~dandrader/unity8/fixDragHandleTest into lp:unity8

Proposed by Daniel d'Andrada
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 2101
Merged at revision: 2123
Proposed branch: lp:~dandrader/unity8/fixDragHandleTest
Merge into: lp:unity8
Diff against target: 127 lines (+51/-9)
4 files modified
plugins/Ubuntu/Gestures/DirectionalDragArea.cpp (+8/-2)
tests/qmltests/Components/CMakeLists.txt (+1/-1)
tests/qmltests/Components/tst_DragHandle.qml (+6/-6)
tests/qmltests/Components/tst_DragHandle/SimpleButton.qml (+36/-0)
To merge this branch: bzr merge lp:~dandrader/unity8/fixDragHandleTest
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+280733@code.launchpad.net

Commit message

Make DragHandle tests run again.

- "make tryDragHandle" was missing import paths
- "make testDragHandle" was crashing because of some uitk::Button style issue during
  initialization. So I decided to move entirely away from this extra complexity.

Description of the change

* Are there any related MPs required for this MP to build/function as expected? Please list.
No

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

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

* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
Not applicable

* If you changed the UI, has there been a design review?
Not applicable

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

FAILED: Continuous integration, rev:2100
http://jenkins.qa.ubuntu.com/job/unity8-ci/6965/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5817/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/380/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1676
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/379
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1571
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1571
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/378
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/377
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4495/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5830
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5830/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26118
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/145/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/379
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/379/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26119

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

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

I think it'd be a good idea to fix xvfbtestDragHandle too, I did that here locally by adding

if (pixelsPerMm <= 0)
        pixelsPerMm = 6;

in DirectionalDragArea::itemChange

What do you think?

review: Needs Information
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 16/12/2015 14:46, Albert Astals Cid wrote:
> Review: Needs Information
>
> I think it'd be a good idea to fix xvfbtestDragHandle too, I did that here locally by adding
>
> if (pixelsPerMm <= 0)
> pixelsPerMm = 6;
>
> in DirectionalDragArea::itemChange
>
> What do you think?

I think it's a good solution. Done. Thanks for investigating that crash.

2101. By Daniel d'Andrada

Fix crash in "make xvfbtestDragHandle"

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

FAILED: Continuous integration, rev:2101
http://jenkins.qa.ubuntu.com/job/unity8-ci/6968/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5823/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/383/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1679
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/382
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1574
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1574
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/381
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/380
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4499/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5836
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5836/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26130
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/148/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/382
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/382/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26132

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

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

Not ideal to bypass the SDK crashes but oh well...

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

 * Did CI run pass?
yes, except broken known tests

 * 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 'plugins/Ubuntu/Gestures/DirectionalDragArea.cpp'
2--- plugins/Ubuntu/Gestures/DirectionalDragArea.cpp 2015-11-20 15:01:39 +0000
3+++ plugins/Ubuntu/Gestures/DirectionalDragArea.cpp 2015-12-16 18:29:48 +0000
4@@ -715,8 +715,14 @@
5 value.window->installEventFilter(TouchRegistry::instance());
6
7 // TODO: Handle window->screen() changes (ie window changing screens)
8- qreal pixelsPerMm = value.window->screen()->physicalDotsPerInch() / 25.4;
9- d->setPixelsPerMm(pixelsPerMm);
10+
11+ qreal pixelsPerInch = value.window->screen()->physicalDotsPerInch();
12+ if (pixelsPerInch < 0) {
13+ // It can return garbage when run in a XVFB server (Virtual Framebuffer 'fake' X server)
14+ pixelsPerInch = 72;
15+ }
16+
17+ d->setPixelsPerMm(pixelsPerInch / 25.4);
18 }
19 }
20 }
21
22=== modified file 'tests/qmltests/Components/CMakeLists.txt'
23--- tests/qmltests/Components/CMakeLists.txt 2015-05-19 20:54:12 +0000
24+++ tests/qmltests/Components/CMakeLists.txt 2015-12-16 18:29:48 +0000
25@@ -15,7 +15,7 @@
26 target_link_libraries(DragHandleTestExec UbuntuGesturesQml UbuntuGestures)
27
28 add_unity8_uitest(DragHandle DragHandleTestExec ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures)
29-add_manual_qml_test(. DragHandle IMPORT_PATHS ${UNITY_PLUGINPATH})
30+add_manual_qml_test(. DragHandle IMPORT_PATHS ${UNITY_IMPORT_PATHS})
31
32 ########## tst_EdgeDragEvaluator
33 add_executable(EdgeDragEvaluatorTestExec tst_EdgeDragEvaluator.cpp)
34
35=== modified file 'tests/qmltests/Components/tst_DragHandle.qml'
36--- tests/qmltests/Components/tst_DragHandle.qml 2015-07-15 15:07:19 +0000
37+++ tests/qmltests/Components/tst_DragHandle.qml 2015-12-16 18:29:48 +0000
38@@ -1,5 +1,5 @@
39 /*
40- * Copyright 2013 Canonical Ltd.
41+ * Copyright 2013,2015 Canonical Ltd.
42 *
43 * This program is free software; you can redistribute it and/or modify
44 * it under the terms of the GNU General Public License as published by
45@@ -51,7 +51,7 @@
46 objectName: "baseItem"
47 anchors.fill: parent
48
49- Button {
50+ SimpleButton {
51 visible: root.bidirectional && bidirectionalShowable.fullyHidden
52 text: "bidirectionalShowable.show()"
53 anchors.centerIn: parent
54@@ -169,12 +169,12 @@
55 anchors.margins: units.gu(1)
56 spacing: units.gu(1)
57
58- Button {
59+ SimpleButton {
60 text: root.stretch ? "stretch" : "move"
61 onClicked: { root.stretch = !root.stretch; }
62 }
63
64- Button {
65+ SimpleButton {
66 text: root.hintDisplacement > 0 ? "hint" : "no hint"
67 onClicked: {
68 if (root.hintDisplacement > 0) {
69@@ -185,7 +185,7 @@
70 }
71 }
72
73- Button {
74+ SimpleButton {
75 text: "rotation: " + baseItem.rotation
76 onClicked: {
77 if (baseItem.rotation === 0.0) {
78@@ -196,7 +196,7 @@
79 }
80 }
81
82- Button {
83+ SimpleButton {
84 text: root.bidirectional ? "bidirectional" : "directional"
85 onClicked: { root.bidirectional = !root.bidirectional; }
86 }
87
88=== added file 'tests/qmltests/Components/tst_DragHandle/SimpleButton.qml'
89--- tests/qmltests/Components/tst_DragHandle/SimpleButton.qml 1970-01-01 00:00:00 +0000
90+++ tests/qmltests/Components/tst_DragHandle/SimpleButton.qml 2015-12-16 18:29:48 +0000
91@@ -0,0 +1,36 @@
92+/*
93+ * Copyright 2015 Canonical Ltd.
94+ *
95+ * This program is free software; you can redistribute it and/or modify
96+ * it under the terms of the GNU General Public License as published by
97+ * the Free Software Foundation; version 3.
98+ *
99+ * This program is distributed in the hope that it will be useful,
100+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
101+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
102+ * GNU General Public License for more details.
103+ *
104+ * You should have received a copy of the GNU General Public License
105+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
106+ */
107+
108+import QtQuick 2.4
109+import Ubuntu.Components 1.3
110+
111+
112+Rectangle {
113+ id: root
114+ property alias text: textItem.text
115+ signal clicked()
116+ width: textItem.width + units.gu(1.5)
117+ height: textItem.height + units.gu(1.5)
118+ Text {
119+ id: textItem
120+ anchors.centerIn: parent
121+ font.pixelSize: units.gu(1.5)
122+ }
123+ MouseArea {
124+ anchors.fill: parent
125+ onClicked: root.clicked()
126+ }
127+}

Subscribers

People subscribed via source and target branches