@@ -0,0 +1,133 @@
2+ * Copyright 2013-2016 Canonical Ltd.
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.
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.
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/>.
18+import QtQuick.Layouts 1.1
19+import Ubuntu.Components 1.3
21+import "../../../qml/Launcher"
22+import Unity.Launcher 0.1
23+import Utils 0.1 // For EdgeBarrierSettings
28+ theme.name: "Ubuntu.Components.Themes.SuruDark"
34+ color: UbuntuColors.graphite // something neither white nor black
44+ lockedVisible: lockedVisibleCheckBox.checked
46+ Component.onCompleted: {
47+ launcher.focus = true
48+ edgeBarrierControls.target = testCase.findChild(this, "edgeBarrierController");
53+ anchors { bottom: parent.bottom; right: parent.right; margins: units.gu(1) }
55+ width: childrenRect.width
59+ id: lockedVisibleCheckBox
63+ text: "Launcher always visible"
69+ Layout.fillWidth: true
75+ MouseTouchEmulationCheckbox {}
77+ EdgeBarrierControls {
78+ id: edgeBarrierControls
79+ text: "Drag here to pull out launcher"
80+ onDragged: { launcher.pushEdge(amount); }
88+ function dragDrawerIntoView() {
89+ var startX = launcher.dragAreaWidth/2;
90+ var startY = launcher.height/2;
93+ startX+units.gu(35), startY);
95+ var drawer = findChild(launcher, "drawer");
98+ // wait until it gets fully extended
99+ // a tryCompare doesn't work since
100+ // compare(-0.000005917593600024418, 0);
101+ // is true and in this case we want exactly 0 or will have pain later on
102+ tryCompareFunction( function(){ return drawer.x === 0; }, true );
103+ tryCompare(launcher, "state", "drawer");
106+ function revealByEdgePush() {
107+ // Place the mouse against the window/screen edge and push beyond the barrier threshold
108+ mouseMove(root, 1, root.height / 2);
109+ launcher.pushEdge(EdgeBarrierSettings.pushThreshold * 1.1);
111+ var panel = findChild(launcher, "launcherPanel");
114+ // wait until it gets fully extended
115+ tryCompare(panel, "x", 0);
116+ tryCompare(launcher, "state", "drawer");
121+ var drawer = findChild(launcher, "drawer");
122+ tryCompare(drawer, "x", -drawer.width);
125+ function test_revealByEdgeDrag() {
126+ dragDrawerIntoView();
129+ function test_revealByEdgePush() {