Changeset View
Changeset View
Standalone View
Standalone View
autotests/src/bug313759.cpp
Show All 18 Lines | |||||
19 | 19 | | |||
20 | #include "bug313759.h" | 20 | #include "bug313759.h" | ||
21 | 21 | | |||
22 | #include <katedocument.h> | 22 | #include <katedocument.h> | ||
23 | #include <kateglobal.h> | 23 | #include <kateglobal.h> | ||
24 | #include <kateview.h> | 24 | #include <kateview.h> | ||
25 | #include <kmainwindow.h> | 25 | #include <kmainwindow.h> | ||
26 | 26 | | |||
27 | #include <QtScript/QScriptEngine> | 27 | #include <QtQml/QJSEngine> | ||
28 | #include <QtTestWidgets> | 28 | #include <QtTestWidgets> | ||
29 | 29 | | |||
30 | #include "testutils.h" | 30 | #include "testutils.h" | ||
31 | 31 | | |||
32 | QTEST_MAIN(BugTest) | 32 | QTEST_MAIN(BugTest) | ||
33 | 33 | | |||
34 | using namespace KTextEditor; | 34 | using namespace KTextEditor; | ||
35 | 35 | | |||
Show All 25 Lines | 55 | { | |||
61 | TestScriptEnv *env = new TestScriptEnv(doc, outputWasCustomised); | 61 | TestScriptEnv *env = new TestScriptEnv(doc, outputWasCustomised); | ||
62 | const QUrl url = QUrl::fromLocalFile(QLatin1String(TEST_DATA_DIR"bug313759.txt")); | 62 | const QUrl url = QUrl::fromLocalFile(QLatin1String(TEST_DATA_DIR"bug313759.txt")); | ||
63 | doc->openUrl(url); | 63 | doc->openUrl(url); | ||
64 | 64 | | |||
65 | // load moveLinesDown and moveLinesUp | 65 | // load moveLinesDown and moveLinesUp | ||
66 | QFile scriptFile(QLatin1String(JS_DATA_DIR "commands/utils.js")); | 66 | QFile scriptFile(QLatin1String(JS_DATA_DIR "commands/utils.js")); | ||
67 | QVERIFY(scriptFile.exists()); | 67 | QVERIFY(scriptFile.exists()); | ||
68 | QVERIFY(scriptFile.open(QFile::ReadOnly)); | 68 | QVERIFY(scriptFile.open(QFile::ReadOnly)); | ||
69 | QScriptValue result = env->engine()->evaluate(QString::fromLatin1(scriptFile.readAll()), scriptFile.fileName()); | 69 | QJSValue result = env->engine()->evaluate(QString::fromLatin1(scriptFile.readAll()), scriptFile.fileName()); | ||
70 | QVERIFY2(!result.isError(), qPrintable(QString(result.toString() + QLatin1String("\nat ") | 70 | QVERIFY2(!result.isError(), result.toString().toUtf8().constData()); | ||
71 | + env->engine()->uncaughtExceptionBacktrace().join(QStringLiteral("\n"))))); | | |||
72 | 71 | | |||
73 | // enable on the fly spell checking | 72 | // enable on the fly spell checking | ||
74 | doc->onTheFlySpellCheckingEnabled(true); | 73 | doc->onTheFlySpellCheckingEnabled(true); | ||
75 | 74 | | |||
76 | // view must be visible... | 75 | // view must be visible... | ||
77 | view->show(); | 76 | view->show(); | ||
78 | view->resize(900, 800); | 77 | view->resize(900, 800); | ||
79 | view->setCursorPosition(Cursor(0, 0)); | 78 | view->setCursorPosition(Cursor(0, 0)); | ||
Show All 18 Lines |