on xenial help sign in
review comments
commit6d13c4d03708c3a6519c10046a28e107e40f263d authorNick Dedekind <nick.dedekind@canonical.com> dateFri 1 May 2015, 14:21 (11 years ago) parentb170d09
4 files changed+65−64
tests/mocks/Utils/plugin.cpp+12−11 tests/mocks/Utils/plugin.h+1−1 tests/qmltests/Stages/tst_DesktopStage.qml+1−4 tests/qmltests/tst_Shell.qml+51−48
tests/mocks/Utils/plugin.cpp+12−11
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2012 Canonical, Ltd.
2+ * Copyright (C) 2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -20,21 +20,22 @@
2020#include <QQmlContext>
2121#include <QtQuick/QQuickWindow>
2222#include <QDebug>
23−// self
24−#include "plugin.h"
2523
2624// local
27−#include "inputwatcher.h"
28−#include "qlimitproxymodelqml.h"
29−#include "unitysortfilterproxymodelqml.h"
30−#include "relativetimeformatter.h"
31−#include "timeformatter.h"
32−#include "unitymenumodelpaths.h"
33−#include "windowkeysfilter.h"
34−#include "easingcurve.h"
25+#include "plugin.h"
3526#include "windowstatestorage.h"
3627#include "constants.h"
3728
29+// plugin
30+#include <inputwatcher.h>
31+#include <qlimitproxymodelqml.h>
32+#include <unitysortfilterproxymodelqml.h>
33+#include <relativetimeformatter.h>
34+#include <timeformatter.h>
35+#include <unitymenumodelpaths.h>
36+#include <windowkeysfilter.h>
37+#include <easingcurve.h>
38+
3839static QObject *createWindowStateStorage(QQmlEngine *engine, QJSEngine *scriptEngine)
3940{
4041 Q_UNUSED(engine)
tests/mocks/Utils/plugin.h+1−1
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2012 Canonical, Ltd.
2+ * Copyright (C) 2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
tests/qmltests/Stages/tst_DesktopStage.qml+1−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013,2014 Canonical, Ltd.
2+ * Copyright (C) 2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -95,9 +95,6 @@ Rectangle {
9595
9696 property Item desktopStage: desktopStageLoader.status === Loader.Ready ? desktopStageLoader.item : null
9797
98− function init() {
99− }
100−
10198 function cleanup() {
10299 desktopStageLoader.itemDestroyed = false;
103100 desktopStageLoader.active = false;
tests/qmltests/tst_Shell.qml+51−48
@@ -137,62 +137,66 @@ Rectangle {
137137 }
138138 }
139139
140− Rectangle {
140+ Flickable {
141141 id: controls
142− color: "darkgrey"
143− width: units.gu(30)
142+ contentHeight: controlRect.height
143+
144144 anchors.top: root.top
145145 anchors.bottom: root.bottom
146146 anchors.right: root.right
147+ width: units.gu(30)
148+
149+ Rectangle {
150+ id: controlRect
151+ anchors { left: parent.left; right: parent.right }
152+ color: "darkgrey"
153+ height: childrenRect.height + units.gu(2)
154+
155+ Column {
156+ anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
157+ spacing: units.gu(1)
158+
159+ Button {
160+ text: "Show Greeter"
161+ activeFocusOnPress: false
162+ onClicked: {
163+ if (shellLoader.status !== Loader.Ready)
164+ return;
147165
148− Column {
149− anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
150− spacing: units.gu(1)
151− Button {
152− text: "Show Greeter"
153− activeFocusOnPress: false
154− onClicked: {
155− if (shellLoader.status !== Loader.Ready)
156− return;
157−
158− var greeter = testCase.findChild(shellLoader.item, "greeter");
159− if (!greeter.shown) {
160− LightDM.Greeter.showGreeter();
166+ var greeter = testCase.findChild(shellLoader.item, "greeter");
167+ if (!greeter.shown) {
168+ LightDM.Greeter.showGreeter();
169+ }
161170 }
162171 }
163− }
164− ListItem.ItemSelector {
165− anchors { left: parent.left; right: parent.right }
166− activeFocusOnPress: false
167− text: "LightDM mock mode"
168− model: ["single", "single-passphrase", "single-pin", "full"]
169− onSelectedIndexChanged: {
170− shellLoader.active = false;
171− LightDM.Greeter.mockMode = model[selectedIndex];
172− LightDM.Users.mockMode = model[selectedIndex];
173− shellLoader.active = true;
172+ ListItem.ItemSelector {
173+ anchors { left: parent.left; right: parent.right }
174+ activeFocusOnPress: false
175+ text: "LightDM mock mode"
176+ model: ["single", "single-passphrase", "single-pin", "full"]
177+ onSelectedIndexChanged: {
178+ shellLoader.active = false;
179+ LightDM.Greeter.mockMode = model[selectedIndex];
180+ LightDM.Users.mockMode = model[selectedIndex];
181+ shellLoader.active = true;
182+ }
174183 }
175− }
176− ListItem.ItemSelector {
177− anchors { left: parent.left; right: parent.right }
178− activeFocusOnPress: false
179− text: "Size"
180− model: ["phone", "tablet", "desktop"]
181− onSelectedIndexChanged: {
182− shellLoader.active = false;
183− shellLoader.state = model[selectedIndex];
184− shellLoader.active = true;
184+ ListItem.ItemSelector {
185+ anchors { left: parent.left; right: parent.right }
186+ activeFocusOnPress: false
187+ text: "Size"
188+ model: ["phone", "tablet", "desktop"]
189+ onSelectedIndexChanged: {
190+ shellLoader.active = false;
191+ shellLoader.state = model[selectedIndex];
192+ shellLoader.active = true;
193+ }
194+ }
195+ MouseTouchEmulationCheckbox {
196+ id: mouseEmulation
197+ checked: true
198+ color: "white"
185199 }
186− }
187− MouseTouchEmulationCheckbox {
188− id: mouseEmulation
189− checked: true
190− color: "white"
191− }
192−
193− Column {
194− anchors { left: parent.left; right: parent.right }
195− spacing: units.gu(1)
196200
197201 Label { text: "Applications"; font.bold: true }
198202
@@ -281,7 +285,6 @@ Rectangle {
281285 }
282286
283287 function cleanup() {
284− mouseEmulation.checked = true;
285288 tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
286289 tearDown();
287290 }