aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/debugger
diff options
context:
space:
mode:
authorAurindam Jana <aurindam.jana@nokia.com>2011-12-14 12:50:41 +0100
committerQt by Nokia <qt-info@nokia.com>2011-12-14 20:25:06 +0100
commite133073a7e8ae28b0b0d5c0c29ea7941767744d8 (patch)
treeb4b24efce2a2b81f92a4f03437b21739ac63f10e /tests/auto/declarative/debugger
parent4e2924fbc30905a136cc54f229f1906b11602c3e (diff)
QV8DebugService: Add breakaftercompile
Add breakaftercompile command that will set the v8::DebugBreak() whenever a new script is compiled. Change-Id: Id9027066826b6de621058d3170fa628463ef0152 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Diffstat (limited to 'tests/auto/declarative/debugger')
-rw-r--r--tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp b/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp
index 8b40b64bdb..0f9da032e8 100644
--- a/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp
+++ b/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp
@@ -107,6 +107,7 @@ const char *GARBAGECOLLECTOR = "gc";
const char *CONNECT = "connect";
const char *INTERRUPT = "interrupt";
+const char *BREAKAFTERCOMPILE = "breakaftercompile";
const char *REQUEST = "request";
const char *IN = "in";
@@ -172,6 +173,7 @@ private slots:
void connect();
void interrupt();
+ void breakAfterCompile();
void getVersion();
void getVersionWhenAttaching();
@@ -267,6 +269,7 @@ public:
void connect();
void interrupt();
+ void breakAfterCompile(bool enabled);
void continueDebugging(StepAction stepAction, int stepCount = 1);
void evaluate(QString expr, bool global = false, bool disableBreak = false, int frame = -1, const QVariantMap &addContext = QVariantMap());
@@ -297,6 +300,7 @@ signals:
void enabled();
void connected();
void interruptRequested();
+ void breakAfterCompileRequested();
void result();
void stopped();
@@ -327,6 +331,14 @@ void QJSDebugClient::interrupt()
sendMessage(packMessage(INTERRUPT));
}
+void QJSDebugClient::breakAfterCompile(bool enabled)
+{
+ QByteArray request;
+ QDataStream rs(&request, QIODevice::WriteOnly);
+ rs << enabled;
+ sendMessage(packMessage(BREAKAFTERCOMPILE, request));
+}
+
void QJSDebugClient::continueDebugging(StepAction action, int count)
{
// { "seq" : <number>,
@@ -935,6 +947,10 @@ void QJSDebugClient::messageReceived(const QByteArray &data)
event == "exception")
emit stopped();
}
+
+ } else if (type == BREAKAFTERCOMPILE) {
+ emit breakAfterCompileRequested();
+
}
}
}
@@ -1051,6 +1067,18 @@ void tst_QDeclarativeDebugJS::interrupt()
QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(interruptRequested())));
}
+void tst_QDeclarativeDebugJS::breakAfterCompile()
+{
+ //void breakAfterCompile(bool enabled)
+
+ QVERIFY(init());
+ client->breakAfterCompile(true);
+ client->connect();
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(breakAfterCompileRequested())));
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped())));
+}
+
void tst_QDeclarativeDebugJS::getVersion()
{
//void version()