on xenial help sign in
merge prereq
commit9e6b4dae812a30ce6a1b1d765395d2e75d3db8af authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 12 Mar 2015, 12:28 (12 years ago) parenta80d9f0eacd201
14 files changed+469−407
src/Dash/main.cpp+2−2 src/MouseTouchAdaptor.cpp+40−4 src/MouseTouchAdaptor.h+18−5 src/main.cpp+2−6 tests/qmltests/CMakeLists.txt−1 tests/qmltests/Panel/tst_Panel.qml+10−2 tests/qmltests/tst_Shell.qml+336−76 tests/qmltests/tst_TabletShell.qml−304 tests/uqmlscene/CMakeLists.txt−1 tests/uqmlscene/main.cpp−4 tests/utils/modules/Unity/Test/CMakeLists.txt+2 tests/utils/modules/Unity/Test/MouseTouchEmulationCheckbox.qml+43 tests/utils/modules/Unity/Test/plugin.cpp+15−2 tests/utils/modules/Unity/Test/qmldir+1
src/Dash/main.cpp+2−2
@@ -98,8 +98,7 @@ int main(int argc, const char *argv[])
9898 // Needed only when manually testing on a desktop.
9999 MouseTouchAdaptor *mouseTouchAdaptor = 0;
100100 if (parser.isSet(mousetouchOption)) {
101− mouseTouchAdaptor = new MouseTouchAdaptor;
102− application->installNativeEventFilter(mouseTouchAdaptor);
101+ mouseTouchAdaptor = MouseTouchAdaptor::instance();
103102 }
104103
105104 QUrl source(::qmlDirectory()+"Dash/DashApplication.qml");
@@ -115,6 +114,7 @@ int main(int argc, const char *argv[])
115114 int result = application->exec();
116115
117116 delete view;
117+ delete mouseTouchAdaptor;
118118 delete application;
119119
120120 return result;
src/MouseTouchAdaptor.cpp+40−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013,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,12 +20,15 @@
2020
2121#include <qpa/qwindowsysteminterface.h>
2222
23−#include <QtGui/QMouseEvent>
24−#include <QtTest/QTest>
23+#include <QCoreApplication>
24+#include <QMouseEvent>
25+#include <QTest>
2526
2627using QTest::QTouchEventSequence;
2728
2829namespace {
30+MouseTouchAdaptor *g_instance = nullptr;
31+
2932Qt::MouseButton translateMouseButton(xcb_button_t detail)
3033{
3134 switch (detail) {
@@ -39,16 +42,36 @@ Qt::MouseButton translateMouseButton(xcb_button_t detail)
3942} // end of anonymous namespace
4043
4144MouseTouchAdaptor::MouseTouchAdaptor()
42− : m_leftButtonIsPressed(false)
45+ : QObject(nullptr), m_leftButtonIsPressed(false), m_enabled(true)
4346{
47+ QCoreApplication::instance()->installNativeEventFilter(this);
48+
4449 m_touchDevice = new QTouchDevice;
4550 m_touchDevice->setType(QTouchDevice::TouchScreen);
4651 QWindowSystemInterface::registerTouchDevice(m_touchDevice);
4752}
4853
54+MouseTouchAdaptor::~MouseTouchAdaptor()
55+{
56+ g_instance = nullptr;
57+}
58+
59+MouseTouchAdaptor* MouseTouchAdaptor::instance()
60+{
61+ if (!g_instance) {
62+ g_instance = new MouseTouchAdaptor;
63+ }
64+
65+ return g_instance;
66+}
67+
4968bool MouseTouchAdaptor::nativeEventFilter(const QByteArray & eventType,
5069 void * message, long * /*result*/)
5170{
71+ if (!m_enabled) {
72+ return false;
73+ }
74+
5275 if (eventType != "xcb_generic_event_t") {
5376 // wrong backend.
5477 qWarning("MouseTouchAdaptor: XCB backend not in use. Adaptor inoperative!");
@@ -151,3 +174,16 @@ QWindow *MouseTouchAdaptor::findQWindowWithXWindowID(WId windowId)
151174 Q_ASSERT(foundWindow);
152175 return foundWindow;
153176}
177+
178+bool MouseTouchAdaptor::enabled() const
179+{
180+ return m_enabled;
181+}
182+
183+void MouseTouchAdaptor::setEnabled(bool value)
184+{
185+ if (value != m_enabled) {
186+ m_enabled = value;
187+ Q_EMIT enabledChanged(value);
188+ }
189+}
src/MouseTouchAdaptor.h+18−5
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013,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
@@ -27,15 +27,26 @@ class QMouseEvent;
2727class QTouchDevice;
2828
2929// Transforms QMouseEvents into single-finger QTouchEvents.
30−class MouseTouchAdaptor : public QAbstractNativeEventFilter {
31−
30+class MouseTouchAdaptor : public QObject, public QAbstractNativeEventFilter {
31+ Q_OBJECT
3232public:
33− MouseTouchAdaptor();
33+ virtual ~MouseTouchAdaptor();
34+
35+ static MouseTouchAdaptor* instance();
3436
3537 // Filters mouse events and posts the equivalent QTouchEvents.
36− virtual bool nativeEventFilter(const QByteArray & eventType, void *message, long *result);
38+ bool nativeEventFilter(const QByteArray & eventType, void *message, long *result) override;
39+
40+ Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
41+
42+ bool enabled() const;
43+ void setEnabled(bool value);
44+
45+Q_SIGNALS:
46+ void enabledChanged(bool value);
3747
3848private:
49+ MouseTouchAdaptor();
3950
4051 bool handleButtonPress(xcb_button_press_event_t *pressEvent);
4152 bool handleButtonRelease(xcb_button_release_event_t *releaseEvent);
@@ -44,6 +55,8 @@ private:
4455
4556 QTouchDevice *m_touchDevice;
4657 bool m_leftButtonIsPressed;
58+
59+ bool m_enabled;
4760};
4861
4962#endif // MOUSE_TOUCH_ADAPTOR_H
src/main.cpp+2−6
@@ -1,8 +1,5 @@
11/*
2− * Copyright (C) 2012-2014 Canonical, Ltd.
3− *
4− * Authors:
5− * Gerry Boland <gerry.boland@canonical.com>
2+ * Copyright (C) 2012-2015 Canonical, Ltd.
63 *
74 * This program is free software; you can redistribute it and/or modify
85 * it under the terms of the GNU General Public License as published by
@@ -130,8 +127,7 @@ Load the testability driver");
130127 // Needed only when manually testing on a desktop.
131128 MouseTouchAdaptor *mouseTouchAdaptor = 0;
132129 if (parser.isSet(mousetouchOption)) {
133− mouseTouchAdaptor = new MouseTouchAdaptor;
134− application->installNativeEventFilter(mouseTouchAdaptor);
130+ mouseTouchAdaptor = MouseTouchAdaptor::instance();
135131 }
136132
137133 QUrl source(::qmlDirectory()+"Shell.qml");
tests/qmltests/CMakeLists.txt−1
@@ -21,7 +21,6 @@ set(qmltest_DEFAULT_PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/
2121
2222add_qml_test(. Shell)
2323add_qml_test(. ShellWithPin)
24−add_qml_test(. TabletShell)
2524add_qml_test(Components Background)
2625add_qml_test(Components Carousel)
2726add_qml_test(Components Dialogs)
tests/qmltests/Panel/tst_Panel.qml+10−2
@@ -17,7 +17,7 @@
1717import QtQuick 2.1
1818import QtQuick.Layouts 1.1
1919import QtTest 1.0
20−import Unity.Test 0.1 as UT
20+import Unity.Test 0.1
2121import Ubuntu.Components 0.1
2222import Unity.Indicators 0.1 as Indicators
2323import Ubuntu.Telephony 0.1 as Telephony
@@ -121,6 +121,14 @@ IndicatorTest {
121121 }
122122 }
123123 }
124+
125+ Rectangle {
126+ Layout.preferredHeight: units.dp(1);
127+ Layout.fillWidth: true;
128+ color: "black"
129+ }
130+
131+ MouseTouchEmulationCheckbox {}
124132 }
125133 }
126134
@@ -129,7 +137,7 @@ IndicatorTest {
129137 phoneNumber: "+447812221111"
130138 }
131139
132− UT.UnityTestCase {
140+ UnityTestCase {
133141 name: "Panel"
134142 when: windowShown
135143
tests/qmltests/tst_Shell.qml+336−76
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013-2014 Canonical, Ltd.
2+ * Copyright (C) 2013-2015 Canonical, Ltd.
33 *
44 * Authors:
55 * Daniel d'Andrada <daniel.dandrada@canonical.com>
@@ -29,14 +29,15 @@ import Unity.Application 0.1
2929import Unity.Connectivity 0.1
3030import Unity.Indicators 0.1
3131import Unity.Notifications 1.0
32−import Unity.Test 0.1 as UT
32+import Unity.Test 0.1
3333import Powerd 0.1
3434
3535import "../../qml"
3636
37−Item {
37+Rectangle {
3838 id: root
39− width: units.gu(60)
39+ color: "grey"
40+ width: units.gu(100) + controls.width
4041 height: units.gu(71)
4142
4243 Component.onCompleted: {
@@ -62,12 +63,37 @@ Item {
6263 }
6364 }
6465
65− Row {
66− anchors.fill: parent
66+ Item {
67+ anchors.left: root.left
68+ anchors.right: controls.left
69+ anchors.top: root.top
70+ anchors.bottom: root.bottom
6771 Loader {
6872 id: shellLoader
6973 focus: true
7074
75+ anchors.centerIn: parent
76+
77+ state: "phone"
78+ states: [
79+ State {
80+ name: "phone"
81+ PropertyChanges {
82+ target: shellLoader
83+ width: units.gu(40)
84+ height: units.gu(71)
85+ }
86+ },
87+ State {
88+ name: "tablet"
89+ PropertyChanges {
90+ target: shellLoader
91+ width: units.gu(100)
92+ height: units.gu(71)
93+ }
94+ }
95+ ]
96+
7197 active: false
7298 property bool itemDestroyed: false
7399 sourceComponent: Component {
@@ -80,43 +106,58 @@ Item {
80106 }
81107 }
82108 }
109+ }
110+
111+ Rectangle {
112+ id: controls
113+ color: "darkgrey"
114+ width: units.gu(30)
115+ anchors.top: root.top
116+ anchors.bottom: root.bottom
117+ anchors.right: root.right
118+
119+ Column {
120+ anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
121+ spacing: units.gu(1)
122+ Row {
123+ anchors { left: parent.left; right: parent.right }
124+ Button {
125+ text: "Show Greeter"
126+ activeFocusOnPress: false
127+ onClicked: {
128+ if (shellLoader.status !== Loader.Ready)
129+ return;
83130
84− Rectangle {
85− color: "darkgrey"
86− width: units.gu(30)
87− height: shellLoader.height
88−
89− Column {
90− anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
91− spacing: units.gu(1)
92− Row {
93− anchors { left: parent.left; right: parent.right }
94− Button {
95− text: "Show Greeter"
96− activeFocusOnPress: false
97− onClicked: {
98− if (shellLoader.status !== Loader.Ready)
99− return;
100−
101− var greeter = testCase.findChild(shellLoader.item, "greeter");
102− if (!greeter.shown) {
103− LightDM.Greeter.showGreeter();
104− }
131+ var greeter = testCase.findChild(shellLoader.item, "greeter");
132+ if (!greeter.shown) {
133+ LightDM.Greeter.showGreeter();
105134 }
106135 }
107136 }
108− ListItem.ItemSelector {
109− anchors { left: parent.left; right: parent.right }
110− activeFocusOnPress: false
111− text: "LightDM mock mode"
112− model: ["single", "single-passphrase", "single-pin"]
113− onSelectedIndexChanged: {
114− shellLoader.active = false;
115− LightDM.Greeter.mockMode = model[selectedIndex];
116− LightDM.Users.mockMode = model[selectedIndex];
117− shellLoader.active = true;
118− }
137+ }
138+ ListItem.ItemSelector {
139+ anchors { left: parent.left; right: parent.right }
140+ activeFocusOnPress: false
141+ text: "LightDM mock mode"
142+ model: ["single", "single-passphrase", "single-pin", "full"]
143+ onSelectedIndexChanged: {
144+ shellLoader.active = false;
145+ LightDM.Greeter.mockMode = model[selectedIndex];
146+ LightDM.Users.mockMode = model[selectedIndex];
147+ shellLoader.active = true;
148+ }
149+ }
150+ ListItem.ItemSelector {
151+ anchors { left: parent.left; right: parent.right }
152+ activeFocusOnPress: false
153+ text: "Size"
154+ model: ["phone", "tablet"]
155+ onSelectedIndexChanged: {
156+ shellLoader.active = false;
157+ shellLoader.state = model[selectedIndex];
158+ shellLoader.active = true;
119159 }
160+ MouseTouchEmulationCheckbox { color: "white" }
120161 }
121162 }
122163 }
@@ -178,7 +219,7 @@ Item {
178219 phoneNumber: "+447812221111"
179220 }
180221
181− UT.UnityTestCase {
222+ UnityTestCase {
182223 id: testCase
183224 name: "Shell"
184225 when: windowShown
@@ -186,20 +227,49 @@ Item {
186227 property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
187228
188229 function init() {
189− tryCompare(shell, "enabled", true); // enabled by greeter when ready
190− shell.indicatorProfile = "phone";
230+ if (shellLoader.active) {
231+ // happens for the very first test function as shell
232+ // is loaded by default
233+ tearDown();
234+ }
191235
192− swipeAwayGreeter();
236+ }
237+
238+ function cleanup() {
239+ tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
240+ tearDown();
241+ }
242+
243+ function loadShell(formFactor) {
244+ shellLoader.state = formFactor;
245+ shellLoader.active = true;
246+ tryCompare(shellLoader, "status", Loader.Ready);
247+ removeTimeConstraintsFromDirectionalDragAreas(shellLoader.item);
248+ tryCompare(shell, "enabled", true); // enabled by greeter when ready
193249
194250 sessionSpy.target = findChild(shell, "greeter")
195251 dashCommunicatorSpy.target = findInvisibleChild(shell, "dashCommunicator");
196252
197253 var launcher = findChild(shell, "launcher");
198254 launcherShowDashHomeSpy.target = launcher;
255+
256+ waitForGreeterToStabilize();
199257 }
200258
201− function cleanup() {
202− tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
259+ function waitForGreeterToStabilize() {
260+ var greeter = findChild(shell, "greeter");
261+ verify(greeter);
262+
263+ var loginList = findChild(greeter, "loginList");
264+ // Only present in WideView
265+ if (loginList) {
266+ var userList = findChild(loginList, "userList");
267+ verify(userList);
268+ tryCompare(userList, "movingInternally", false);
269+ }
270+ }
271+
272+ function tearDown() {
203273 launcherShowDashHomeSpy.target = null;
204274
205275 shellLoader.itemDestroyed = false;
@@ -216,17 +286,17 @@ Item {
216286 // Shell instance gets destroyed.
217287 tryCompare(shellLoader, "itemDestroyed", true);
218288
289+ setLightDMMockMode("single"); // back to the default value
290+
291+ AccountsService.demoEdges = false;
292+
219293 // kill all (fake) running apps
220294 killApps(ApplicationManager);
221295
222296 unlockAllModemsSpy.clear()
223297 LightDM.Greeter.authenticate(""); // reset greeter
224298
225− // reload our test subject to get it in a fresh state once again
226− shellLoader.active = true;
227−
228− tryCompare(shellLoader, "status", Loader.Ready);
229− removeTimeConstraintsFromDirectionalDragAreas(shellLoader.item);
299+ sessionSpy.clear();
230300 }
231301
232302 function killApps() {
@@ -238,6 +308,8 @@ Item {
238308 }
239309
240310 function test_snapDecisionDismissalReturnsFocus() {
311+ loadShell("phone");
312+ swipeAwayGreeter();
241313 var notifications = findChild(shell, "notificationList");
242314 var app = ApplicationManager.startApplication("camera-app");
243315 var stage = findChild(shell, "stage")
@@ -296,19 +368,41 @@ Item {
296368 mockNotificationsModel.append(n)
297369 }
298370
299− function test_leftEdgeDrag_data() {
371+ function test_phoneLeftEdgeDrag_data() {
300372 return [
301− {tag: "without launcher", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true, greeterShown: false},
302− {tag: "with launcher", revealLauncher: true, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true, greeterShown: false},
303− {tag: "small swipe", revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app", launcherHides: false, greeterShown: false},
304− {tag: "long swipe", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true, greeterShown: false},
305− {tag: "small swipe with greeter", revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app", launcherHides: false, greeterShown: true},
306− {tag: "long swipe with greeter", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true, greeterShown: true},
307− {tag: "swipe over dash", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "unity8-dash", launcherHides: false, greeterShown: false},
373+ {tag: "without launcher",
374+ revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
375+ launcherHides: true, greeterShown: false},
376+
377+ {tag: "with launcher",
378+ revealLauncher: true, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
379+ launcherHides: true, greeterShown: false},
380+
381+ {tag: "small swipe",
382+ revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app",
383+ launcherHides: false, greeterShown: false},
384+
385+ {tag: "long swipe",
386+ revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
387+ launcherHides: true, greeterShown: false},
388+
389+ {tag: "small swipe with greeter",
390+ revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app",
391+ launcherHides: false, greeterShown: true},
392+
393+ {tag: "long swipe with greeter",
394+ revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
395+ launcherHides: true, greeterShown: true},
396+
397+ {tag: "swipe over dash",
398+ revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "unity8-dash",
399+ launcherHides: false, greeterShown: false},
308400 ];
309401 }
310402
311− function test_leftEdgeDrag(data) {
403+ function test_phoneLeftEdgeDrag(data) {
404+ loadShell("phone");
405+ swipeAwayGreeter();
312406 dragLauncherIntoView();
313407 tapOnAppIconInLauncher();
314408 waitUntilApplicationWindowIsFullyVisible();
@@ -341,7 +435,32 @@ Item {
341435 compare(animateTimer.nextState, "visible");
342436 }
343437
438+ function test_tabletLeftEdgeDrag_data() {
439+ return [
440+ {tag: "without password", user: "no-password", loggedIn: true, demo: false},
441+ {tag: "with password", user: "has-password", loggedIn: false, demo: false},
442+ {tag: "with demo", user: "has-password", loggedIn: true, demo: true},
443+ ]
444+ }
445+
446+ function test_tabletLeftEdgeDrag(data) {
447+ setLightDMMockMode("full");
448+ loadShell("tablet");
449+
450+ selectUser(data.user)
451+
452+ AccountsService.demoEdges = data.demo
453+ var tutorial = findChild(shell, "tutorial");
454+ tryCompare(tutorial, "running", data.demo);
455+
456+ swipeFromLeftEdge(shell.width * 0.75)
457+ wait(500) // to give time to handle dash() signal from Launcher
458+ confirmLoggedIn(data.loggedIn)
459+ }
460+
344461 function test_suspend() {
462+ loadShell("phone");
463+ swipeAwayGreeter();
345464 var greeter = findChild(shell, "greeter");
346465
347466 // Launch an app from the launcher
@@ -401,6 +520,60 @@ Item {
401520 waitForRendering(greeter);
402521 }
403522
523+ function selectUserAtIndex(i) {
524+ // We could be anywhere in list; find target index to know which direction
525+ var greeter = findChild(shell, "greeter")
526+ var userlist = findChild(greeter, "userList")
527+ if (userlist.currentIndex == i)
528+ keyClick(Qt.Key_Escape) // Reset state if we're not moving
529+ while (userlist.currentIndex != i) {
530+ var next = userlist.currentIndex + 1
531+ if (userlist.currentIndex > i) {
532+ next = userlist.currentIndex - 1
533+ }
534+ tap(findChild(greeter, "username"+next));
535+ tryCompare(userlist, "currentIndex", next)
536+ tryCompare(userlist, "movingInternally", false)
537+ }
538+ }
539+
540+ function selectUser(name) {
541+ // Find index of user with the right name
542+ for (var i = 0; i < LightDM.Users.count; i++) {
543+ if (LightDM.Users.data(i, LightDM.UserRoles.NameRole) == name) {
544+ break
545+ }
546+ }
547+ if (i == LightDM.Users.count) {
548+ fail("Didn't find name")
549+ return -1
550+ }
551+ selectUserAtIndex(i)
552+ return i
553+ }
554+
555+ function clickPasswordInput(isButton) {
556+ var greeter = findChild(shell, "greeter")
557+ tryCompare(greeter, "fullyShown", true);
558+
559+ var passwordMouseArea = findChild(shell, "passwordMouseArea")
560+ tryCompare(passwordMouseArea, "enabled", isButton)
561+
562+ var passwordInput = findChild(shell, "passwordInput")
563+ mouseClick(passwordInput)
564+ }
565+
566+ function confirmLoggedIn(loggedIn) {
567+ var greeter = findChild(shell, "greeter");
568+ tryCompare(greeter, "shown", loggedIn ? false : true);
569+ verify(loggedIn ? sessionSpy.count > 0 : sessionSpy.count === 0);
570+ }
571+
572+ function setLightDMMockMode(mode) {
573+ LightDM.Greeter.mockMode = mode;
574+ LightDM.Users.mockMode = mode;
575+ }
576+
404577 /*
405578 Regression test for bug https://bugs.launchpad.net/touch-preview-images/+bug/1193419
406579
@@ -413,6 +586,8 @@ Item {
413586 - verify the setCurrentScope() D-Bus call to the dash has been called for the correct scope id.
414587 */
415588 function test_minimizingAppTakesToDashApps() {
589+ loadShell("phone");
590+ swipeAwayGreeter();
416591 dragLauncherIntoView();
417592
418593 // Launch an app from the launcher
@@ -433,6 +608,8 @@ Item {
433608 }
434609
435610 function test_showInputMethod() {
611+ loadShell("phone");
612+ swipeAwayGreeter();
436613 var item = findChild(shell, "inputMethod");
437614 var surface = SurfaceManager.inputMethodSurface();
438615
@@ -471,6 +648,8 @@ Item {
471648 }
472649
473650 function test_surfaceLosesActiveFocusWhilePanelIsOpen() {
651+ loadShell("phone");
652+ swipeAwayGreeter();
474653 var app = ApplicationManager.startApplication("dialer-app");
475654 waitUntilAppWindowIsFullyLoaded(app);
476655
@@ -501,28 +680,26 @@ Item {
501680 tryCompare(app.session.surface, "activeFocus", true);
502681 }
503682
504− function test_launchedAppHasActiveFocus() {
505− var dialerApp = ApplicationManager.startApplication("dialer-app");
683+ function test_launchedAppHasActiveFocus_data() {
684+ return [
685+ {tag:"phone", formFactor:"phone"},
686+ {tag:"tablet", formFactor:"tablet"},
687+ ];
688+ }
689+
690+ function test_launchedAppHasActiveFocus(data) {
691+ loadShell(data.formFactor);
692+ swipeAwayGreeter();
693+
694+ var dialerApp = ApplicationManager.startApplication("webbrowser-app");
506695 verify(dialerApp);
507− waitUntilAppSurfaceShowsUp("dialer-app")
696+ waitUntilAppSurfaceShowsUp("webbrowser-app")
508697
509698 verify(dialerApp.session.surface);
510699
511700 tryCompare(dialerApp.session.surface, "activeFocus", true);
512701 }
513702
514− // Wait for the whole UI to settle down
515− function waitForUIToSettle() {
516− var launcher = findChild(shell, "launcherPanel")
517− tryCompareFunction(function() {return launcher.x === 0 || launcher.x === -launcher.width;}, true);
518− if (launcher.x === 0) {
519− mouseClick(shell)
520− }
521− tryCompare(launcher, "x", -launcher.width)
522−
523− waitForRendering(shell)
524− }
525−
526703 function waitUntilAppSurfaceShowsUp(appId) {
527704 var appWindow = findChild(shell, "appWindow_" + appId);
528705 verify(appWindow);
@@ -615,6 +792,8 @@ Item {
615792 }
616793
617794 function test_greeterDoesNotChangeIndicatorProfile() {
795+ loadShell("phone");
796+ swipeAwayGreeter();
618797 var panel = findChild(shell, "panel");
619798 tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile);
620799
@@ -626,6 +805,8 @@ Item {
626805 }
627806
628807 function test_shellProfileChangesReachIndicators() {
808+ loadShell("phone");
809+ swipeAwayGreeter();
629810 var panel = findChild(shell, "panel");
630811
631812 shell.indicatorProfile = "test1";
@@ -642,6 +823,8 @@ Item {
642823 }
643824
644825 function test_focusRequestedHidesGreeter() {
826+ loadShell("phone");
827+ swipeAwayGreeter();
645828 var greeter = findChild(shell, "greeter");
646829
647830 var app = ApplicationManager.startApplication("dialer-app");
@@ -662,6 +845,8 @@ Item {
662845 }
663846
664847 function test_focusRequestedHidesIndicators() {
848+ loadShell("phone");
849+ swipeAwayGreeter();
665850 var indicators = findChild(shell, "indicators");
666851
667852 showIndicators();
@@ -674,6 +859,8 @@ Item {
674859 }
675860
676861 function test_showAndHideGreeterDBusCalls() {
862+ loadShell("phone");
863+ swipeAwayGreeter();
677864 var greeter = findChild(shell, "greeter")
678865 tryCompare(greeter, "shown", false)
679866 waitForRendering(greeter);
@@ -685,6 +872,9 @@ Item {
685872 }
686873
687874 function test_greeterLoginsAutomaticallyWhenNoPasswordSet() {
875+ loadShell("phone");
876+ swipeAwayGreeter();
877+
688878 sessionSpy.clear();
689879 verify(sessionSpy.valid);
690880
@@ -694,6 +884,8 @@ Item {
694884 }
695885
696886 function test_fullscreen() {
887+ loadShell("phone");
888+ swipeAwayGreeter();
697889 var panel = findChild(shell, "panel");
698890 compare(panel.fullscreenMode, false);
699891 ApplicationManager.startApplication("camera-app");
@@ -707,6 +899,8 @@ Item {
707899 }
708900
709901 function test_leftEdgeDragFullscreen() {
902+ loadShell("phone");
903+ swipeAwayGreeter();
710904 var panel = findChild(shell, "panel");
711905 tryCompare(panel, "fullscreenMode", false)
712906
@@ -728,6 +922,8 @@ Item {
728922 }
729923
730924 function test_unlockedProperties() {
925+ loadShell("phone");
926+ swipeAwayGreeter();
731927 // Confirm that various properties have the correct values when unlocked
732928 var greeter = findChild(shell, "greeter");
733929 tryCompare(greeter, "locked", false);
@@ -740,10 +936,14 @@ Item {
740936 }
741937
742938 function test_unlockAllModemsOnBoot() {
939+ loadShell("phone");
940+ swipeAwayGreeter();
743941 tryCompare(unlockAllModemsSpy, "count", 1)
744942 }
745943
746944 function test_tapOnRightEdgeReachesApplicationSurface() {
945+ loadShell("phone");
946+ swipeAwayGreeter();
747947 var topmostSpreadDelegate = findChild(shell, "appDelegate0");
748948 var topmostSurface = findChild(topmostSpreadDelegate, "surfaceContainer").surface;
749949 var rightEdgeDragArea = findChild(shell, "spreadDragArea");
@@ -766,6 +966,8 @@ Item {
766966 by the right-edge drag area)
767967 */
768968 function test_rightEdgeDragDoesNotReachApplicationSurface() {
969+ loadShell("phone");
970+ swipeAwayGreeter();
769971 var topmostSpreadDelegate = findChild(shell, "appDelegate0");
770972 var topmostSurface = findChild(topmostSpreadDelegate, "surfaceContainer").surface;
771973 var rightEdgeDragArea = findChild(shell, "spreadDragArea");
@@ -810,6 +1012,8 @@ Item {
8101012 }
8111013
8121014 function test_tapUbuntuIconInLauncherOverAppSpread() {
1015+ loadShell("phone");
1016+ swipeAwayGreeter();
8131017
8141018 waitUntilFocusedApplicationIsShowingItsSurface();
8151019
@@ -856,19 +1060,75 @@ Item {
8561060 function test_background_data() {
8571061 return [
8581062 {tag: "color", accounts: Qt.resolvedUrl("data:image/svg+xml,<svg><rect width='100%' height='100%' fill='#dd4814'/></svg>"), gsettings: "", output: Qt.resolvedUrl("data:image/svg+xml,<svg><rect width='100%' height='100%' fill='#dd4814'/></svg>")},
859− {tag: "empty", accounts: "", gsettings: "", output: shell.defaultBackground},
1063+ {tag: "empty", accounts: "", gsettings: "", output: "defaultBackground"},
8601064 {tag: "as-specified", accounts: Qt.resolvedUrl("../data/unity/backgrounds/blue.png"), gsettings: "", output: Qt.resolvedUrl("../data/unity/backgrounds/blue.png")},
8611065 {tag: "gs-specified", accounts: "", gsettings: Qt.resolvedUrl("../data/unity/backgrounds/red.png"), output: Qt.resolvedUrl("../data/unity/backgrounds/red.png")},
8621066 {tag: "both-specified", accounts: Qt.resolvedUrl("../data/unity/backgrounds/blue.png"), gsettings: Qt.resolvedUrl("../data/unity/backgrounds/red.png"), output: Qt.resolvedUrl("../data/unity/backgrounds/blue.png")},
8631067 {tag: "invalid-as", accounts: Qt.resolvedUrl("../data/unity/backgrounds/nope.png"), gsettings: Qt.resolvedUrl("../data/unity/backgrounds/red.png"), output: Qt.resolvedUrl("../data/unity/backgrounds/red.png")},
864− {tag: "invalid-both", accounts: Qt.resolvedUrl("../data/unity/backgrounds/nope.png"), gsettings: Qt.resolvedUrl("../data/unity/backgrounds/stillnope.png"), output: shell.defaultBackground},
1068+ {tag: "invalid-both", accounts: Qt.resolvedUrl("../data/unity/backgrounds/nope.png"), gsettings: Qt.resolvedUrl("../data/unity/backgrounds/stillnope.png"), output: "defaultBackground"},
8651069 ]
8661070 }
8671071 function test_background(data) {
1072+ loadShell("phone");
1073+ swipeAwayGreeter();
8681074 AccountsService.backgroundFile = data.accounts;
8691075 var backgroundSettings = findInvisibleChild(shell, "backgroundSettings");
8701076 backgroundSettings.pictureUri = data.gsettings;
871− tryCompare(shell, "background", data.output);
1077+
1078+ if (data.output === "defaultBackground") {
1079+ tryCompare(shell, "background", shell.defaultBackground);
1080+ } else {
1081+ tryCompare(shell, "background", data.output);
1082+ }
1083+ }
1084+
1085+ function test_tabletLogin_data() {
1086+ return [
1087+ {tag: "auth error", user: "auth-error", loggedIn: false, password: ""},
1088+ {tag: "with password", user: "has-password", loggedIn: true, password: "password"},
1089+ {tag: "without password", user: "no-password", loggedIn: true, password: ""},
1090+ ]
1091+ }
1092+
1093+ function test_tabletLogin(data) {
1094+ setLightDMMockMode("full");
1095+ loadShell("tablet");
1096+
1097+ selectUser(data.user);
1098+
1099+ clickPasswordInput(data.password === "" /* isButton */);
1100+
1101+ if (data.password !== "") {
1102+ typeString(data.password);
1103+ keyClick(Qt.Key_Enter);
1104+ }
1105+
1106+ confirmLoggedIn(data.loggedIn);
1107+ }
1108+
1109+ function test_appLaunchDuringGreeter_data() {
1110+ return [
1111+ {tag: "auth error", user: "auth-error", loggedIn: false, passwordFocus: false},
1112+ {tag: "without password", user: "no-password", loggedIn: true, passwordFocus: false},
1113+ {tag: "with password", user: "has-password", loggedIn: false, passwordFocus: true},
1114+ ]
1115+ }
1116+
1117+ function test_appLaunchDuringGreeter(data) {
1118+ setLightDMMockMode("full");
1119+ loadShell("tablet");
1120+
1121+ selectUser(data.user)
1122+
1123+ var greeter = findChild(shell, "greeter")
1124+ var app = ApplicationManager.startApplication("dialer-app")
1125+
1126+ confirmLoggedIn(data.loggedIn)
1127+
1128+ if (data.passwordFocus) {
1129+ var passwordInput = findChild(greeter, "passwordInput")
1130+ tryCompare(passwordInput, "focus", true)
1131+ }
8721132 }
8731133 }
8741134}
tests/qmltests/tst_TabletShell.qmldeleted−304
@@ -1,304 +0,0 @@
1−/*
2− * Copyright (C) 2013,2014 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.0
18−import QtTest 1.0
19−import AccountsService 0.1
20−import GSettings 1.0
21−import LightDM 0.1 as LightDM
22−import Ubuntu.Components 1.1
23−import Ubuntu.Telephony 0.1 as Telephony
24−import Unity.Application 0.1
25−import Unity.Connectivity 0.1
26−import Unity.Test 0.1 as UT
27−import Powerd 0.1
28−
29−import "../../qml"
30−
31−Item {
32− id: root
33− width: units.gu(120)
34− height: units.gu(80)
35−
36− Component.onCompleted: {
37− // must set the mock mode before loading the Shell
38− LightDM.Greeter.mockMode = "full";
39− LightDM.Users.mockMode = "full";
40− shellLoader.active = true;
41− }
42−
43− QtObject {
44− id: applicationArguments
45−
46− function hasGeometry() {
47− return false
48− }
49−
50− function width() {
51− return 0
52− }
53−
54− function height() {
55− return 0
56− }
57− }
58−
59− Row {
60− anchors.fill: parent
61− Loader {
62− id: shellLoader
63−
64− active: false
65− width: units.gu(100)
66− height: parent.height
67−
68− property bool itemDestroyed: false
69− sourceComponent: Component {
70− Shell {
71− property string indicatorProfile: "phone"
72−
73− Component.onDestruction: {
74− shellLoader.itemDestroyed = true
75− }
76− }
77− }
78− }
79−
80− Rectangle {
81− color: "white"
82− width: units.gu(20)
83− height: parent.height
84−
85− Column {
86− anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
87− spacing: units.gu(1)
88− Button {
89− text: "Show Greeter"
90− onClicked: {
91− if (shellLoader.status !== Loader.Ready)
92− return
93−
94− var greeter = testCase.findChild(shellLoader.item, "greeter")
95− if (!greeter.shown) {
96− greeter.show()
97− }
98− }
99− }
100− Button {
101− text: "Demo edges"
102− onClicked: {
103− AccountsService.demoEdges = true;
104− }
105− }
106− }
107− }
108− }
109−
110− SignalSpy {
111− id: sessionSpy
112− signalName: "sessionStarted"
113− }
114−
115− SignalSpy {
116− id: dashCommunicatorSpy
117− signalName: "setCurrentScopeCalled"
118− }
119−
120− SignalSpy {
121− id: unlockAllModemsSpy
122− target: Connectivity
123− signalName: "unlockingAllModems"
124− }
125−
126− Telephony.CallEntry {
127− id: phoneCall
128− phoneNumber: "+447812221111"
129− }
130−
131− UT.UnityTestCase {
132− id: testCase
133− name: "TabletShell"
134− when: windowShown
135−
136− property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
137−
138− function init() {
139− tryCompare(shell, "enabled", true); // will be enabled when greeter is all ready
140− var userList = findChild(shell, "userList");
141− tryCompare(userList, "movingInternally", false);
142− sessionSpy.clear()
143− sessionSpy.target = findChild(shell, "greeter")
144− dashCommunicatorSpy.target = findInvisibleChild(shell, "dashCommunicator")
145− }
146−
147− function cleanup() {
148− tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
149−
150− shellLoader.itemDestroyed = false
151−
152− shellLoader.active = false
153−
154− tryCompare(shellLoader, "status", Loader.Null)
155− tryCompare(shellLoader, "item", null)
156− // Loader.status might be Loader.Null and Loader.item might be null but the Loader
157− // item might still be alive. So if we set Loader.active back to true
158− // again right now we will get the very same Shell instance back. So no reload
159− // actually took place. Likely because Loader waits until the next event loop
160− // iteration to do its work. So to ensure the reload, we will wait until the
161− // Shell instance gets destroyed.
162− tryCompare(shellLoader, "itemDestroyed", true)
163−
164− // kill all (fake) running apps
165− killApps()
166−
167− unlockAllModemsSpy.clear()
168− AccountsService.demoEdges = false
169− LightDM.Greeter.authenticate(""); // reset greeter
170−
171− // reload our test subject to get it in a fresh state once again
172− shellLoader.active = true
173−
174− tryCompare(shellLoader, "status", Loader.Ready)
175− removeTimeConstraintsFromDirectionalDragAreas(shellLoader.item)
176− }
177−
178− function killApps() {
179− while (ApplicationManager.count > 1) {
180− var appIndex = ApplicationManager.get(0).appId == "unity8-dash" ? 1 : 0
181− ApplicationManager.stopApplication(ApplicationManager.get(appIndex).appId)
182− }
183− compare(ApplicationManager.count, 1)
184− }
185−
186− function selectIndex(i) {
187− // We could be anywhere in list; find target index to know which direction
188− var greeter = findChild(shell, "greeter")
189− var userlist = findChild(greeter, "userList")
190− if (userlist.currentIndex == i)
191− keyClick(Qt.Key_Escape) // Reset state if we're not moving
192− while (userlist.currentIndex != i) {
193− var next = userlist.currentIndex + 1
194− if (userlist.currentIndex > i) {
195− next = userlist.currentIndex - 1
196− }
197− tap(findChild(greeter, "username"+next));
198− tryCompare(userlist, "currentIndex", next)
199− tryCompare(userlist, "movingInternally", false)
200− }
201− }
202−
203− function selectUser(name) {
204− // Find index of user with the right name
205− for (var i = 0; i < LightDM.Users.count; i++) {
206− if (LightDM.Users.data(i, LightDM.UserRoles.NameRole) == name) {
207− break
208− }
209− }
210− if (i == LightDM.Users.count) {
211− fail("Didn't find name")
212− return -1
213− }
214− selectIndex(i)
215− return i
216− }
217−
218− function clickPasswordInput(isButton) {
219− var greeter = findChild(shell, "greeter")
220− tryCompare(greeter, "fullyShown", true);
221−
222− var passwordMouseArea = findChild(shell, "passwordMouseArea")
223− tryCompare(passwordMouseArea, "enabled", isButton)
224−
225− var passwordInput = findChild(shell, "passwordInput")
226− mouseClick(passwordInput)
227− }
228−
229− function confirmLoggedIn(loggedIn) {
230− var greeter = findChild(shell, "greeter");
231− tryCompare(greeter, "shown", loggedIn ? false : true);
232− verify(loggedIn ? sessionSpy.count > 0 : sessionSpy.count === 0);
233− }
234−
235− function swipeFromLeftEdge(swipeLength) {
236− var touchStartX = 2
237− var touchStartY = shell.height / 2
238− touchFlick(shell, touchStartX, touchStartY, swipeLength, touchStartY)
239− }
240−
241− function test_login_data() {
242− return [
243− {tag: "auth error", user: "auth-error", loggedIn: false, password: ""},
244− {tag: "with password", user: "has-password", loggedIn: true, password: "password"},
245− {tag: "without password", user: "no-password", loggedIn: true, password: ""},
246− ]
247− }
248−
249− function test_login(data) {
250− selectUser(data.user)
251−
252− clickPasswordInput(data.password === "")
253−
254− if (data.password !== "") {
255− typeString(data.password)
256− keyClick(Qt.Key_Enter)
257− }
258−
259− confirmLoggedIn(data.loggedIn)
260− }
261−
262− function test_appLaunchDuringGreeter_data() {
263− return [
264− {tag: "auth error", user: "auth-error", loggedIn: false, passwordFocus: false},
265− {tag: "without password", user: "no-password", loggedIn: true, passwordFocus: false},
266− {tag: "with password", user: "has-password", loggedIn: false, passwordFocus: true},
267− ]
268− }
269−
270− function test_appLaunchDuringGreeter(data) {
271− selectUser(data.user)
272−
273− var greeter = findChild(shell, "greeter")
274− var app = ApplicationManager.startApplication("dialer-app")
275−
276− confirmLoggedIn(data.loggedIn)
277−
278− if (data.passwordFocus) {
279− var passwordInput = findChild(greeter, "passwordInput")
280− tryCompare(passwordInput, "focus", true)
281− }
282− }
283−
284− function test_leftEdgeDrag_data() {
285− return [
286− {tag: "without password", user: "no-password", loggedIn: true, demo: false},
287− {tag: "with password", user: "has-password", loggedIn: false, demo: false},
288− {tag: "with demo", user: "has-password", loggedIn: true, demo: true},
289− ]
290− }
291−
292− function test_leftEdgeDrag(data) {
293− selectUser(data.user)
294−
295− AccountsService.demoEdges = data.demo
296− var tutorial = findChild(shell, "tutorial");
297− tryCompare(tutorial, "running", data.demo);
298−
299− swipeFromLeftEdge(shell.width * 0.75)
300− wait(500) // to give time to handle dash() signal from Launcher
301− confirmLoggedIn(data.loggedIn)
302− }
303− }
304−}
tests/uqmlscene/CMakeLists.txt−1
@@ -2,7 +2,6 @@ add_executable(uqmlscene
22 ${shellapplication_MOC_SRCS}
33 ActiveFocusLogger.cpp
44 main.cpp
5− ${CMAKE_SOURCE_DIR}/src/MouseTouchAdaptor.cpp
65 )
76
87qt5_use_modules(uqmlscene Qml Quick Test)
tests/uqmlscene/main.cpp−4
@@ -63,8 +63,6 @@
6363#include <QtCore/QTranslator>
6464#include <QtCore/QLibraryInfo>
6565
66−#include <MouseTouchAdaptor.h>
67−
6866// UbuntuGestures lib
6967#include <TouchRegistry.h>
7068
@@ -436,8 +434,6 @@ int main(int argc, char ** argv)
436434 app.setOrganizationName("Qt Project");
437435 app.setOrganizationDomain("qt-project.org");
438436
439− MouseTouchAdaptor mouseTouchAdaptor;
440− app.installNativeEventFilter(&mouseTouchAdaptor);
441437 // Create it before loading the module, so that TestUtil
442438 // doesn't create one with a fake timer factory.
443439 // When interacting manually with a test we want the real deal.
tests/utils/modules/Unity/Test/CMakeLists.txt+2
@@ -6,12 +6,14 @@ include_directories(
66 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
77 ${Qt5Quick_PRIVATE_INCLUDE_DIRS}
88 ${CMAKE_SOURCE_DIR}/libs/UbuntuGestures
9+ ${CMAKE_SOURCE_DIR}/src
910)
1011
1112set(UnityTestQML_SOURCES
1213 testutil.cpp
1314 plugin.cpp
1415 TouchEventSequenceWrapper.cpp
16+ ${CMAKE_SOURCE_DIR}/src/MouseTouchAdaptor.cpp
1517)
1618
1719add_library(UnityTestQml MODULE ${UnityTestQML_SOURCES})
tests/utils/modules/Unity/Test/MouseTouchEmulationCheckbox.qmlnew file+43
@@ -0,0 +1,43 @@
1+/*
2+ * Copyright (C) 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.0
18+import QtQuick.Layouts 1.1
19+import Ubuntu.Components 1.1
20+import Unity.Test 0.1
21+
22+RowLayout {
23+ id: root
24+ property alias color: label.color
25+
26+ Binding {
27+ target: MouseTouchAdaptor
28+ property: "enabled"
29+ value: checkbox.checked
30+ }
31+
32+ Layout.fillWidth: true
33+ CheckBox {
34+ id: checkbox
35+ checked: true
36+ activeFocusOnPress: false
37+ }
38+ Label {
39+ id: label
40+ text: "Mouse emulates touch"
41+ anchors.verticalCenter: parent.verticalCenter
42+ }
43+}
tests/utils/modules/Unity/Test/plugin.cpp+15−2
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2012, 2013 Canonical, Ltd.
2+ * Copyright (C) 2012, 2013, 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
@@ -17,20 +17,33 @@
1717
1818#include "plugin.h"
1919#include "testutil.h"
20+#include <MouseTouchAdaptor.h>
2021#include "TouchEventSequenceWrapper.h"
2122
2223#include <qqml.h>
2324
24−static QObject *testutil_provider(QQmlEngine* /* engine */, QJSEngine* /* scriptEngine */)
25+namespace {
26+QObject *testutil_provider(QQmlEngine* /* engine */, QJSEngine* /* scriptEngine */)
2527{
2628 return new TestUtil();
2729}
30+QObject *getMouseTouchAdaptorQMLSingleton(QQmlEngine* /* engine */, QJSEngine* /* scriptEngine */)
31+{
32+ return MouseTouchAdaptor::instance();
33+}
34+} // anonymous namespace
2835
2936void UnityTestPlugin::registerTypes(const char *uri)
3037{
3138 Q_ASSERT(QLatin1String(uri) == QLatin1String("Unity.Test"));
39+
40+ // Ensure the instance gets created
41+ MouseTouchAdaptor::instance();
42+
3243 // @uri Unity.Test
3344 qmlRegisterSingletonType<TestUtil>(uri, 0, 1, "Util", testutil_provider);
3445 qmlRegisterUncreatableType<TouchEventSequenceWrapper>(uri, 0, 1, "TouchEventSequence",
3546 "You cannot directly create a TouchEventSequence object.");
47+ qmlRegisterSingletonType<MouseTouchAdaptor>(uri, 0, 1, "MouseTouchAdaptor",
48+ getMouseTouchAdaptorQMLSingleton);
3649}
tests/utils/modules/Unity/Test/qmldir+1
@@ -3,3 +3,4 @@ plugin UnityTestQml
33typeinfo Test.qmltypes
44
55UnityTestCase 0.1 UnityTestCase.qml
6+MouseTouchEmulationCheckbox 0.1 MouseTouchEmulationCheckbox.qml