diff options
author | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-09-05 15:31:08 +0200 |
---|---|---|
committer | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-09-06 10:11:04 +0200 |
commit | af44559780765c7121a49c2e0764cf24e740312d (patch) | |
tree | a4f2f50ddfe969f33a4d4accd392523c6809fd5a /tests/auto/qml | |
parent | 8784a4a46ea1357bde546c9a1c88bd060e863f30 (diff) | |
parent | b30d7c9ee8fbc3a395c74b618f2ab176ae1e7f7e (diff) |
Merge branch 'stable' into dev
Conflicts:
src/qml/debugger/qv8debugservice.cpp
src/qml/qml/v8/qv8engine.cpp
tests/auto/quick/qquickitem/qquickitem.pro
Change-Id: Ic4a1dcdd8b8a84155d2f2abefdf1da5c3a56af31
Diffstat (limited to 'tests/auto/qml')
-rw-r--r-- | tests/auto/qml/debugger/qqmldebugjs/data/quit.qml | 53 | ||||
-rw-r--r-- | tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp | 25 | ||||
-rw-r--r-- | tests/auto/qml/debugger/shared/debugutil.cpp | 10 | ||||
-rw-r--r-- | tests/auto/qml/debugger/shared/debugutil_p.h | 3 | ||||
-rw-r--r-- | tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 1 |
5 files changed, 91 insertions, 1 deletions
diff --git a/tests/auto/qml/debugger/qqmldebugjs/data/quit.qml b/tests/auto/qml/debugger/qqmldebugjs/data/quit.qml new file mode 100644 index 0000000000..47acceba2a --- /dev/null +++ b/tests/auto/qml/debugger/qqmldebugjs/data/quit.qml @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +//DO NOT CHANGE + +Item { + Timer { + running: true + triggeredOnStart: true + onTriggered: Qt.quit(); + } +} + 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() { diff --git a/tests/auto/qml/debugger/shared/debugutil.cpp b/tests/auto/qml/debugger/shared/debugutil.cpp index ff3140f520..ab27337d41 100644 --- a/tests/auto/qml/debugger/shared/debugutil.cpp +++ b/tests/auto/qml/debugger/shared/debugutil.cpp @@ -168,6 +168,16 @@ int QQmlDebugProcess::debugPort() const return m_port; } +bool QQmlDebugProcess::waitForFinished() +{ + return m_process.waitForFinished(); +} + +QProcess::ExitStatus QQmlDebugProcess::exitStatus() const +{ + return m_process.exitStatus(); +} + void QQmlDebugProcess::setEnvironment(const QStringList &environment) { m_environment = environment; diff --git a/tests/auto/qml/debugger/shared/debugutil_p.h b/tests/auto/qml/debugger/shared/debugutil_p.h index 11b16a1fb8..9f9a852fb6 100644 --- a/tests/auto/qml/debugger/shared/debugutil_p.h +++ b/tests/auto/qml/debugger/shared/debugutil_p.h @@ -95,6 +95,9 @@ public: bool waitForSessionStart(); int debugPort() const; + bool waitForFinished(); + QProcess::ExitStatus exitStatus() const; + QString output() const; void stop(); diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index ec5eaf2017..b5c8edf5f3 100644 --- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp +++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp @@ -245,7 +245,6 @@ private: void tst_qqmllanguage::cleanupTestCase() { QVERIFY(QFile::remove(testFile(QString::fromUtf8("I18nType\303\201\303\242\303\243\303\244\303\245.qml")))); - qmlClearTypeRegistrations(); // Should not crash } void tst_qqmllanguage::insertedSemicolon_data() |