diff options
Diffstat (limited to 'tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp')
-rw-r--r-- | tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp | 91 |
1 files changed, 33 insertions, 58 deletions
diff --git a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp index 9e801f6f3f..0daaa394ae 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp +++ b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "debugutil_p.h" #include "qqmldebugprocess_p.h" @@ -192,7 +167,7 @@ void tst_QQmlDebugJS::initTestCase() #endif QQmlDebugTest::initTestCase(); } - +#include <iostream> QQmlDebugTest::ConnectResult tst_QQmlDebugJS::init(bool qmlscene, const QString &qmlFile, bool blockMode, bool restrictServices) { @@ -286,7 +261,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnCompleted() //void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = false, QString condition = QString(), int ignoreCount = -1) QFETCH(bool, qmlscene); - int sourceLine = 34; + int sourceLine = 9; QCOMPARE(init(qmlscene, ONCOMPLETED_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true); @@ -305,7 +280,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnComponentCreated() //void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = false, QString condition = QString(), int ignoreCount = -1) QFETCH(bool, qmlscene); - int sourceLine = 34; + int sourceLine = 9; QCOMPARE(init(qmlscene, CREATECOMPONENT_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true); @@ -323,7 +298,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnTimerCallback() { QFETCH(bool, qmlscene); - int sourceLine = 35; + int sourceLine = 10; QCOMPARE(init(qmlscene, TIMER_QMLFILE), ConnectSuccess); m_client->connect(); @@ -344,7 +319,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptInDifferentFile() //void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = false, QString condition = QString(), int ignoreCount = -1) QFETCH(bool, qmlscene); - int sourceLine = 31; + int sourceLine = 6; QCOMPARE(init(qmlscene, LOADJSFILE_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(TEST_JSFILE), sourceLine, -1, true); @@ -363,8 +338,8 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnComment() //void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = false, QString condition = QString(), int ignoreCount = -1) QFETCH(bool, qmlscene); - int sourceLine = 34; - int actualLine = 36; + int sourceLine = 9; + int actualLine = 11; QCOMPARE(init(qmlscene, BREAKPOINTRELOCATION_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(BREAKPOINTRELOCATION_QMLFILE), sourceLine, -1, true); @@ -384,8 +359,8 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnEmptyLine() //void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = false, QString condition = QString(), int ignoreCount = -1) QFETCH(bool, qmlscene); - int sourceLine = 35; - int actualLine = 36; + int sourceLine = 10; + int actualLine = 11; QCOMPARE(init(qmlscene, BREAKPOINTRELOCATION_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(BREAKPOINTRELOCATION_QMLFILE), sourceLine, -1, true); @@ -405,7 +380,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnOptimizedBinding() //void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = false, QString condition = QString(), int ignoreCount = -1) QFETCH(bool, qmlscene); - int sourceLine = 39; + int sourceLine = 14; QCOMPARE(init(qmlscene, BREAKPOINTRELOCATION_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(BREAKPOINTRELOCATION_QMLFILE), sourceLine, -1, true); @@ -424,7 +399,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptWithCondition() QFETCH(bool, qmlscene); int out = 10; - int sourceLine = 37; + int sourceLine = 12; QCOMPARE(init(qmlscene, CONDITION_QMLFILE), ConnectSuccess); m_client->connect(); @@ -457,7 +432,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptThatQuits() QCOMPARE(init(qmlscene, QUIT_QMLFILE), ConnectSuccess); - int sourceLine = 36; + int sourceLine = 11; m_client->setBreakpoint(QLatin1String(QUIT_QMLFILE), sourceLine, -1, true); m_client->connect(); @@ -517,7 +492,7 @@ void tst_QQmlDebugJS::setBreakpointInJavaScript() void tst_QQmlDebugJS::setBreakpointWhenAttaching() { - int sourceLine = 35; + int sourceLine = 10; QCOMPARE(init(true, QLatin1String(TIMER_QMLFILE), false), ConnectSuccess); m_client->connect(); @@ -537,8 +512,8 @@ void tst_QQmlDebugJS::clearBreakpoint() //void clearBreakpoint(int breakpoint); QFETCH(bool, qmlscene); - int sourceLine1 = 37; - int sourceLine2 = 38; + int sourceLine1 = 12; + int sourceLine2 = 13; QCOMPARE(init(qmlscene, CHANGEBREAKPOINT_QMLFILE), ConnectSuccess); m_client->connect(); @@ -583,8 +558,8 @@ void tst_QQmlDebugJS::changeBreakpoint() //void clearBreakpoint(int breakpoint); QFETCH(bool, qmlscene); - int sourceLine2 = 37; - int sourceLine1 = 38; + int sourceLine2 = 12; + int sourceLine1 = 13; const QString file = QLatin1String(CHANGEBREAKPOINT_QMLFILE); QCOMPARE(init(qmlscene, file), ConnectSuccess); @@ -670,7 +645,7 @@ void tst_QQmlDebugJS::stepNext() //void continueDebugging(StepAction stepAction, int stepCount = 1); QFETCH(bool, qmlscene); - int sourceLine = 37; + int sourceLine = 12; QCOMPARE(init(qmlscene, STEPACTION_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(STEPACTION_QMLFILE), sourceLine, -1, true); @@ -697,8 +672,8 @@ void tst_QQmlDebugJS::stepIn() //void continueDebugging(StepAction stepAction, int stepCount = 1); QFETCH(bool, qmlscene); - int sourceLine = 41; - int actualLine = 36; + int sourceLine = 16; + int actualLine = 11; QCOMPARE(init(qmlscene, STEPACTION_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(STEPACTION_QMLFILE), sourceLine, 1, true); @@ -719,8 +694,8 @@ void tst_QQmlDebugJS::stepOut() //void continueDebugging(StepAction stepAction, int stepCount = 1); QFETCH(bool, qmlscene); - int sourceLine = 37; - int actualLine = 41; + int sourceLine = 12; + int actualLine = 16; QCOMPARE(init(qmlscene, STEPACTION_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(STEPACTION_QMLFILE), sourceLine, -1, true); @@ -741,8 +716,8 @@ void tst_QQmlDebugJS::continueDebugging() //void continueDebugging(StepAction stepAction, int stepCount = 1); QFETCH(bool, qmlscene); - int sourceLine1 = 41; - int sourceLine2 = 38; + int sourceLine1 = 16; + int sourceLine2 = 13; QCOMPARE(init(qmlscene, STEPACTION_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(STEPACTION_QMLFILE), sourceLine1, -1, true); @@ -765,7 +740,7 @@ void tst_QQmlDebugJS::backtrace() //void backtrace(int fromFrame = -1, int toFrame = -1, bool bottom = false); QFETCH(bool, qmlscene); - int sourceLine = 34; + int sourceLine = 9; QCOMPARE(init(qmlscene, ONCOMPLETED_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true); @@ -781,7 +756,7 @@ void tst_QQmlDebugJS::getFrameDetails() //void frame(int number = -1); QFETCH(bool, qmlscene); - int sourceLine = 34; + int sourceLine = 9; QCOMPARE(init(qmlscene, ONCOMPLETED_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true); @@ -797,7 +772,7 @@ void tst_QQmlDebugJS::getScopeDetails() //void scope(int number = -1, int frameNumber = -1); QFETCH(bool, qmlscene); - int sourceLine = 34; + int sourceLine = 9; QCOMPARE(init(qmlscene, ONCOMPLETED_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true); @@ -831,7 +806,7 @@ void tst_QQmlDebugJS::evaluateInLocalScope() //void evaluate(QString expr, bool global = false, bool disableBreak = false, int frame = -1, const QVariantMap &addContext = QVariantMap()); QFETCH(bool, qmlscene); - int sourceLine = 34; + int sourceLine = 9; QCOMPARE(init(qmlscene, ONCOMPLETED_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true); @@ -921,7 +896,7 @@ void tst_QQmlDebugJS::getScripts() QCOMPARE(init(qmlscene), ConnectSuccess); - m_client->setBreakpoint(QString(TEST_QMLFILE), 35, -1, true); + m_client->setBreakpoint(QString(TEST_QMLFILE), 10, -1, true); m_client->connect(); QVERIFY(waitForClientSignal(SIGNAL(stopped()))); @@ -1019,8 +994,8 @@ void tst_QQmlDebugJS::breakOnAnchor() qWarning() << "received failure" << m_client->response().body; }); - m_client->setBreakpoint(file, 34); - m_client->setBreakpoint(file, 37); + m_client->setBreakpoint(file, 9); + m_client->setBreakpoint(file, 12); QTRY_COMPARE(m_process->state(), QProcess::Running); |