on xenial help sign in
Remove DDA test
commit257b6f0b6d6b3a6b8043a36e035429b8f93aeb05 authorAlbert Astals Cid <albert.astals@canonical.com> dateWed 9 Dec 2015, 11:27 (11 years ago) parent91c46b9
5 files changed−376
tests/plugins/Ubuntu/Gestures/DownwardsLauncher.qml−72 tests/plugins/Ubuntu/Gestures/LeftwardsLauncher.qml−76 tests/plugins/Ubuntu/Gestures/RightwardsLauncher.qml−76 tests/plugins/Ubuntu/Gestures/UpwardsLauncher.qml−76 tests/plugins/Ubuntu/Gestures/tst_DirectionalDragArea.qml−76
tests/plugins/Ubuntu/Gestures/DownwardsLauncher.qmldeleted−72
@@ -1,72 +0,0 @@
1−/*
2− * Copyright (C) 2013 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−
17−import QtQuick 2.4
18−import Ubuntu.Gestures 0.1
19−import Ubuntu.Components 1.3
20−
21−Item {
22−
23− function reset() { launcher.y = -launcher.height }
24−
25− Rectangle {
26− id: launcher
27− color: "blue"
28− width: parent.width
29− height: units.gu(15)
30− x: 0
31− y: followDragArea()
32−
33− function followDragArea() {
34− return dragArea.distance < height ? -height + dragArea.distance : 0
35− }
36− }
37−
38− Rectangle {
39− id: dragAreaRect
40− opacity: dragArea.dragging ? 0.5 : 0.0
41− color: "green"
42− anchors.fill: dragArea
43− }
44−
45− DirectionalDragArea {
46− id: dragArea
47− objectName: "vpDragArea"
48−
49− height: units.gu(5)
50−
51− direction: Direction.Downwards
52−
53− onDraggingChanged: {
54− if (dragging) {
55− launcher.y = Qt.binding(launcher.followDragArea)
56− }
57− }
58−
59− anchors {
60− left: parent.left
61− right: parent.right
62− top: parent.top
63− }
64− }
65−
66− Label {
67− text: "Downwards"
68− anchors.top: parent.top
69− anchors.horizontalCenter: parent.horizontalCenter
70− anchors.topMargin: units.gu(1)
71− }
72−}
tests/plugins/Ubuntu/Gestures/LeftwardsLauncher.qmldeleted−76
@@ -1,76 +0,0 @@
1−/*
2− * Copyright (C) 2013 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−
17−import QtQuick 2.4
18−import Ubuntu.Gestures 0.1
19−import Ubuntu.Components 1.3
20−
21−Item {
22− id: root
23−
24− function reset() { launcher.x = Qt.binding(function(){return root.width;}); }
25−
26− Rectangle {
27− id: launcher
28− color: "blue"
29− width: units.gu(15)
30− height: parent.height
31− x: root.width
32− y: 0
33−
34− function followDragArea() {
35− return dragArea.distance > -width ?
36− root.width + dragArea.distance
37− :
38− root.width - width
39− }
40− }
41−
42− Rectangle {
43− id: dragAreaRect
44− opacity: dragArea.dragging ? 0.5 : 0.0
45− color: "green"
46− anchors.fill: dragArea
47− }
48−
49− DirectionalDragArea {
50− id: dragArea
51− objectName: "hnDragArea"
52−
53− width: units.gu(5)
54−
55− direction: Direction.Leftwards
56−
57− onDraggingChanged: {
58− if (dragging) {
59− launcher.x = Qt.binding(launcher.followDragArea)
60− }
61− }
62−
63− anchors {
64− right: parent.right
65− top: parent.top
66− bottom: parent.bottom
67− }
68− }
69−
70− Label {
71− text: "Leftwards"
72− anchors.right: parent.right
73− anchors.verticalCenter: parent.verticalCenter
74− anchors.rightMargin: units.gu(1)
75− }
76−}
tests/plugins/Ubuntu/Gestures/RightwardsLauncher.qmldeleted−76
@@ -1,76 +0,0 @@
1−/*
2− * Copyright (C) 2013 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−
17−import QtQuick 2.4
18−import Ubuntu.Gestures 0.1
19−import Ubuntu.Components 1.3
20−
21−Item {
22− objectName: "rightwardsLauncher"
23−
24− function reset() { launcher.x = -launcher.width }
25−
26− Rectangle {
27− id: launcher
28− color: "blue"
29− width: units.gu(15)
30− height: parent.height
31− x: followDragArea()
32− y: 0
33−
34− function followDragArea() {
35− return dragArea.distance < width ? -width + dragArea.distance : 0
36− }
37− }
38−
39− Rectangle {
40− id: dragAreaRect
41− opacity: dragArea.dragging ? 0.5 : 0.0
42− color: "green"
43− anchors.fill: dragArea
44− }
45−
46− DirectionalDragArea {
47− id: dragArea
48− objectName: "hpDragArea"
49−
50− // give some room for items to be dynamically stacked right behind him
51− z: 10.0
52−
53− width: units.gu(5)
54−
55− direction: Direction.Rightwards
56−
57− onDraggingChanged: {
58− if (dragging) {
59− launcher.x = Qt.binding(launcher.followDragArea)
60− }
61− }
62−
63− anchors {
64− left: parent.left
65− top: parent.top
66− bottom: parent.bottom
67− }
68− }
69−
70− Label {
71− text: "Rightwards"
72− anchors.left: parent.left
73− anchors.verticalCenter: parent.verticalCenter
74− anchors.leftMargin: units.gu(1)
75− }
76−}
tests/plugins/Ubuntu/Gestures/UpwardsLauncher.qmldeleted−76
@@ -1,76 +0,0 @@
1−/*
2− * Copyright (C) 2013 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−
17−import QtQuick 2.4
18−import Ubuntu.Gestures 0.1
19−import Ubuntu.Components 1.3
20−
21−Item {
22− id: root
23−
24− function reset() { launcher.y = Qt.binding(function(){return root.height;}); }
25−
26− Rectangle {
27− id: launcher
28− color: "blue"
29− width: parent.width
30− height: units.gu(15)
31− x: 0
32− y: root.height
33−
34− function followDragArea() {
35− return dragArea.distance > -height ?
36− root.height + dragArea.distance
37− :
38− root.height - height
39− }
40− }
41−
42− Rectangle {
43− id: dragAreaRect
44− opacity: dragArea.dragging ? 0.5 : 0.0
45− color: "green"
46− anchors.fill: dragArea
47− }
48−
49− DirectionalDragArea {
50− id: dragArea
51− objectName: "vnDragArea"
52−
53− height: units.gu(5)
54−
55− direction: Direction.Upwards
56−
57− onDraggingChanged: {
58− if (dragging) {
59− launcher.y = Qt.binding(launcher.followDragArea)
60− }
61− }
62−
63− anchors {
64− left: parent.left
65− right: parent.right
66− bottom: parent.bottom
67− }
68− }
69−
70− Label {
71− text: "Upwards"
72− anchors.bottom: parent.bottom
73− anchors.horizontalCenter: parent.horizontalCenter
74− anchors.bottomMargin: units.gu(1)
75− }
76−}
tests/plugins/Ubuntu/Gestures/tst_DirectionalDragArea.qmldeleted−76
@@ -1,76 +0,0 @@
1−/*
2− * Copyright (C) 2013,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−
17−import QtQuick 2.4
18−import Ubuntu.Components 1.3
19−import Unity.Test 0.1
20−
21−Rectangle {
22− width: units.gu(60)
23− height: units.gu(60)
24− color: "white"
25−
26− Binding {
27− target: MouseTouchAdaptor
28− property: "enabled"
29− value: true
30− }
31−
32− MouseArea {
33− id: mouseArea
34− objectName: "mouseArea"
35− anchors.fill: parent
36− onClicked: {
37− hpLauncher.reset()
38− hnLauncher.reset()
39− vpLauncher.reset()
40− vnLauncher.reset()
41− }
42− }
43−
44− Item {
45− id: baseItem
46− objectName: "baseItem"
47− width: parent.width
48− height: parent.height
49−
50− // NB: Do not anchor it as we will move it programmatically from the test
51− RightwardsLauncher {
52− id: hpLauncher;
53− width: parent.width
54− height: parent.height
55− }
56−
57− LeftwardsLauncher { id: hnLauncher; anchors.fill: parent }
58− DownwardsLauncher { id: vpLauncher; anchors.fill: parent }
59− UpwardsLauncher { id: vnLauncher; anchors.fill: parent }
60− }
61−
62− Button {
63− anchors.bottom: parent.bottom
64− anchors.left: parent.left
65− anchors.margins: units.gu(1)
66−
67− text: "rotation: " + baseItem.rotation
68− onClicked: {
69− if (baseItem.rotation === 0.0) {
70− baseItem.rotation = 90.0
71− } else {
72− baseItem.rotation = 0.0
73− }
74− }
75− }
76−}