summaryrefslogtreecommitdiffstats
path: root/tests/auto/installer/messageboxhandler
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@digia.com>2013-05-08 13:26:41 +0200
committerTim Jenssen <tim.jenssen@digia.com>2013-05-16 16:12:52 +0200
commit06449248ab638d3ebb23f03e56450f10b4acbb5c (patch)
treea4fb331a237b6ad5bcf2857f75fe689b505386a5 /tests/auto/installer/messageboxhandler
parent89ee32bea7d9cdfb426d3400e940a6b006b2b2f7 (diff)
introduce installerscriptengine
- it uses one scriptengine for everything and adds the components or/and the install-controller in javascript closure contexts - added the gui object to the component script context - removed tabController from controlscript context Change-Id: I3bd6c5dcf470666c30add1b7d04a8fdd094f5f11 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
Diffstat (limited to 'tests/auto/installer/messageboxhandler')
-rw-r--r--tests/auto/installer/messageboxhandler/tst_messageboxhandler.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/auto/installer/messageboxhandler/tst_messageboxhandler.cpp b/tests/auto/installer/messageboxhandler/tst_messageboxhandler.cpp
index f705154b5..604b8e0a0 100644
--- a/tests/auto/installer/messageboxhandler/tst_messageboxhandler.cpp
+++ b/tests/auto/installer/messageboxhandler/tst_messageboxhandler.cpp
@@ -1,5 +1,7 @@
-#include "messageboxhandler.h"
-#include "qinstallerglobal.h"
+#include <messageboxhandler.h>
+#include <qinstallerglobal.h>
+#include <scriptengine.h>
+#include <packagemanagercore.h>
#include <QTest>
#include <QMetaEnum>
@@ -43,23 +45,24 @@ private slots:
if (enumValue == QMessageBox::LastButton)
break;
}
- QInstaller::registerMessageBox(&m_scriptEngine);
}
void testScriptButtonValues()
{
+ PackageManagerCore core;
+ ScriptEngine scriptEngine(&core);
QMapIterator<QMessageBox::StandardButton, QString> i(m_standardButtonValueMap);
while (i.hasNext()) {
i.next();
QString scriptString = QString::fromLatin1("QMessageBox.%1").arg(i.value());
- QScriptValue scriptValue(m_scriptEngine.evaluate(scriptString));
+ QScriptValue scriptValue(scriptEngine.evaluate(scriptString));
QVERIFY2(!scriptValue.isUndefined(), qPrintable(
QString::fromLatin1("It seems that %1 is undefined.").arg(scriptString)));
qint32 evaluatedValue = scriptValue.toInt32();
- QVERIFY2(!m_scriptEngine.hasUncaughtException(), qPrintable(
- QInstaller::uncaughtExceptionString(&m_scriptEngine)));
+ QVERIFY2(!scriptEngine.hasUncaughtException(), qPrintable(
+ QInstaller::uncaughtExceptionString(&scriptEngine)));
QCOMPARE(static_cast<QMessageBox::StandardButton>(evaluatedValue), i.key());
}
@@ -109,7 +112,6 @@ private slots:
private:
QMap<QMessageBox::StandardButton, QString> m_standardButtonValueMap;
int m_maxStandardButtons;
- QScriptEngine m_scriptEngine;
};
QTEST_MAIN(tst_MessageBoxHandler)