summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristoph VogtlÃĪnder <c.vogtlaender@sigma-surface-science.com>2015-03-11 10:10:43 +0100
committerKarsten Heimrich <karsten.heimrich@theqtcompany.com>2015-03-13 10:16:51 +0000
commit17e29fc8d3e7d524ce6207c23ac62525811ef189 (patch)
tree7ae795b5a7673508762ab3e8d171855332e9529e /tests
parent0a49b33773e6ff2ec7ec4278b0a5a380f58457b0 (diff)
fix empty installer.components array
Make sure the current list of components is used when referencing installer.components in a controller script. Change-Id: I9468110d61a958f13edba66da0059d6622aa7037 Task-number: QTIFW-601 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/installer/scriptengine/tst_scriptengine.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/installer/scriptengine/tst_scriptengine.cpp b/tests/auto/installer/scriptengine/tst_scriptengine.cpp
index 23c4b2c4c..0bbb79060 100644
--- a/tests/auto/installer/scriptengine/tst_scriptengine.cpp
+++ b/tests/auto/installer/scriptengine/tst_scriptengine.cpp
@@ -200,6 +200,8 @@ private slots:
QCOMPARE(global.hasProperty(QLatin1String("InstallerProxy")), true);
QCOMPARE(global.property(QLatin1String("InstallerProxy"))
.hasProperty(QLatin1String("componentByName")), true);
+ QCOMPARE(global.property(QLatin1String("InstallerProxy"))
+ .hasProperty(QLatin1String("components")), true);
QCOMPARE(global.hasProperty(QLatin1String("QDesktopServices")), true);
QCOMPARE(global.property(QLatin1String("QDesktopServices"))
@@ -302,6 +304,20 @@ private slots:
QCOMPARE(value.isError(), true);
}
+ void testComponents()
+ {
+ const QString script = QString::fromLatin1("var components = installer.components();"
+ "\n"
+ "print(components[0].name);");
+
+ setExpectedScriptOutput("\"component.test.name\"");
+ const QJSValue value = m_scriptEngine->evaluate(script);
+ if (value.isError()) {
+ QFAIL(qPrintable(QString::fromLatin1("ScriptEngine error:\n %1").arg(
+ value.toString())));
+ }
+ }
+
void loadSimpleComponentScript()
{
try {