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
=== modified file 'plugins/Ubuntu/Gestures/DirectionalDragArea.cpp'
--- plugins/Ubuntu/Gestures/DirectionalDragArea.cpp 2015-11-20 15:01:39 +0000
+++ plugins/Ubuntu/Gestures/DirectionalDragArea.cpp 2015-12-16 18:29:48 +0000
@@ -715,8 +715,14 @@
715 value.window->installEventFilter(TouchRegistry::instance());715 value.window->installEventFilter(TouchRegistry::instance());
716716
717 // TODO: Handle window->screen() changes (ie window changing screens)717 // TODO: Handle window->screen() changes (ie window changing screens)
718 qreal pixelsPerMm = value.window->screen()->physicalDotsPerInch() / 25.4;718
719 d->setPixelsPerMm(pixelsPerMm);719 qreal pixelsPerInch = value.window->screen()->physicalDotsPerInch();
720 if (pixelsPerInch < 0) {
721 // It can return garbage when run in a XVFB server (Virtual Framebuffer 'fake' X server)
722 pixelsPerInch = 72;
723 }
724
725 d->setPixelsPerMm(pixelsPerInch / 25.4);
720 }726 }
721 }727 }
722}728}
723729
=== modified file 'tests/qmltests/Components/CMakeLists.txt'
--- tests/qmltests/Components/CMakeLists.txt 2015-05-19 20:54:12 +0000
+++ tests/qmltests/Components/CMakeLists.txt 2015-12-16 18:29:48 +0000
@@ -15,7 +15,7 @@
15target_link_libraries(DragHandleTestExec UbuntuGesturesQml UbuntuGestures)15target_link_libraries(DragHandleTestExec UbuntuGesturesQml UbuntuGestures)
1616
17add_unity8_uitest(DragHandle DragHandleTestExec ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures)17add_unity8_uitest(DragHandle DragHandleTestExec ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures)
18add_manual_qml_test(. DragHandle IMPORT_PATHS ${UNITY_PLUGINPATH})18add_manual_qml_test(. DragHandle IMPORT_PATHS ${UNITY_IMPORT_PATHS})
1919
20########## tst_EdgeDragEvaluator20########## tst_EdgeDragEvaluator
21add_executable(EdgeDragEvaluatorTestExec tst_EdgeDragEvaluator.cpp)21add_executable(EdgeDragEvaluatorTestExec tst_EdgeDragEvaluator.cpp)
2222
=== modified file 'tests/qmltests/Components/tst_DragHandle.qml'
--- tests/qmltests/Components/tst_DragHandle.qml 2015-07-15 15:07:19 +0000
+++ tests/qmltests/Components/tst_DragHandle.qml 2015-12-16 18:29:48 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2013 Canonical Ltd.2 * Copyright 2013,2015 Canonical Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by5 * it under the terms of the GNU General Public License as published by
@@ -51,7 +51,7 @@
51 objectName: "baseItem"51 objectName: "baseItem"
52 anchors.fill: parent52 anchors.fill: parent
5353
54 Button {54 SimpleButton {
55 visible: root.bidirectional && bidirectionalShowable.fullyHidden55 visible: root.bidirectional && bidirectionalShowable.fullyHidden
56 text: "bidirectionalShowable.show()"56 text: "bidirectionalShowable.show()"
57 anchors.centerIn: parent57 anchors.centerIn: parent
@@ -169,12 +169,12 @@
169 anchors.margins: units.gu(1)169 anchors.margins: units.gu(1)
170 spacing: units.gu(1)170 spacing: units.gu(1)
171171
172 Button {172 SimpleButton {
173 text: root.stretch ? "stretch" : "move"173 text: root.stretch ? "stretch" : "move"
174 onClicked: { root.stretch = !root.stretch; }174 onClicked: { root.stretch = !root.stretch; }
175 }175 }
176176
177 Button {177 SimpleButton {
178 text: root.hintDisplacement > 0 ? "hint" : "no hint"178 text: root.hintDisplacement > 0 ? "hint" : "no hint"
179 onClicked: {179 onClicked: {
180 if (root.hintDisplacement > 0) {180 if (root.hintDisplacement > 0) {
@@ -185,7 +185,7 @@
185 }185 }
186 }186 }
187187
188 Button {188 SimpleButton {
189 text: "rotation: " + baseItem.rotation189 text: "rotation: " + baseItem.rotation
190 onClicked: {190 onClicked: {
191 if (baseItem.rotation === 0.0) {191 if (baseItem.rotation === 0.0) {
@@ -196,7 +196,7 @@
196 }196 }
197 }197 }
198198
199 Button {199 SimpleButton {
200 text: root.bidirectional ? "bidirectional" : "directional"200 text: root.bidirectional ? "bidirectional" : "directional"
201 onClicked: { root.bidirectional = !root.bidirectional; }201 onClicked: { root.bidirectional = !root.bidirectional; }
202 }202 }
203203
=== added file 'tests/qmltests/Components/tst_DragHandle/SimpleButton.qml'
--- tests/qmltests/Components/tst_DragHandle/SimpleButton.qml 1970-01-01 00:00:00 +0000
+++ tests/qmltests/Components/tst_DragHandle/SimpleButton.qml 2015-12-16 18:29:48 +0000
@@ -0,0 +1,36 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19
20
21Rectangle {
22 id: root
23 property alias text: textItem.text
24 signal clicked()
25 width: textItem.width + units.gu(1.5)
26 height: textItem.height + units.gu(1.5)
27 Text {
28 id: textItem
29 anchors.centerIn: parent
30 font.pixelSize: units.gu(1.5)
31 }
32 MouseArea {
33 anchors.fill: parent
34 onClicked: root.clicked()
35 }
36}

Subscribers

People subscribed via source and target branches