aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/debugger
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2016-01-20 13:57:16 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2016-01-21 14:49:43 +0000
commitce093497f2d4164fa8abc06cf976f9e36798e11e (patch)
tree98c3926f5a64b4bf8f8b3838b6fbcde8ad9152c7 /tests/auto/qml/debugger
parentebb08ee84e8141042ed16dfc5892697ef96077c4 (diff)
Clean up QV4DataCollector
We don't need to pass engines around as the data collector already has all the necessary information. Also, the exception collect job is only used in the test case, so we don't need to define it in the collector. Change-Id: I9e9f092a10295e3dc970f7b5f440e8f242ea1d54 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'tests/auto/qml/debugger')
-rw-r--r--tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
index 7398e97326..1b2df62b76 100644
--- a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
+++ b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
@@ -93,6 +93,23 @@ signals:
void evaluateFinished();
};
+class ExceptionCollectJob: public CollectJob
+{
+ QV4DataCollector::Ref exception;
+
+public:
+ ExceptionCollectJob(QV4DataCollector *collector) :
+ CollectJob(collector), exception(-1) {}
+
+ void run() {
+ QV4::Scope scope(collector->engine());
+ QV4::ScopedValue v(scope, *collector->engine()->exceptionValue);
+ exception = collector->collect(v);
+ }
+
+ QV4DataCollector::Ref exceptionValue() const { return exception; }
+};
+
class TestAgent : public QObject
{
Q_OBJECT
@@ -170,7 +187,7 @@ public slots:
m_statesWhenPaused << debugger->currentExecutionState();
if (debugger->state() == QV4Debugger::Paused && debugger->engine()->hasException) {
- ExceptionCollectJob job(debugger->engine(), &collector);
+ ExceptionCollectJob job(&collector);
debugger->runInEngine(&job);
m_thrownValue = job.exceptionValue();
}