From 4cc36d1df04d073e6fd5957fffe2efa6bd720833 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 25 Feb 2016 17:13:48 +1300 Subject: [PATCH] Update QML UI test environment for Settings > General dialog --- tests/ui/qml/StubMenu.qml | 4 ---- tests/ui/qml/Stubs.qml | 14 ++++++++++++++ tests/ui/qml/main.qml | 12 ++++++++++++ tests/ui/src/main.cpp | 2 ++ 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/tests/ui/qml/StubMenu.qml b/tests/ui/qml/StubMenu.qml index 63c9b5b3ea..fd0298988a 100644 --- a/tests/ui/qml/StubMenu.qml +++ b/tests/ui/qml/StubMenu.qml @@ -528,10 +528,6 @@ Menu { text: menuOption.turnWithHead; checkable: true } - MenuItem { - text: menuOption.comfortMode; - checkable: true - } MenuItem { text: menuOption.keyboardMotorControl; checkable: true diff --git a/tests/ui/qml/Stubs.qml b/tests/ui/qml/Stubs.qml index 3f60876e81..22b63d3f83 100644 --- a/tests/ui/qml/Stubs.qml +++ b/tests/ui/qml/Stubs.qml @@ -23,6 +23,20 @@ Item { function getUsername() { return "Jherico"; } } + Item { + objectName: "ApplicationCompositor" + property bool reticleOverDesktop: true + } + + Item { + objectName: "Preferences" + // List of categories obtained by logging categories as they are added in Interface in Preferences::addPreference(). + property var categories: [ + "Avatar Basics", "Snapshots", "Scripts", "Privacy", "Level of Detail Tuning", "Avatar Tuning", "Avatar Camera", + "Audio", "Octree", "HMD", "Sixense Controllers", "Graphics" + ] + } + Item { objectName: "ScriptDiscoveryService" //property var scriptsModelFilter: scriptsModel diff --git a/tests/ui/qml/main.qml b/tests/ui/qml/main.qml index 0bdfdb64b9..97f6224670 100644 --- a/tests/ui/qml/main.qml +++ b/tests/ui/qml/main.qml @@ -38,6 +38,18 @@ ApplicationWindow { property var tabs: []; property var urls: []; + Button { + // Shows the dialog with preferences sections but not each section's preference items + // because Preferences.preferencesByCategory() method is not stubbed out. + text: "Settings > General..." + property var builder: Component { + GeneralPreferencesDialog { } + } + onClicked: { + var runningScripts = builder.createObject(desktop); + } + } + Button { text: "Running Scripts" property var builder: Component { diff --git a/tests/ui/src/main.cpp b/tests/ui/src/main.cpp index 19c0626164..dae7b47bba 100644 --- a/tests/ui/src/main.cpp +++ b/tests/ui/src/main.cpp @@ -85,9 +85,11 @@ int main(int argc, char *argv[]) { setChild(engine, "offscreenFlags"); setChild(engine, "Account"); + setChild(engine, "ApplicationCompositor"); setChild(engine, "Desktop"); setChild(engine, "ScriptDiscoveryService"); setChild(engine, "MenuHelper"); + setChild(engine, "Preferences"); setChild(engine, "urlHandler"); engine.rootContext()->setContextProperty("DebugQML", true); engine.rootContext()->setContextProperty("fileDialogHelper", new FileDialogHelper());