diff options
Diffstat (limited to 'tests/qml')
95 files changed, 789 insertions, 352 deletions
diff --git a/tests/qml/configs/am-config.yaml b/tests/qml/configs/am-config.yaml index 34a4c56a..5333dae3 100644 --- a/tests/qml/configs/am-config.yaml +++ b/tests/qml/configs/am-config.yaml @@ -3,16 +3,6 @@ formatType: am-configuration --- applications: builtinAppsManifestDir: "${CONFIG_PWD}/apps" - installedAppsManifestDir: "/tmp/am/manifests" - appImageMountDir: "/tmp/am/image-mounts" - database: "/tmp/am/apps.db" - -installationLocations: -- id: "internal-0" - installationPath: "/tmp/am/apps" - documentPath: "/tmp/am/docs" - mountPoint: "/tmp" - isDefault: true # Workaround for a crash in the mesa software renderer (llvmpipe) runtimes: diff --git a/tests/qml/configs/apps/test.configs.app/app.qml b/tests/qml/configs/apps/test.configs.app/app.qml index 8ce11a63..402364ce 100644 --- a/tests/qml/configs/apps/test.configs.app/app.qml +++ b/tests/qml/configs/apps/test.configs.app/app.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/configs/configs.pro b/tests/qml/configs/configs.pro index 1ba0ab11..86604d5e 100644 --- a/tests/qml/configs/configs.pro +++ b/tests/qml/configs/configs.pro @@ -2,6 +2,7 @@ load(am-config) AM_CONFIG = am-config.yaml TEST_FILES = tst_configs.qml +TEST_APPS = test.configs.app TEST_CONFIGURATIONS = "--force-single-process" \ "--force-single-process --single-app $$_PRO_FILE_PWD_/apps/test.configs.app/info.yaml" multi-process { diff --git a/tests/qml/configs/tst_configs.qml b/tests/qml/configs/tst_configs.qml index 0dac7b3b..7e92e89f 100644 --- a/tests/qml/configs/tst_configs.qml +++ b/tests/qml/configs/tst_configs.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage @@ -90,7 +90,7 @@ TestCase { function test_basic_ipc() { compare(NotificationManager.count, 0); compare(windowAddedSpy.count, 0); - ApplicationManager.startApplication("test.configs.app"); + verify(ApplicationManager.startApplication("test.configs.app")) windowAddedSpy.wait(); compare(windowAddedSpy.count, 1); var window = windowAddedSpy.signalArguments[0][0]; diff --git a/tests/qml/crash/am-config.yaml b/tests/qml/crash/am-config.yaml index b9c17b5e..61b2bfb2 100644 --- a/tests/qml/crash/am-config.yaml +++ b/tests/qml/crash/am-config.yaml @@ -3,15 +3,6 @@ formatType: am-configuration --- applications: builtinAppsManifestDir: "${CONFIG_PWD}/apps" - installedAppsManifestDir: "/tmp/am-crash-test/manifests" - appImageMountDir: "/tmp/am-crash-test/image-mounts" - database: "/tmp/am-crash-test/apps.db" - -installationLocations: -- id: "internal-0" - installationPath: "/tmp/am/apps" - documentPath: "/tmp/am/docs" - mountPoint: "/tmp" flags: noUiWatchdog: yes diff --git a/tests/qml/crash/apps/tld.test.crash/app.qml b/tests/qml/crash/apps/tld.test.crash/app.qml index 262b0802..447b5bef 100644 --- a/tests/qml/crash/apps/tld.test.crash/app.qml +++ b/tests/qml/crash/apps/tld.test.crash/app.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/crash/apps/tld.test.crash/terminator2/qmlterminator2.cpp b/tests/qml/crash/apps/tld.test.crash/terminator2/qmlterminator2.cpp index 05e73934..0ed12064 100644 --- a/tests/qml/crash/apps/tld.test.crash/terminator2/qmlterminator2.cpp +++ b/tests/qml/crash/apps/tld.test.crash/terminator2/qmlterminator2.cpp @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:GPL-EXCEPT-QTAS$ ** Commercial License Usage diff --git a/tests/qml/crash/apps/tld.test.crash/terminator2/qmlterminator2.h b/tests/qml/crash/apps/tld.test.crash/terminator2/qmlterminator2.h index d8fabbf9..5d59d6ea 100644 --- a/tests/qml/crash/apps/tld.test.crash/terminator2/qmlterminator2.h +++ b/tests/qml/crash/apps/tld.test.crash/terminator2/qmlterminator2.h @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:GPL-EXCEPT-QTAS$ ** Commercial License Usage diff --git a/tests/qml/crash/crash.pro b/tests/qml/crash/crash.pro index 160c90af..b3bff364 100644 --- a/tests/qml/crash/crash.pro +++ b/tests/qml/crash/crash.pro @@ -1,4 +1,6 @@ AM_CONFIG = am-config.yaml TEST_FILES = tst_crash.qml +TEST_APPS = tld.test.crash load(am-qml-testcase) + diff --git a/tests/qml/crash/tst_crash.qml b/tests/qml/crash/tst_crash.qml index 8360652b..eacc66b3 100644 --- a/tests/qml/crash/tst_crash.qml +++ b/tests/qml/crash/tst_crash.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/installer/am-config.yaml b/tests/qml/installer/am-config.yaml index 03a59daa..d0e12789 100644 --- a/tests/qml/installer/am-config.yaml +++ b/tests/qml/installer/am-config.yaml @@ -3,16 +3,8 @@ formatType: am-configuration --- applications: builtinAppsManifestDir: "${CONFIG_PWD}/apps" - installedAppsManifestDir: "/tmp/am-installer-test/manifests" - appImageMountDir: "/tmp/am-installer-test/image-mounts" - database: "/tmp/am-installer-test/apps.db" - -installationLocations: -- id: "internal-0" - installationPath: "/tmp/am-installer-test/apps" - documentPath: "/tmp/am-installer-test/docs" - mountPoint: "/tmp" - isDefault: true + installationDir: "/tmp/am-installer-test/apps" + documentDir: "/tmp/am-installer-test/docs" flags: noSecurity: yes diff --git a/tests/qml/installer/apps/builtin.app/app1.qml b/tests/qml/installer/apps/hello-world.red/app1.qml index c18b5421..a3c4b30f 100644 --- a/tests/qml/installer/apps/builtin.app/app1.qml +++ b/tests/qml/installer/apps/hello-world.red/app1.qml @@ -3,7 +3,7 @@ ** Copyright (C) 2019 Luxoft Sweden AB ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/installer/apps/builtin.app/icon1.png b/tests/qml/installer/apps/hello-world.red/icon1.png Binary files differindex c1397153..c1397153 100644 --- a/tests/qml/installer/apps/builtin.app/icon1.png +++ b/tests/qml/installer/apps/hello-world.red/icon1.png diff --git a/tests/qml/installer/apps/builtin.app/info.yaml b/tests/qml/installer/apps/hello-world.red/info.yaml index 9320306b..1b628d1e 100644 --- a/tests/qml/installer/apps/builtin.app/info.yaml +++ b/tests/qml/installer/apps/hello-world.red/info.yaml @@ -1,7 +1,7 @@ formatVersion: 1 formatType: am-application --- -id: 'builtin.app' +id: 'hello-world.red' version: 'v1' icon: 'icon1.png' code: 'app1.qml' diff --git a/tests/qml/installer/appv1.pkg b/tests/qml/installer/appv1.pkg Binary files differdeleted file mode 100644 index 416cf018..00000000 --- a/tests/qml/installer/appv1.pkg +++ /dev/null diff --git a/tests/qml/installer/appv2.pkg b/tests/qml/installer/appv2.pkg Binary files differdeleted file mode 100644 index d3a15de5..00000000 --- a/tests/qml/installer/appv2.pkg +++ /dev/null diff --git a/tests/qml/installer/builtinv2.pkg b/tests/qml/installer/builtinv2.pkg Binary files differdeleted file mode 100644 index b32c2422..00000000 --- a/tests/qml/installer/builtinv2.pkg +++ /dev/null diff --git a/tests/qml/installer/install-apps/appv1/info.yaml b/tests/qml/installer/install-apps/appv1/info.yaml deleted file mode 100644 index 2c04ec5d..00000000 --- a/tests/qml/installer/install-apps/appv1/info.yaml +++ /dev/null @@ -1,10 +0,0 @@ -formatVersion: 1 -formatType: am-application ---- -id: 'test.install.app' -version: 'v1' -icon: 'icon1.png' -code: 'app1.qml' -runtime: 'qml' -name: - en: 'Installation Test App Version 1' diff --git a/tests/qml/installer/install-apps/appv2/info.yaml b/tests/qml/installer/install-apps/appv2/info.yaml deleted file mode 100644 index f7e2f96a..00000000 --- a/tests/qml/installer/install-apps/appv2/info.yaml +++ /dev/null @@ -1,10 +0,0 @@ -formatVersion: 1 -formatType: am-application ---- -id: 'test.install.app' -version: 'v2' -icon: 'icon2.png' -code: 'app2.qml' -runtime: 'qml' -name: - en: 'Installation Test App Version 2' diff --git a/tests/qml/installer/install-apps/builtinv2/icon2.png b/tests/qml/installer/install-apps/builtinv2/icon2.png Binary files differdeleted file mode 100644 index c1397153..00000000 --- a/tests/qml/installer/install-apps/builtinv2/icon2.png +++ /dev/null diff --git a/tests/qml/installer/install-apps/builtinv2/info.yaml b/tests/qml/installer/install-apps/builtinv2/info.yaml deleted file mode 100644 index 3e90f151..00000000 --- a/tests/qml/installer/install-apps/builtinv2/info.yaml +++ /dev/null @@ -1,10 +0,0 @@ -formatVersion: 1 -formatType: am-application ---- -id: 'builtin.app' -version: 'v2' -icon: 'icon2.png' -code: 'app2.qml' -runtime: 'qml' -name: - en: 'Builtin Installation Test App v2' diff --git a/tests/qml/installer/installer.pro b/tests/qml/installer/installer.pro index d85f1607..2adfb2a4 100644 --- a/tests/qml/installer/installer.pro +++ b/tests/qml/installer/installer.pro @@ -1,6 +1,6 @@ AM_CONFIG = am-config.yaml TEST_FILES = tst_installer.qml -FILES = appv1.pkg appv2.pkg +AM_TESTDATA_DIR=\"$$PWD/../../data/\" load(am-qml-testcase) diff --git a/tests/qml/installer/tst_installer.qml b/tests/qml/installer/tst_installer.qml index 01bb7a32..dced0938 100644 --- a/tests/qml/installer/tst_installer.qml +++ b/tests/qml/installer/tst_installer.qml @@ -1,10 +1,11 @@ /**************************************************************************** ** +** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2019 Luxoft Sweden AB ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage @@ -54,25 +55,25 @@ TestCase { SignalSpy { id: taskFinishedSpy - target: ApplicationInstaller + target: PackageManager signalName: "taskFinished" } SignalSpy { id: taskFailedSpy - target: ApplicationInstaller + target: PackageManager signalName: "taskFailed" } SignalSpy { id: taskStateChangedSpy - target: ApplicationInstaller + target: PackageManager signalName: "taskStateChanged" } SignalSpy { id: taskRequestingInstallationAcknowledgeSpy - target: ApplicationInstaller + target: PackageManager signalName: "taskRequestingInstallationAcknowledge" } @@ -85,31 +86,35 @@ TestCase { function init() { // Remove previous installations - if (ApplicationInstaller.removePackage("test.install.app", false, true)) { - taskFinishedSpy.wait(spyTimeout); - compare(taskFinishedSpy.count, 1); - taskFinishedSpy.clear(); + + for (var pkg of [ "hello-world.red", "com.pelagicore.test" ]) { + if (PackageManager.removePackage(pkg, false, true)) { + taskFinishedSpy.wait(spyTimeout); + compare(taskFinishedSpy.count, 1); + taskFinishedSpy.clear(); + } } } - function test_states() { - ApplicationManager.applicationAdded.connect(function(id) { - var app = ApplicationManager.application(id); - stateList.push(app.state); - app.stateChanged.connect(function(state) { - compare(state, app.state); - stateList.push(state); - }); - }); + function test_1states() { + PackageManager.packageAdded.connect(function(pkgId) { + var pkg = PackageManager.package(pkgId); + stateList.push(pkg.state) + pkg.stateChanged.connect(function(state) { + compare(state, pkg.state) + stateList.push(state) + }) + }) taskStateChangedSpy.clear(); - var id = ApplicationInstaller.startPackageInstallation("internal-0", "appv1.pkg"); + var id = PackageManager.startPackageInstallation(ApplicationManager.systemProperties.AM_TESTDATA_DIR + + "/packages/test-dev-signed.appkg") taskRequestingInstallationAcknowledgeSpy.wait(spyTimeout); compare(taskRequestingInstallationAcknowledgeSpy.count, 1); compare(taskRequestingInstallationAcknowledgeSpy.signalArguments[0][0], id); - var appId = taskRequestingInstallationAcknowledgeSpy.signalArguments[0][1].id + var pkgId = taskRequestingInstallationAcknowledgeSpy.signalArguments[0][1].id taskRequestingInstallationAcknowledgeSpy.clear(); - ApplicationInstaller.acknowledgePackageInstallation(id); + PackageManager.acknowledgePackageInstallation(id); if (!taskFinishedSpy.count) taskFinishedSpy.wait(spyTimeout); @@ -117,131 +122,137 @@ TestCase { taskFinishedSpy.clear(); compare(stateList.length, 2); - compare(stateList[0], ApplicationObject.BeingInstalled); - compare(stateList[1], ApplicationObject.Installed); - stateList = []; + compare(stateList[0], PackageObject.BeingInstalled) + compare(stateList[1], PackageObject.Installed) + stateList = [] - id = ApplicationInstaller.startPackageInstallation("internal-0", "appv2.pkg") + id = PackageManager.startPackageInstallation(ApplicationManager.systemProperties.AM_TESTDATA_DIR + + "/packages/test-update-dev-signed.appkg") taskRequestingInstallationAcknowledgeSpy.wait(spyTimeout); compare(taskRequestingInstallationAcknowledgeSpy.count, 1); compare(taskRequestingInstallationAcknowledgeSpy.signalArguments[0][0], id); taskRequestingInstallationAcknowledgeSpy.clear(); - ApplicationInstaller.acknowledgePackageInstallation(id); + PackageManager.acknowledgePackageInstallation(id); taskFinishedSpy.wait(spyTimeout); compare(taskFinishedSpy.count, 1); taskFinishedSpy.clear(); - compare(stateList[0], ApplicationObject.BeingUpdated); - compare(stateList[1], ApplicationObject.Installed); - stateList = []; + compare(stateList[0], PackageObject.BeingUpdated) + compare(stateList[1], PackageObject.Installed) + stateList = [] - id = ApplicationInstaller.removePackage(appId, false, false); + id = PackageManager.removePackage(pkgId, false, false); taskFinishedSpy.wait(spyTimeout); compare(taskFinishedSpy.count, 1); taskFinishedSpy.clear(); - compare(stateList[0], ApplicationObject.BeingRemoved); - stateList = []; + compare(stateList[0], PackageObject.BeingRemoved) + stateList = [] // Cannot compare app.state any more, since app might already be dead verify(taskStateChangedSpy.count > 10); - var taskStates = [ ApplicationInstaller.Executing, - ApplicationInstaller.AwaitingAcknowledge, - ApplicationInstaller.Installing, - ApplicationInstaller.CleaningUp, - ApplicationInstaller.Finished, - ApplicationInstaller.Executing, - ApplicationInstaller.AwaitingAcknowledge, - ApplicationInstaller.Installing, - ApplicationInstaller.CleaningUp, - ApplicationInstaller.Finished, - ApplicationInstaller.Executing ] + var taskStates = [ PackageManager.Executing, + PackageManager.AwaitingAcknowledge, + PackageManager.Installing, + PackageManager.CleaningUp, + PackageManager.Finished, + PackageManager.Executing, + PackageManager.AwaitingAcknowledge, + PackageManager.Installing, + PackageManager.CleaningUp, + PackageManager.Finished, + PackageManager.Executing ] for (var i = 0; i < taskStates.length; i++) compare(taskStateChangedSpy.signalArguments[i][1], taskStates[i], "- index: " + i); } - function test_cancel_update() { - var id = ApplicationInstaller.startPackageInstallation("internal-0", "appv1.pkg") + function test_2cancel_update() { + var id = PackageManager.startPackageInstallation(ApplicationManager.systemProperties.AM_TESTDATA_DIR + + "/packages/test-dev-signed.appkg") taskRequestingInstallationAcknowledgeSpy.wait(spyTimeout); compare(taskRequestingInstallationAcknowledgeSpy.count, 1); compare(taskRequestingInstallationAcknowledgeSpy.signalArguments[0][0], id); - var appId = taskRequestingInstallationAcknowledgeSpy.signalArguments[0][1].id - compare(appId, "test.install.app"); + var pkgId = taskRequestingInstallationAcknowledgeSpy.signalArguments[0][1].id + compare(pkgId, "com.pelagicore.test"); taskRequestingInstallationAcknowledgeSpy.clear(); - ApplicationInstaller.acknowledgePackageInstallation(id); + PackageManager.acknowledgePackageInstallation(id); taskFinishedSpy.wait(spyTimeout); taskFinishedSpy.clear(); - var app = ApplicationManager.application(appId); - compare(app.icon.toString().slice(-9), "icon1.png") - compare(app.version, "v1"); + var pkg = PackageManager.package(pkgId); + compare(pkg.version, "1.0"); - id = ApplicationInstaller.startPackageInstallation("internal-0", "appv2.pkg") + id = PackageManager.startPackageInstallation(ApplicationManager.systemProperties.AM_TESTDATA_DIR + + "/packages/test-update-dev-signed.appkg") taskRequestingInstallationAcknowledgeSpy.wait(spyTimeout); - appId = taskRequestingInstallationAcknowledgeSpy.signalArguments[0][1].id - compare(appId, "test.install.app"); + pkgId = taskRequestingInstallationAcknowledgeSpy.signalArguments[0][1].id + compare(pkgId, "com.pelagicore.test"); taskRequestingInstallationAcknowledgeSpy.clear(); - ApplicationInstaller.cancelTask(id); + PackageManager.cancelTask(id); taskFailedSpy.wait(spyTimeout); taskFailedSpy.clear(); - compare(app.icon.toString().slice(-9), "icon1.png") - compare(app.version, "v1"); + compare(pkg.version, "1.0"); } - function test_cancel_builtin_update() { + function test_3cancel_builtin_update() { taskStateChangedSpy.clear() - var app = ApplicationManager.application("builtin.app"); - verify(app.builtIn); - compare(app.icon.toString().slice(-9), "icon1.png") - compare(app.version, "v1"); + var pkg = PackageManager.package("hello-world.red"); + verify(pkg.builtIn); + compare(pkg.icon.toString().slice(-9), "icon1.png") + compare(pkg.version, "v1"); - var id = ApplicationInstaller.startPackageInstallation("internal-0", "builtinv2.pkg") + var id = PackageManager.startPackageInstallation(ApplicationManager.systemProperties.AM_TESTDATA_DIR + + "/packages/hello-world.red.appkg") taskRequestingInstallationAcknowledgeSpy.wait(spyTimeout); compare(taskRequestingInstallationAcknowledgeSpy.count, 1); compare(taskRequestingInstallationAcknowledgeSpy.signalArguments[0][0], id); taskRequestingInstallationAcknowledgeSpy.clear(); - ApplicationInstaller.cancelTask(id); + PackageManager.cancelTask(id); taskFailedSpy.wait(spyTimeout); taskFailedSpy.clear(); - verify(app.builtIn); - compare(app.icon.toString().slice(-9), "icon1.png") - compare(app.version, "v1"); + verify(pkg.builtIn); + compare(pkg.icon.toString().slice(-9), "icon1.png") + compare(pkg.version, "v1"); } - function test_builtin_update_downgrade() { + function test_4builtin_update_downgrade() { taskStateChangedSpy.clear() - var id = ApplicationInstaller.startPackageInstallation("internal-0", "builtinv2.pkg") + + var id = PackageManager.startPackageInstallation(ApplicationManager.systemProperties.AM_TESTDATA_DIR + + "/packages/hello-world.red.appkg") taskRequestingInstallationAcknowledgeSpy.wait(spyTimeout); compare(taskRequestingInstallationAcknowledgeSpy.count, 1); compare(taskRequestingInstallationAcknowledgeSpy.signalArguments[0][0], id); taskRequestingInstallationAcknowledgeSpy.clear(); - ApplicationInstaller.acknowledgePackageInstallation(id); + PackageManager.acknowledgePackageInstallation(id); taskFinishedSpy.wait(spyTimeout); - compare(ApplicationManager.get("builtin.app").version, "v2"); + var pkg = PackageManager.package("hello-world.red") + compare(pkg.version, "red"); taskFinishedSpy.clear(); applicationChangedSpy.clear(); // remvove is a downgrade - verify(ApplicationInstaller.removePackage("builtin.app", false, true)); + verify(pkg.builtIn) + verify(pkg.builtInHasRemovableUpdate) + verify(PackageManager.removePackage("hello-world.red", false, true)); taskFinishedSpy.wait(spyTimeout); compare(taskFinishedSpy.count, 1); taskFinishedSpy.clear(); - compare(applicationChangedSpy.count, 5); - compare(applicationChangedSpy.signalArguments[3][0], "builtin.app"); - compare(applicationChangedSpy.signalArguments[3][1], []); - compare(applicationChangedSpy.signalArguments[4][1], ["isBlocked"]); + compare(applicationChangedSpy.count, 3); + compare(applicationChangedSpy.signalArguments[0][0], "hello-world.red"); + compare(applicationChangedSpy.signalArguments[0][1], ["isBlocked"]); + compare(applicationChangedSpy.signalArguments[2][1], []); - var appmodel = ApplicationManager.get("builtin.app"); - verify(!appmodel.isBlocked); - compare(appmodel.version, "v1"); + verify(!pkg.blocked) + compare(pkg.version, "v1"); } } diff --git a/tests/qml/intents/am-config.yaml b/tests/qml/intents/am-config.yaml index 6c4957a1..1667c123 100644 --- a/tests/qml/intents/am-config.yaml +++ b/tests/qml/intents/am-config.yaml @@ -20,4 +20,4 @@ intents: disambiguation: 1000 startApplication: 1000 replyFromApplication: 1000 - requestToSystem: 2000 + replyFromSystem: 2000 diff --git a/tests/qml/intents/apps/intents1/intents1.qml b/tests/qml/intents/apps/intents1/intents1.qml index 560cdb3a..eb53a84c 100644 --- a/tests/qml/intents/apps/intents1/intents1.qml +++ b/tests/qml/intents/apps/intents1/intents1.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/intents/apps/intents2/intents2.qml b/tests/qml/intents/apps/intents2/intents2.qml index 7c989a17..d77ac506 100644 --- a/tests/qml/intents/apps/intents2/intents2.qml +++ b/tests/qml/intents/apps/intents2/intents2.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/intents/intents.pro b/tests/qml/intents/intents.pro index ae6415a6..797f96e8 100644 --- a/tests/qml/intents/intents.pro +++ b/tests/qml/intents/intents.pro @@ -1,7 +1,5 @@ AM_CONFIG = am-config.yaml TEST_FILES = tst_intents.qml - -APPS = intents1 intents2 cannot-start -for (app, APPS): OTHER_FILES += apps/$${app}/*.yaml apps/$${app}/*.qml apps/$${app}/*.png +TEST_APPS = intents1 intents2 cannot-start load(am-qml-testcase) diff --git a/tests/qml/intents/tst_intents.qml b/tests/qml/intents/tst_intents.qml index 9ab11a7a..3ac6a03b 100644 --- a/tests/qml/intents/tst_intents.qml +++ b/tests/qml/intents/tst_intents.qml @@ -1,10 +1,11 @@ /**************************************************************************** ** +** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2019 Luxoft Sweden AB ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage @@ -74,66 +75,51 @@ TestCase { signalName: "replyReceived" } - function test_intent_gadget() { - var allIntents = IntentServer.intentList - verify(allIntents.length > 0) + function test_intent_object() { + verify(IntentServer.count> 0) // test intent properties - var intent = IntentServer.find("both", "intents1") - verify(intent.valid) + var intent = IntentServer.applicationIntent("both", "intents1") + verify(intent) compare(intent.intentId, "both") compare(intent.applicationId, "intents1") - compare(intent.visibility, Intent.Public) + compare(intent.visibility, IntentObject.Public) compare(intent.requiredCapabilities, []) compare(intent.parameterMatch, {}) - // test comparison operators - var pos = allIntents.indexOf(intent) - verify(pos >= 0) - var intent1 = IntentServer.find("both", "intents1") - var intent2 = IntentServer.find("both", "intents2") - verify(intent1.valid) - verify(intent2.valid) - verify(intent1 == intent) - verify(intent1 === intent) - verify(intent1 != intent2) - verify(intent1 !== intent2) - verify(intent1 < intent2) - verify(intent2 > intent1) - - verify(!IntentServer.find("both", "intents3").valid) - verify(!IntentServer.find("bothx", "intents1").valid) - verify(!IntentServer.find("both", "").valid) - verify(!IntentServer.find("", "intents1").valid) - verify(!IntentServer.find("", "").valid) + verify(!IntentServer.applicationIntent("both", "intents3")) + verify(!IntentServer.applicationIntent("bothx", "intents1")) + verify(!IntentServer.applicationIntent("both", "")) + verify(!IntentServer.applicationIntent("", "intents1")) + verify(!IntentServer.applicationIntent("", "")) } function test_match() { // first, check the matching on the server API - var intent = IntentServer.find("match", "intents1") - verify(!intent.valid) - intent = IntentServer.find("match", "intents1", matchParams) - verify(intent.valid) + var intent = IntentServer.applicationIntent("match", "intents1") + verify(!intent) + intent = IntentServer.applicationIntent("match", "intents1", matchParams) + verify(intent) compare(intent.parameterMatch, { "list": [ "a", "b" ], "int": 42, "string": "^foo_.*_bar$", "complex": { "a": 1 } }) var params = matchParams params.list = "c" - verify(!IntentServer.find("match", "intents1", params).valid) + verify(!IntentServer.applicationIntent("match", "intents1", params)) params.list = "b" - verify(IntentServer.find("match", "intents1", params).valid) + verify(IntentServer.applicationIntent("match", "intents1", params)) params.int = 2 - verify(!IntentServer.find("match", "intents1", params).valid) + verify(!IntentServer.applicationIntent("match", "intents1", params)) params.int = 42 params.string = "foo" - verify(!IntentServer.find("match", "intents1", params).valid) + verify(!IntentServer.applicationIntent("match", "intents1", params)) params.string = "foo_test_bar" - verify(IntentServer.find("match", "intents1", params).valid) + verify(IntentServer.applicationIntent("match", "intents1", params)) params.complex = "string" - verify(!IntentServer.find("match", "intents1", params).valid) + verify(!IntentServer.applicationIntent("match", "intents1", params)) params.complex = matchParams.complex } @@ -241,8 +227,9 @@ TestCase { break case "acknowledge": var intent = possibleIntents[0] - if (data.acknowledgeIntentId) - intent = IntentServer.find(data.acknowledgeIntentId, possibleIntents[0].applicationId) + if (data.acknowledgeIntentId) { + intent = IntentServer.applicationIntent(data.acknowledgeIntentId, possibleIntents[0].applicationId) + } IntentServer.acknowledgeDisambiguationRequest(disambiguateSpy.signalArguments[0][0], intent) break } diff --git a/tests/qml/lifecycle/am-config.yaml b/tests/qml/lifecycle/am-config.yaml index b9c17b5e..61b2bfb2 100644 --- a/tests/qml/lifecycle/am-config.yaml +++ b/tests/qml/lifecycle/am-config.yaml @@ -3,15 +3,6 @@ formatType: am-configuration --- applications: builtinAppsManifestDir: "${CONFIG_PWD}/apps" - installedAppsManifestDir: "/tmp/am-crash-test/manifests" - appImageMountDir: "/tmp/am-crash-test/image-mounts" - database: "/tmp/am-crash-test/apps.db" - -installationLocations: -- id: "internal-0" - installationPath: "/tmp/am/apps" - documentPath: "/tmp/am/docs" - mountPoint: "/tmp" flags: noUiWatchdog: yes diff --git a/tests/qml/qml.pro b/tests/qml/qml.pro index d6a064f6..83cca142 100644 --- a/tests/qml/qml.pro +++ b/tests/qml/qml.pro @@ -15,4 +15,5 @@ SUBDIRS = \ crash/apps/tld.test.crash/terminator2 \ crash \ configs \ - lifecycle + lifecycle \ + resources diff --git a/tests/qml/quicklaunch/am-config.yaml b/tests/qml/quicklaunch/am-config.yaml index cb9e528a..e8de3d00 100644 --- a/tests/qml/quicklaunch/am-config.yaml +++ b/tests/qml/quicklaunch/am-config.yaml @@ -3,16 +3,6 @@ formatType: am-configuration --- applications: builtinAppsManifestDir: "${CONFIG_PWD}/apps" - installedAppsManifestDir: "/tmp/am-quicklaunch-test/manifests" - appImageMountDir: "/tmp/am-quicklaunch-test/image-mounts" - database: "/tmp/am-quicklaunch-test/apps.db" - -installationLocations: -- id: "internal-0" - installationPath: "/tmp/am/apps" - documentPath: "/tmp/am/docs" - mountPoint: "/tmp" - isDefault: true quicklaunch: runtimesPerContainer: 2 diff --git a/tests/qml/quicklaunch/apps/tld.test.quicklaunch/app.qml b/tests/qml/quicklaunch/apps/tld.test.quicklaunch/app.qml index 1c203d4f..9defde81 100644 --- a/tests/qml/quicklaunch/apps/tld.test.quicklaunch/app.qml +++ b/tests/qml/quicklaunch/apps/tld.test.quicklaunch/app.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/quicklaunch/quicklaunch.pro b/tests/qml/quicklaunch/quicklaunch.pro index 4c6b8f74..2d990a4b 100644 --- a/tests/qml/quicklaunch/quicklaunch.pro +++ b/tests/qml/quicklaunch/quicklaunch.pro @@ -1,4 +1,5 @@ AM_CONFIG = am-config.yaml TEST_FILES = tst_quicklaunch.qml +TEST_APPS = tld.test.quicklaunch load(am-qml-testcase) diff --git a/tests/qml/quicklaunch/tst_quicklaunch.qml b/tests/qml/quicklaunch/tst_quicklaunch.qml index b840e691..1e4e4e5d 100644 --- a/tests/qml/quicklaunch/tst_quicklaunch.qml +++ b/tests/qml/quicklaunch/tst_quicklaunch.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/resources/am-config.yaml b/tests/qml/resources/am-config.yaml new file mode 100644 index 00000000..b846a005 --- /dev/null +++ b/tests/qml/resources/am-config.yaml @@ -0,0 +1,22 @@ +formatVersion: 1 +formatType: am-configuration +--- +applications: + builtinAppsManifestDir: "${CONFIG_PWD}/apps" + installationDir: "/tmp/am-resource-test/apps" + +quicklaunch: + runtimesPerContainer: 1 + idleLoad: 1.0 + +runtimes: + qml: + resources: "${CONFIG_PWD}/appcommon/appcommonfile.rcc" + importPaths: "qrc:/appcommon/qml" + quicklaunchQml: "qrc:/appcommon/Quicklaunch.qml" + +ui: + importPaths: "qrc:///qml" + resources: + - "${CONFIG_PWD}/systemuifile.rcc" + - "${CONFIG_PWD}/systemuiplugin" # libsystemuiplugin.so would only work on Linux diff --git a/tests/qml/resources/appcommon/Quicklaunch.qml b/tests/qml/resources/appcommon/Quicklaunch.qml new file mode 100644 index 00000000..a8998d0e --- /dev/null +++ b/tests/qml/resources/appcommon/Quicklaunch.qml @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Application Manager. +** +** $QT_BEGIN_LICENSE:LGPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: LGPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.11 +import common 1.0 + +CommonObj { + Component.onCompleted: console.info("Quicklaunch - meaning: " + meaning); +} diff --git a/tests/qml/resources/appcommon/appcommon.pro b/tests/qml/resources/appcommon/appcommon.pro new file mode 100644 index 00000000..47028775 --- /dev/null +++ b/tests/qml/resources/appcommon/appcommon.pro @@ -0,0 +1,7 @@ +TEMPLATE = aux + +OTHER_FILES += Quicklaunch.qml \ + qml/common/CommonObj.qml + +RESOURCE_SOURCE = appcommonfile.qrc +load(generate-resource) diff --git a/tests/qml/resources/appcommon/appcommonfile.qrc b/tests/qml/resources/appcommon/appcommonfile.qrc new file mode 100644 index 00000000..4dc15f85 --- /dev/null +++ b/tests/qml/resources/appcommon/appcommonfile.qrc @@ -0,0 +1,7 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource prefix="appcommon"> + <file>qml/common/CommonObj.qml</file> + <file>qml/common/qmldir</file> + <file>Quicklaunch.qml</file> +</qresource> +</RCC> diff --git a/tests/qml/resources/appcommon/qml/common/CommonObj.qml b/tests/qml/resources/appcommon/qml/common/CommonObj.qml new file mode 100644 index 00000000..ff1fdcf7 --- /dev/null +++ b/tests/qml/resources/appcommon/qml/common/CommonObj.qml @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Application Manager. +** +** $QT_BEGIN_LICENSE:LGPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: LGPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.11 + +QtObject { + property int meaning: 42 +} diff --git a/tests/qml/resources/appcommon/qml/common/qmldir b/tests/qml/resources/appcommon/qml/common/qmldir new file mode 100644 index 00000000..5458b257 --- /dev/null +++ b/tests/qml/resources/appcommon/qml/common/qmldir @@ -0,0 +1,2 @@ +module common +CommonObj 1.0 CommonObj.qml diff --git a/tests/qml/resources/apps/app1/app1.pro b/tests/qml/resources/apps/app1/app1.pro new file mode 100644 index 00000000..cbbb4758 --- /dev/null +++ b/tests/qml/resources/apps/app1/app1.pro @@ -0,0 +1,11 @@ +TEMPLATE = lib +TARGET = app1plugin +CONFIG += plugin +RESOURCES = app1plugin.qrc + +RESOURCE_SOURCE = app1file.qrc +load(generate-resource) + +OTHER_FILES += \ + info.yaml \ + icon.png diff --git a/tests/qml/resources/apps/app1/app1.qml b/tests/qml/resources/apps/app1/app1.qml new file mode 100644 index 00000000..9ab04279 --- /dev/null +++ b/tests/qml/resources/apps/app1/app1.qml @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Application Manager. +** +** $QT_BEGIN_LICENSE:LGPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: LGPL-3.0 +** +****************************************************************************/ + +import QtApplicationManager.Application 2.0 +import forms 1.0 + +ApplicationManagerWindow { + YellowRect {} + AquaRect {} +} diff --git a/tests/qml/resources/apps/app1/app1file.qrc b/tests/qml/resources/apps/app1/app1file.qrc new file mode 100644 index 00000000..6c958e89 --- /dev/null +++ b/tests/qml/resources/apps/app1/app1file.qrc @@ -0,0 +1,7 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource prefix="/app1"> + <file>app1.qml</file> + <file>qml/forms/YellowRect.qml</file> + <file>qml/forms/qmldir</file> +</qresource> +</RCC> diff --git a/tests/qml/resources/apps/app1/app1plugin.qrc b/tests/qml/resources/apps/app1/app1plugin.qrc new file mode 100644 index 00000000..6c4e2ae3 --- /dev/null +++ b/tests/qml/resources/apps/app1/app1plugin.qrc @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource prefix="/app1"> + <file>qml/forms/AquaRect.qml</file> +</qresource> +</RCC> diff --git a/tests/qml/installer/install-apps/appv1/icon1.png b/tests/qml/resources/apps/app1/icon.png Binary files differindex c1397153..c1397153 100644 --- a/tests/qml/installer/install-apps/appv1/icon1.png +++ b/tests/qml/resources/apps/app1/icon.png diff --git a/tests/qml/resources/apps/app1/info.yaml b/tests/qml/resources/apps/app1/info.yaml new file mode 100644 index 00000000..a5287f2c --- /dev/null +++ b/tests/qml/resources/apps/app1/info.yaml @@ -0,0 +1,17 @@ +formatVersion: 1 +formatType: am-package +--- +id: 'app1' +icon: 'icon.png' +name: + en: 'Resource Test App 1' + +applications: + - id: 'app1' + code: 'qrc:///app1/app1.qml' + runtime: 'qml' + runtimeParameters: + importPaths: "qrc:///app1/qml" + resources: + - app1file.rcc + - app1plugin # libapp1plugin.so would only work on Linux diff --git a/tests/qml/installer/install-apps/appv1/app1.qml b/tests/qml/resources/apps/app1/qml/forms/AquaRect.qml index 4934be54..8bd906a6 100644 --- a/tests/qml/installer/install-apps/appv1/app1.qml +++ b/tests/qml/resources/apps/app1/qml/forms/AquaRect.qml @@ -3,7 +3,7 @@ ** Copyright (C) 2019 Luxoft Sweden AB ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage @@ -39,6 +39,8 @@ ** ****************************************************************************/ -import QtQuick 2.4 +import QtQuick 2.11 -Item {} +Rectangle { + color: "aqua" +} diff --git a/tests/qml/resources/apps/app1/qml/forms/YellowRect.qml b/tests/qml/resources/apps/app1/qml/forms/YellowRect.qml new file mode 100644 index 00000000..a4b5d9cb --- /dev/null +++ b/tests/qml/resources/apps/app1/qml/forms/YellowRect.qml @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Application Manager. +** +** $QT_BEGIN_LICENSE:LGPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: LGPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.11 + +Rectangle { + color: "yellow" +} diff --git a/tests/qml/resources/apps/app1/qml/forms/qmldir b/tests/qml/resources/apps/app1/qml/forms/qmldir new file mode 100644 index 00000000..12a5506b --- /dev/null +++ b/tests/qml/resources/apps/app1/qml/forms/qmldir @@ -0,0 +1,4 @@ +module forms +YellowRect 1.0 qrc:///app1/qml/forms/YellowRect.qml +# :/app1/qml/forms/YellowRect.qml would not work +AquaRect 1.0 AquaRect.qml diff --git a/tests/qml/installer/install-apps/appv2/app2.qml b/tests/qml/resources/apps/app2/BlueRect.qml index 0e1798c3..151dd1eb 100644 --- a/tests/qml/installer/install-apps/appv2/app2.qml +++ b/tests/qml/resources/apps/app2/BlueRect.qml @@ -3,7 +3,7 @@ ** Copyright (C) 2019 Luxoft Sweden AB ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage @@ -39,6 +39,8 @@ ** ****************************************************************************/ -import QtQuick 2.4 +import QtQuick 2.11 -Rectangle {} +Rectangle { + color: "blue" +} diff --git a/tests/qml/resources/apps/app2/app2.pro b/tests/qml/resources/apps/app2/app2.pro new file mode 100644 index 00000000..7a5190df --- /dev/null +++ b/tests/qml/resources/apps/app2/app2.pro @@ -0,0 +1,8 @@ +TEMPLATE = aux + +RESOURCE_SOURCE = app2.qrc +load(generate-resource) + +OTHER_FILES += \ + info.yaml \ + icon.png diff --git a/tests/qml/resources/apps/app2/app2.qml b/tests/qml/resources/apps/app2/app2.qml new file mode 100644 index 00000000..25663cef --- /dev/null +++ b/tests/qml/resources/apps/app2/app2.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Application Manager. +** +** $QT_BEGIN_LICENSE:LGPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: LGPL-3.0 +** +****************************************************************************/ + +import QtApplicationManager.Application 2.0 +import QtQuick 2.11 +import appwidgets 1.0 +import common 1.0 + +ApplicationManagerWindow { + CommonObj { id: common } + BlueRect { } + GreenRect { } + + Timer { + running: true + interval: 20 + onTriggered: setWindowProperty("meaning", common.meaning); + } +} diff --git a/tests/qml/resources/apps/app2/app2.qrc b/tests/qml/resources/apps/app2/app2.qrc new file mode 100644 index 00000000..80bc560c --- /dev/null +++ b/tests/qml/resources/apps/app2/app2.qrc @@ -0,0 +1,6 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>app2.qml</file> + <file>BlueRect.qml</file> +</qresource> +</RCC> diff --git a/tests/qml/installer/install-apps/appv2/icon2.png b/tests/qml/resources/apps/app2/icon.png Binary files differindex c1397153..c1397153 100644 --- a/tests/qml/installer/install-apps/appv2/icon2.png +++ b/tests/qml/resources/apps/app2/icon.png diff --git a/tests/qml/resources/apps/app2/info.yaml b/tests/qml/resources/apps/app2/info.yaml new file mode 100644 index 00000000..6eda565b --- /dev/null +++ b/tests/qml/resources/apps/app2/info.yaml @@ -0,0 +1,15 @@ +formatVersion: 1 +formatType: am-package +--- +id: 'app2' +icon: 'icon.png' +name: + en: 'Resource Test App 2' + +applications: + - id: 'app2' + code: ':/app2.qml' + runtime: 'qml' + runtimeParameters: + importPaths: "qml" + resources: "app2.rcc" diff --git a/tests/qml/resources/apps/app2/qml/appwidgets/GreenRect.qml b/tests/qml/resources/apps/app2/qml/appwidgets/GreenRect.qml new file mode 100644 index 00000000..d727e11e --- /dev/null +++ b/tests/qml/resources/apps/app2/qml/appwidgets/GreenRect.qml @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Application Manager. +** +** $QT_BEGIN_LICENSE:LGPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: LGPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.11 + +Rectangle { + color: "green" +} diff --git a/tests/qml/resources/apps/app2/qml/appwidgets/qmldir b/tests/qml/resources/apps/app2/qml/appwidgets/qmldir new file mode 100644 index 00000000..a158bf25 --- /dev/null +++ b/tests/qml/resources/apps/app2/qml/appwidgets/qmldir @@ -0,0 +1,2 @@ +module appwidgets +GreenRect 1.0 GreenRect.qml diff --git a/tests/qml/resources/qml/widgets/MagentaRect.qml b/tests/qml/resources/qml/widgets/MagentaRect.qml new file mode 100644 index 00000000..a90cf23b --- /dev/null +++ b/tests/qml/resources/qml/widgets/MagentaRect.qml @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Application Manager. +** +** $QT_BEGIN_LICENSE:LGPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: LGPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.11 + +Rectangle { + color: "magenta" +} diff --git a/tests/qml/installer/install-apps/builtinv2/app2.qml b/tests/qml/resources/qml/widgets/RedRect.qml index b65b03ce..b22b895b 100644 --- a/tests/qml/installer/install-apps/builtinv2/app2.qml +++ b/tests/qml/resources/qml/widgets/RedRect.qml @@ -3,7 +3,7 @@ ** Copyright (C) 2019 Luxoft Sweden AB ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import QtQuick 2.4 +import QtQuick 2.11 Rectangle { color: "red" diff --git a/tests/qml/resources/qml/widgets/qmldir b/tests/qml/resources/qml/widgets/qmldir new file mode 100644 index 00000000..be36132a --- /dev/null +++ b/tests/qml/resources/qml/widgets/qmldir @@ -0,0 +1,3 @@ +module widgets +RedRect 1.0 RedRect.qml +MagentaRect 1.0 MagentaRect.qml diff --git a/tests/qml/resources/resources.pro b/tests/qml/resources/resources.pro new file mode 100644 index 00000000..6da64f00 --- /dev/null +++ b/tests/qml/resources/resources.pro @@ -0,0 +1,5 @@ +TEMPLATE = subdirs +SUBDIRS = test.pro \ + appcommon \ + apps/app1 \ + apps/app2 diff --git a/tests/qml/resources/systemuifile.qrc b/tests/qml/resources/systemuifile.qrc new file mode 100644 index 00000000..ce48e1a4 --- /dev/null +++ b/tests/qml/resources/systemuifile.qrc @@ -0,0 +1,6 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>qml/widgets/RedRect.qml</file> + <file>qml/widgets/qmldir</file> +</qresource> +</RCC> diff --git a/tests/qml/resources/systemuiplugin.qrc b/tests/qml/resources/systemuiplugin.qrc new file mode 100644 index 00000000..7fe63a54 --- /dev/null +++ b/tests/qml/resources/systemuiplugin.qrc @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>qml/widgets/MagentaRect.qml</file> +</qresource> +</RCC> diff --git a/tests/qml/resources/test.pro b/tests/qml/resources/test.pro new file mode 100644 index 00000000..fd145a2e --- /dev/null +++ b/tests/qml/resources/test.pro @@ -0,0 +1,18 @@ +AM_CONFIG = am-config.yaml +TEST_FILES = tst_resource.qml +TEST_APPS = app1 app2 + +DIRECTORIES = apps/app2/qml +FILES = am-config.yaml \ + apps/app1/icon.png apps/app1/info.yaml \ + apps/app2/icon.png apps/app2/info.yaml +DESTDIR = $$OUT_PWD +load(am-qml-testcase) + +RESOURCE_SOURCE = systemuifile.qrc +load(generate-resource) + +TEMPLATE = lib +TARGET = systemuiplugin +CONFIG += plugin +RESOURCES = systemuiplugin.qrc diff --git a/tests/qml/resources/tst_resource.qml b/tests/qml/resources/tst_resource.qml new file mode 100644 index 00000000..36b47dfb --- /dev/null +++ b/tests/qml/resources/tst_resource.qml @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Application Manager. +** +** $QT_BEGIN_LICENSE:LGPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: LGPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.11 +import QtTest 1.0 +import QtApplicationManager.SystemUI 2.0 +import widgets 1.0 + +TestCase { + id: testCase + when: windowShown + name: "ResourceTest" + + RedRect {} + MagentaRect {} + + SignalSpy { + id: runStateChangedSpy + target: ApplicationManager + signalName: "applicationRunStateChanged" + } + + SignalSpy { + id: windowPropertyChangedSpy + target: WindowManager + signalName: "windowPropertyChanged" + } + + function test_basic_data() { + return [ { tag: "app1" }, + { tag: "app2" } ]; + } + + function test_basic(data) { + wait(1200); // wait for quicklaunch + + var app = ApplicationManager.application(data.tag); + windowPropertyChangedSpy.clear(); + + app.start(); + while (app.runState !== ApplicationObject.Running) + runStateChangedSpy.wait(3000); + + if (data.tag === "app2") { + windowPropertyChangedSpy.wait(2000); + compare(windowPropertyChangedSpy.count, 1); + compare(windowPropertyChangedSpy.signalArguments[0][0].windowProperty("meaning"), 42); + } + + app.stop(); + while (app.runState !== ApplicationObject.NotRunning) + runStateChangedSpy.wait(3000); + } +} diff --git a/tests/qml/simple/am-config.yaml b/tests/qml/simple/am-config.yaml index 46309470..2a515905 100644 --- a/tests/qml/simple/am-config.yaml +++ b/tests/qml/simple/am-config.yaml @@ -3,16 +3,6 @@ formatType: am-configuration --- applications: builtinAppsManifestDir: "${CONFIG_PWD}/apps" - installedAppsManifestDir: "/tmp/am-simple-test/manifests" - appImageMountDir: "/tmp/am-simple-test/image-mounts" - database: "/tmp/am-simple-test/apps.db" - -installationLocations: -- id: "internal-0" - installationPath: "/tmp/am/apps" - documentPath: "/tmp/am/docs" - mountPoint: "/tmp" - isDefault: true ui: fullscreen: no diff --git a/tests/qml/simple/apps/tld.test.simple1/app1.qml b/tests/qml/simple/apps/tld.test.simple1/app1.qml index fb38c958..f0402209 100644 --- a/tests/qml/simple/apps/tld.test.simple1/app1.qml +++ b/tests/qml/simple/apps/tld.test.simple1/app1.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/simple/apps/tld.test.simple1/info-alias.yaml b/tests/qml/simple/apps/tld.test.simple1/info-alias.yaml deleted file mode 100644 index ec600862..00000000 --- a/tests/qml/simple/apps/tld.test.simple1/info-alias.yaml +++ /dev/null @@ -1,9 +0,0 @@ -formatVersion: 1 -formatType: am-application-alias ---- -aliasId: 'tld.test.simple1@alias' -icon: 'icon2.png' -name: - en: 'Simple1 Alias' - -documentUrl: "x-test:alias" diff --git a/tests/qml/simple/apps/tld.test.simple2/app.qml b/tests/qml/simple/apps/tld.test.simple2/app.qml index 2a09855d..b0506e1f 100644 --- a/tests/qml/simple/apps/tld.test.simple2/app.qml +++ b/tests/qml/simple/apps/tld.test.simple2/app.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/simple/simple.pro b/tests/qml/simple/simple.pro index 375f62c5..72dbea95 100644 --- a/tests/qml/simple/simple.pro +++ b/tests/qml/simple/simple.pro @@ -1,4 +1,5 @@ AM_CONFIG = am-config.yaml TEST_FILES = tst_applicationmanager.qml +TEST_APPS = tld.test.simple1 tld.test.simple2 load(am-qml-testcase) diff --git a/tests/qml/simple/tst_applicationmanager.qml b/tests/qml/simple/tst_applicationmanager.qml index d945c477..8b62425f 100644 --- a/tests/qml/simple/tst_applicationmanager.qml +++ b/tests/qml/simple/tst_applicationmanager.qml @@ -1,10 +1,11 @@ /**************************************************************************** ** +** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2019 Luxoft Sweden AB ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage @@ -51,10 +52,10 @@ TestCase { name: "ApplicationManager" property var simpleApplication - property var applicationAlias property var capsApplication // Either appman is build in single-process mode or it was started with --force-single-process - property bool singleProcess : Qt.application.arguments.indexOf("--force-single-process") !== -1 || buildConfig[0].CONFIG.indexOf("multi-process") === -1 + property bool singleProcess : Qt.application.arguments.indexOf("--force-single-process") !== -1 + || buildConfig[0].CONFIG.indexOf("multi-process") === -1 property QtObject windowHandler: QtObject { function windowAddedHandler(window) { console.info("window " + window + " added"); @@ -84,10 +85,9 @@ TestCase { WindowManager.windowAdded.connect(windowHandler.windowAddedHandler) WindowManager.windowContentStateChanged.connect(windowHandler.windowContentStateChangedHandler) - compare(ApplicationManager.count, 3) + compare(ApplicationManager.count, 2) simpleApplication = ApplicationManager.application(0); - applicationAlias = ApplicationManager.application(1); - capsApplication = ApplicationManager.application(2); + capsApplication = ApplicationManager.application(1); } function test_properties() { @@ -152,23 +152,10 @@ TestCase { compare(simpleApplication.applicationProperties.pri1, undefined) } - function test_applicationAlias() { - // Test that the alias has the same info, be indentified as an alias and points to the original app - compare(applicationAlias.id, "tld.test.simple1@alias") - compare(applicationAlias.alias, true) - compare(applicationAlias.nonAliased, simpleApplication) - //TODO this should be a Url instead, as this is what's used in QML usually - compare(applicationAlias.icon.toString(), Qt.resolvedUrl("apps/tld.test.simple1/icon2.png")) - compare(applicationAlias.documentUrl, "x-test:alias") - compare(applicationAlias.runtimeName, simpleApplication.runtimeName) - compare(applicationAlias.capabilities, simpleApplication.capabilities) - compare(applicationAlias.supportedMimeTypes, simpleApplication.supportedMimeTypes) - } - function test_indexOfApplication() { // Test index of compare(ApplicationManager.indexOfApplication(simpleApplication.id), 0) - compare(ApplicationManager.indexOfApplication(applicationAlias.id), 1) + compare(ApplicationManager.indexOfApplication(capsApplication.id), 1) compare(ApplicationManager.indexOfApplication("error"), -1) } @@ -177,7 +164,7 @@ TestCase { var apps = ApplicationManager.applicationIds() compare(apps.length, ApplicationManager.count) compare(ApplicationManager.applicationIds()[0], simpleApplication.id) - compare(ApplicationManager.applicationIds()[1], applicationAlias.id) + compare(ApplicationManager.applicationIds()[1], capsApplication.id) } function test_capabilities() { @@ -214,18 +201,15 @@ TestCase { } function test_applicationModel() { - compare(appModel.count, 3); + compare(appModel.count, 2); compare(appModel.indexOfApplication(capsApplication.id), 0); - compare(appModel.indexOfApplication(applicationAlias.id), 1); - compare(appModel.indexOfApplication(simpleApplication.id), 2); + compare(appModel.indexOfApplication(simpleApplication.id), 1); compare(appModel.mapToSource(0), ApplicationManager.indexOfApplication(capsApplication.id)); - compare(appModel.mapFromSource(ApplicationManager.indexOfApplication(simpleApplication.id)), 2); + compare(appModel.mapFromSource(ApplicationManager.indexOfApplication(simpleApplication.id)), 1); appModel.sortFunction = undefined; compare(appModel.indexOfApplication(simpleApplication.id), ApplicationManager.indexOfApplication(simpleApplication.id)); - compare(appModel.indexOfApplication(applicationAlias.id), - ApplicationManager.indexOfApplication(applicationAlias.id)); compare(appModel.indexOfApplication(capsApplication.id), ApplicationManager.indexOfApplication(capsApplication.id)); @@ -235,7 +219,6 @@ TestCase { compare(appModelCountSpy.count, 1); compare(appModel.count, 1); compare(appModel.indexOfApplication(capsApplication.id), 0); - compare(appModel.indexOfApplication(applicationAlias.id), -1); compare(appModel.indexOfApplication(simpleApplication.id), -1); listView.model = appModel; @@ -243,21 +226,11 @@ TestCase { compare(listView.currentItem.modelData.name, "Caps"); listView.model = ApplicationManager; - var criteria = false; - appModel.filterFunction = function(app) { return app.alias === criteria; }; - appModelCountSpy.wait(1000); - compare(appModelCountSpy.count, 2); - compare(appModel.count, 2); - compare(appModel.indexOfApplication(applicationAlias.id), -1); - criteria = true; - appModel.invalidate(); - compare(appModel.count, 1); - appModel.filterFunction = function() {}; compare(appModel.count, 0); appModel.filterFunction = undefined; - compare(appModel.count, 3); + compare(appModel.count, 2); } function test_get_data() { @@ -318,11 +291,16 @@ TestCase { function test_startAndStopApplication_data() { return [ - {tag: "StartStop", appId: "tld.test.simple1", index: 0, forceKill: false, exitCode: 0, exitStatus: Am.NormalExit }, - {tag: "StartStopAlias", appId: "tld.test.simple1@alias", index: 0, forceKill: false, exitCode: 0, exitStatus: Am.NormalExit }, - {tag: "Debug", appId: "tld.test.simple1", index: 0, forceKill: false, exitCode: 0, exitStatus: Am.NormalExit }, - {tag: "ForceKill", appId: "tld.test.simple2", index: 2, forceKill: true, exitCode: Qt.platform.os !== 'windows' ? 9 : 0, exitStatus: Qt.platform.os !== 'windows' ? Am.ForcedExit : Am.CrashExit }, - {tag: "AutoTerminate", appId: "tld.test.simple2", index: 2, forceKill: false, exitCode: Qt.platform.os !== 'windows' ? 15 : 0, exitStatus: Qt.platform.os !== 'windows' ? Am.ForcedExit : Am.CrashExit } + {tag: "StartStop", appId: "tld.test.simple1", index: 0, forceKill: false, + exitCode: 0, exitStatus: Am.NormalExit }, + {tag: "Debug", appId: "tld.test.simple1", index: 0, forceKill: false, + exitCode: 0, exitStatus: Am.NormalExit }, + {tag: "ForceKill", appId: "tld.test.simple2", index: 1, forceKill: true, + exitCode: Qt.platform.os !== 'windows' ? 9 : 0, + exitStatus: Qt.platform.os !== 'windows' ? Am.ForcedExit : Am.CrashExit }, + {tag: "AutoTerminate", appId: "tld.test.simple2", index: 1, forceKill: false, + exitCode: Qt.platform.os !== 'windows' ? 15 : 0, + exitStatus: Qt.platform.os !== 'windows' ? Am.ForcedExit : Am.CrashExit } ]; } @@ -369,7 +347,9 @@ TestCase { function test_startAndStopAllApplications_data() { return [ - {tag: "StopAllApplications", appId1: "tld.test.simple1", index1: 0, appId2: "tld.test.simple2", index2: 2, forceKill: false, exitCode: 0, exitStatus: Am.NormalExit } + {tag: "StopAllApplications", appId1: "tld.test.simple1", index1: 0, + appId2: "tld.test.simple2", index2: 1, forceKill: false, exitCode: 0, + exitStatus: Am.NormalExit } ]; } @@ -408,12 +388,12 @@ TestCase { ApplicationManager.stopAllApplications(data.forceKill); - while (runStateChangedSpy.count < 6) + while (runStateChangedSpy.count < 4) runStateChangedSpy.wait(10000); var args = runStateChangedSpy.signalArguments - for (var i = 0; i < 6; ++i) { + for (var i = 0; i < 4; ++i) { var id = args[i][0] var state = args[i][1] @@ -460,7 +440,6 @@ TestCase { function test_openUrl_data() { return [ {tag: "customMimeType", url: "x-test://12345", expectedApp: simpleApplication.id }, - {tag: "openAlias", url: "x-test:alias", expectedApp: applicationAlias.id }, {tag: "text/plain", url: "file://text-file.txt", expectedApp: simpleApplication.id } ]; } diff --git a/tests/qml/windowitem/am-config.yaml b/tests/qml/windowitem/am-config.yaml index 34a4c56a..aa82540b 100644 --- a/tests/qml/windowitem/am-config.yaml +++ b/tests/qml/windowitem/am-config.yaml @@ -3,16 +3,8 @@ formatType: am-configuration --- applications: builtinAppsManifestDir: "${CONFIG_PWD}/apps" - installedAppsManifestDir: "/tmp/am/manifests" - appImageMountDir: "/tmp/am/image-mounts" - database: "/tmp/am/apps.db" - -installationLocations: -- id: "internal-0" - installationPath: "/tmp/am/apps" - documentPath: "/tmp/am/docs" - mountPoint: "/tmp" - isDefault: true + installationDir: "/tmp/am/apps" + documentDir: "/tmp/am/docs" # Workaround for a crash in the mesa software renderer (llvmpipe) runtimes: diff --git a/tests/qml/windowitem/apps/test.windowitem.app/main.qml b/tests/qml/windowitem/apps/test.windowitem.app/main.qml index 8f64f980..ee12db6f 100644 --- a/tests/qml/windowitem/apps/test.windowitem.app/main.qml +++ b/tests/qml/windowitem/apps/test.windowitem.app/main.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/windowitem/apps/test.windowitem.multiwin/main.qml b/tests/qml/windowitem/apps/test.windowitem.multiwin/main.qml index f12323be..7d1b0600 100644 --- a/tests/qml/windowitem/apps/test.windowitem.multiwin/main.qml +++ b/tests/qml/windowitem/apps/test.windowitem.multiwin/main.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/windowitem/tst_windowitem.qml b/tests/qml/windowitem/tst_windowitem.qml index ea835267..15cd4f5b 100644 --- a/tests/qml/windowitem/tst_windowitem.qml +++ b/tests/qml/windowitem/tst_windowitem.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/windowitem/windowitem.pro b/tests/qml/windowitem/windowitem.pro index d2755653..fcc1b1f6 100644 --- a/tests/qml/windowitem/windowitem.pro +++ b/tests/qml/windowitem/windowitem.pro @@ -1,4 +1,5 @@ AM_CONFIG = am-config.yaml TEST_FILES = tst_windowitem.qml +TEST_APPS = test.windowitem.app test.windowitem.multiwin load(am-qml-testcase) diff --git a/tests/qml/windowitem2/am-config.yaml b/tests/qml/windowitem2/am-config.yaml index ee4edd72..5333dae3 100644 --- a/tests/qml/windowitem2/am-config.yaml +++ b/tests/qml/windowitem2/am-config.yaml @@ -3,16 +3,6 @@ formatType: am-configuration --- applications: builtinAppsManifestDir: "${CONFIG_PWD}/apps" - installedAppsManifestDir: "/tmp/am-windowitem2/manifests" - appImageMountDir: "/tmp/am-windowitem2/image-mounts" - database: "/tmp/am-windowitem2/apps.db" - -installationLocations: -- id: "internal-0" - installationPath: "/tmp/am-windowitem2/apps" - documentPath: "/tmp/am-windowitem2/docs" - mountPoint: "/tmp" - isDefault: true # Workaround for a crash in the mesa software renderer (llvmpipe) runtimes: diff --git a/tests/qml/windowitem2/apps/test.windowitem2.app/main.qml b/tests/qml/windowitem2/apps/test.windowitem2.app/main.qml index 84dfdb3e..ab891bb8 100644 --- a/tests/qml/windowitem2/apps/test.windowitem2.app/main.qml +++ b/tests/qml/windowitem2/apps/test.windowitem2.app/main.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/windowitem2/tst_windowitem2.qml b/tests/qml/windowitem2/tst_windowitem2.qml index 5c411805..98d4ef30 100644 --- a/tests/qml/windowitem2/tst_windowitem2.qml +++ b/tests/qml/windowitem2/tst_windowitem2.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/windowitem2/windowitem2.pro b/tests/qml/windowitem2/windowitem2.pro index fe1ab58a..022ea053 100644 --- a/tests/qml/windowitem2/windowitem2.pro +++ b/tests/qml/windowitem2/windowitem2.pro @@ -1,4 +1,5 @@ AM_CONFIG = am-config.yaml TEST_FILES = tst_windowitem2.qml +TEST_APPS = test.windowitem2.app load(am-qml-testcase) diff --git a/tests/qml/windowmanager/IviApplicationExtension.qml b/tests/qml/windowmanager/IviApplicationExtension.qml index f85f147d..3e4a9700 100644 --- a/tests/qml/windowmanager/IviApplicationExtension.qml +++ b/tests/qml/windowmanager/IviApplicationExtension.qml @@ -3,7 +3,7 @@ ** Copyright (C) 2019 Luxoft Sweden AB ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/windowmanager/am-config.yaml b/tests/qml/windowmanager/am-config.yaml deleted file mode 100644 index d5d4813b..00000000 --- a/tests/qml/windowmanager/am-config.yaml +++ /dev/null @@ -1,14 +0,0 @@ -formatVersion: 1 -formatType: am-configuration ---- -applications: - installedAppsManifestDir: "/tmp/am/manifests" - appImageMountDir: "/tmp/am/image-mounts" - database: "/tmp/am/apps.db" - -installationLocations: -- id: "internal-0" - installationPath: "/tmp/am/apps" - documentPath: "/tmp/am/docs" - mountPoint: "/tmp" - isDefault: true diff --git a/tests/qml/windowmanager/tst_windowmanager.qml b/tests/qml/windowmanager/tst_windowmanager.qml index c2a556cd..11cb9265 100644 --- a/tests/qml/windowmanager/tst_windowmanager.qml +++ b/tests/qml/windowmanager/tst_windowmanager.qml @@ -3,7 +3,7 @@ ** Copyright (C) 2019 Luxoft Sweden AB ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/windowmanager/windowmanager.pro b/tests/qml/windowmanager/windowmanager.pro index d9b687eb..21cd8a91 100644 --- a/tests/qml/windowmanager/windowmanager.pro +++ b/tests/qml/windowmanager/windowmanager.pro @@ -1,4 +1,5 @@ -AM_CONFIG = am-config.yaml TEST_FILES = tst_windowmanager.qml +OTHER_FILES += IviApplicationExtension.qml + load(am-qml-testcase) diff --git a/tests/qml/windowmapping/am-config.yaml b/tests/qml/windowmapping/am-config.yaml index 34a4c56a..5333dae3 100644 --- a/tests/qml/windowmapping/am-config.yaml +++ b/tests/qml/windowmapping/am-config.yaml @@ -3,16 +3,6 @@ formatType: am-configuration --- applications: builtinAppsManifestDir: "${CONFIG_PWD}/apps" - installedAppsManifestDir: "/tmp/am/manifests" - appImageMountDir: "/tmp/am/image-mounts" - database: "/tmp/am/apps.db" - -installationLocations: -- id: "internal-0" - installationPath: "/tmp/am/apps" - documentPath: "/tmp/am/docs" - mountPoint: "/tmp" - isDefault: true # Workaround for a crash in the mesa software renderer (llvmpipe) runtimes: diff --git a/tests/qml/windowmapping/apps/test.winmap.amwin/amwin.qml b/tests/qml/windowmapping/apps/test.winmap.amwin/amwin.qml index 470d6dc0..a93f30d4 100644 --- a/tests/qml/windowmapping/apps/test.winmap.amwin/amwin.qml +++ b/tests/qml/windowmapping/apps/test.winmap.amwin/amwin.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/windowmapping/apps/test.winmap.amwin2/amwin2.qml b/tests/qml/windowmapping/apps/test.winmap.amwin2/amwin2.qml index 8c104a05..b10709d3 100644 --- a/tests/qml/windowmapping/apps/test.winmap.amwin2/amwin2.qml +++ b/tests/qml/windowmapping/apps/test.winmap.amwin2/amwin2.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/windowmapping/apps/test.winmap.loader/SubWin.qml b/tests/qml/windowmapping/apps/test.winmap.loader/SubWin.qml index af0001d6..8ba50e22 100644 --- a/tests/qml/windowmapping/apps/test.winmap.loader/SubWin.qml +++ b/tests/qml/windowmapping/apps/test.winmap.loader/SubWin.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/windowmapping/apps/test.winmap.loader/loader.qml b/tests/qml/windowmapping/apps/test.winmap.loader/loader.qml index 569fef1a..0a65690e 100644 --- a/tests/qml/windowmapping/apps/test.winmap.loader/loader.qml +++ b/tests/qml/windowmapping/apps/test.winmap.loader/loader.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/windowmapping/apps/test.winmap.ping/ping.qml b/tests/qml/windowmapping/apps/test.winmap.ping/ping.qml index 59267c04..6fa9ba23 100644 --- a/tests/qml/windowmapping/apps/test.winmap.ping/ping.qml +++ b/tests/qml/windowmapping/apps/test.winmap.ping/ping.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/windowmapping/apps/test.winmap.qtobject/qtobject.qml b/tests/qml/windowmapping/apps/test.winmap.qtobject/qtobject.qml index c1c8ba3d..325c04de 100644 --- a/tests/qml/windowmapping/apps/test.winmap.qtobject/qtobject.qml +++ b/tests/qml/windowmapping/apps/test.winmap.qtobject/qtobject.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/windowmapping/apps/test.winmap.rectangle/rectangle.qml b/tests/qml/windowmapping/apps/test.winmap.rectangle/rectangle.qml index 718b787d..fe6cdee3 100644 --- a/tests/qml/windowmapping/apps/test.winmap.rectangle/rectangle.qml +++ b/tests/qml/windowmapping/apps/test.winmap.rectangle/rectangle.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/windowmapping/apps/test.winmap.window/window.qml b/tests/qml/windowmapping/apps/test.winmap.window/window.qml index c10a57b0..a0832d15 100644 --- a/tests/qml/windowmapping/apps/test.winmap.window/window.qml +++ b/tests/qml/windowmapping/apps/test.winmap.window/window.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/windowmapping/tst_windowmapping.qml b/tests/qml/windowmapping/tst_windowmapping.qml index 00a6e582..dda075e5 100644 --- a/tests/qml/windowmapping/tst_windowmapping.qml +++ b/tests/qml/windowmapping/tst_windowmapping.qml @@ -4,7 +4,7 @@ ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Luxoft Application Manager. +** This file is part of the Qt Application Manager. ** ** $QT_BEGIN_LICENSE:LGPL-QTAS$ ** Commercial License Usage diff --git a/tests/qml/windowmapping/windowmapping.pro b/tests/qml/windowmapping/windowmapping.pro index 59fa55b0..e29aba28 100644 --- a/tests/qml/windowmapping/windowmapping.pro +++ b/tests/qml/windowmapping/windowmapping.pro @@ -1,4 +1,12 @@ AM_CONFIG = am-config.yaml TEST_FILES = tst_windowmapping.qml +TEST_APPS = \ + test.winmap.amwin \ + test.winmap.amwin2 \ + test.winmap.loader \ + test.winmap.ping \ + test.winmap.qtobject \ + test.winmap.rectangle \ + test.winmap.window \ load(am-qml-testcase) |