aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp')
-rw-r--r--tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
index 424a3b36ac..e5a7af630a 100644
--- a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
+++ b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
@@ -139,6 +139,7 @@ const char *EXCEPTION_QMLFILE = "exception.qml";
const char *ONCOMPLETED_QMLFILE = "oncompleted.qml";
const char *CREATECOMPONENT_QMLFILE = "createComponent.qml";
const char *CONDITION_QMLFILE = "condition.qml";
+const char *QUIT_QMLFILE = "quit.qml";
const char *CHANGEBREAKPOINT_QMLFILE = "changeBreakpoint.qml";
const char *STEPACTION_QMLFILE = "stepAction.qml";
const char *BREAKPOINTRELOCATION_QMLFILE = "breakpointRelocation.qml";
@@ -196,6 +197,7 @@ private slots:
void setBreakpointInScriptOnEmptyLine();
void setBreakpointInScriptOnOptimizedBinding();
void setBreakpointInScriptWithCondition();
+ void setBreakpointInScriptThatQuits();
//void setBreakpointInFunction(); //NOT SUPPORTED
void setBreakpointOnEvent();
// void setBreakpointWhenAttaching();
@@ -1338,6 +1340,29 @@ void tst_QQmlDebugJS::setBreakpointInScriptWithCondition()
QVERIFY(body.value("value").toInt() > out);
}
+void tst_QQmlDebugJS::setBreakpointInScriptThatQuits()
+{
+ QVERIFY(init(QUIT_QMLFILE));
+
+ int sourceLine = 49;
+
+ client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(QUIT_QMLFILE), sourceLine, -1, true);
+ client->connect();
+ QVERIFY(QQmlDebugTest::waitForSignal(client, SIGNAL(stopped())));
+
+ QString jsonString(client->response);
+ QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap();
+
+ QVariantMap body = value.value("body").toMap();
+
+ QCOMPARE(body.value("sourceLine").toInt(), sourceLine);
+ QCOMPARE(QFileInfo(body.value("script").toMap().value("name").toString()).fileName(), QLatin1String(QUIT_QMLFILE));
+
+ client->continueDebugging(QJSDebugClient::Continue);
+ QVERIFY(process->waitForFinished());
+ QCOMPARE(process->exitStatus(), QProcess::NormalExit);
+}
+
/* TODO fails because of a race condition when starting up the engine before the view
void tst_QQmlDebugJS::setBreakpointWhenAttaching()
{