diff options
Diffstat (limited to 'tests')
88 files changed, 1901 insertions, 220 deletions
diff --git a/tests/auto/declarative/qdeclarativedebugjs/app/app.pro b/tests/auto/declarative/qdeclarativedebugjs/app/app.pro new file mode 100644 index 0000000..800c033 --- /dev/null +++ b/tests/auto/declarative/qdeclarativedebugjs/app/app.pro @@ -0,0 +1,12 @@ +TEMPLATE = app + +QT += declarative + +CONFIG += console +CONFIG -= app_bundle + +DESTDIR = ./ + +INSTALLS = + +SOURCES += main.cpp diff --git a/tests/auto/declarative/qdeclarativedebugjs/app/main.cpp b/tests/auto/declarative/qdeclarativedebugjs/app/main.cpp new file mode 100644 index 0000000..f5b830e --- /dev/null +++ b/tests/auto/declarative/qdeclarativedebugjs/app/main.cpp @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QApplication> +#include <QDebug> +#include <QDeclarativeComponent> +#include <QDeclarativeEngine> +#include <QStringList> +#include <QtDeclarative/private/qdeclarativedebughelper_p.h> +#include <QtDeclarative/private/qdeclarativedebugservice_p.h> + +int main(int argc, char *argv[]) +{ + QDeclarativeDebugHelper::enableDebugging(); + + QApplication app(argc, argv); + + const QUrl path = QUrl::fromLocalFile(app.arguments().last()); + + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, path); + + if (!component.isReady()) { + qWarning() << component.errorString(); + return -1; + } + + QObject *obj = component.create(); + +// printf("%u\n", QDeclarativeDebugService::idForObject(obj)); +// fflush(stdout); + + return app.exec(); +} diff --git a/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.js b/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.js new file mode 100644 index 0000000..f96f8e9 --- /dev/null +++ b/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.js @@ -0,0 +1,28 @@ +function function2InScript(a) +{ + logger("return function2InScript"); + root.result = a; +} + +function functionInScript(a, b) +{ + logger("enter functionInScript"); + var names = ["Clark Kent", "Peter Parker", "Bruce Wayne"]; + var aliases = ["Superman", "Spiderman", "Batman"]; + var details = { + category: "Superheroes", + names: names, + aliases: aliases + }; + function2InScript(a + b); + logger("return functionInScript"); + return details; +} + +function logger(msg) +{ + //console.log(msg); + return true; +} + +//DO NOT CHANGE CODE ABOVE THIS LINE diff --git a/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.qml b/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.qml new file mode 100644 index 0000000..f062bb9 --- /dev/null +++ b/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.qml @@ -0,0 +1,41 @@ +import QtQuick 1.0 +import "backtrace1.js" as Script + +Item { + id: root + + property int result:0 + + Component.onCompleted: + { + root.result = 10; + Script.functionInScript(4,5); + root.name = "nemo"; + Script.logger(root.simpleBinding); + } + + //DO NOT CHANGE CODE ABOVE + //ADD CODE FROM HERE + + property string name + property int simpleBinding: result + + VisualItemModel { + id: itemModel + Rectangle { height: 30; width: 80; color: "red" } + Rectangle { height: 30; width: 80; color: "green" } + Rectangle { height: 30; width: 80; color: "blue" } + } + + ListView { + anchors.fill: parent + model: itemModel + + Component.onCompleted: + { + Script.logger("List Loaded"); + } + } + +} + diff --git a/tests/auto/declarative/qdeclarativedebugjs/qdeclarativedebugjs.pro b/tests/auto/declarative/qdeclarativedebugjs/qdeclarativedebugjs.pro new file mode 100644 index 0000000..720de19 --- /dev/null +++ b/tests/auto/declarative/qdeclarativedebugjs/qdeclarativedebugjs.pro @@ -0,0 +1,4 @@ +TEMPLATE = subdirs + +SUBDIRS = tst_qdeclarativedebugjs.pro \ + app diff --git a/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp b/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp new file mode 100644 index 0000000..a40bcc0 --- /dev/null +++ b/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp @@ -0,0 +1,1341 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qtest.h> +#include <QtDeclarative/QDeclarativeEngine> +#include <QtDeclarative/private/qdeclarativedebugclient_p.h> +#include <QtDeclarative/private/qdeclarativedebugservice_p.h> +#include <QtDeclarative/private/qdeclarativedebug_p.h> +#include <QtDeclarative/private/qjsdebuggeragent_p.h> +#include <QtCore/QFileInfo> +#include <QtCore/QDir> +#include <QtCore/QProcess> +#include "../../../shared/util.h" +#include "../shared/debugutil_p.h" + +class QJSDebugClient : public QDeclarativeDebugClient +{ + Q_OBJECT +public: + QJSDebugClient(QDeclarativeDebugConnection *connection) : QDeclarativeDebugClient(QLatin1String("JSDebugger"), connection) {} + + void ping(); + void exec(const QByteArray &debuggerId, const QString &expr); + void setBreakpoints(const QSet<JSAgentBreakpointData> &breakpoints); + void setWatchExpressions(const QStringList &watchExpressions); + void stepOver(); + void stepInto(); + void interrupt(); + void stepOut(); + void continueExecution(); + void expandObjectById(const QByteArray& objectName, quint64 objectId); + void setProperty(const QByteArray& id, qint64 objectId, const QString &property, const QString &value); + void activateFrame(int frameId); + + // info from last exec + JSAgentWatchData exec_data; + QByteArray exec_iname; + + QByteArray object_name; + QList<JSAgentWatchData> object_children; + + int frame_id; + + // info from last stop + QList<JSAgentStackData> break_stackFrames; + QList<JSAgentWatchData> break_watches; + QList<JSAgentWatchData> break_locals; + bool break_becauseOfException; + QString break_error; + +signals: + void statusHasChanged(); + + void pong(); + void result(); + void stopped(); + void expanded(); + void watchTriggered(); + +protected: + virtual void statusChanged(Status status); + virtual void messageReceived(const QByteArray &data); + +private: + int m_ping; +}; + +class QJSDebugProcess : public QObject +{ + Q_OBJECT +public: + QJSDebugProcess(); + ~QJSDebugProcess(); + + void start(const QStringList &arguments); + bool waitForStarted(); + +private slots: + void processAppOutput(); + +private: + QProcess m_process; + QTimer m_timer; + QEventLoop m_eventLoop; + bool m_started; +}; + +class tst_QDeclarativeDebugJS : public QObject +{ + Q_OBJECT +private: + QDeclarativeDebugConnection *m_conn; + QDeclarativeEngine *m_engine; + QJSDebugClient *m_client; + +private slots: + void pingPong(); + void exec(); + void setBreakpoint(); + void stepOver(); + void stepInto(); + void interrupt(); + void stepOut(); + void continueExecution(); + void expandObject(); + void setProperty(); + void setProperty2(); + void watchExpression(); + void activateFrame(); + void setBreakpoint2(); + void stepOver2(); + void stepInto2(); + void interrupt2(); + void stepOut2(); + void continueExecution2(); + void expandObject2(); + void setProperty3(); + void setProperty4(); + void activateFrame2(); + void verifyQMLOptimizerDisabled(); +}; + + +void QJSDebugClient::ping() +{ + m_ping++; + QByteArray reply; + QDataStream rs(&reply, QIODevice::WriteOnly); + QByteArray cmd = "PING"; + rs << cmd; + rs << m_ping; + sendMessage(reply); +} + +void QJSDebugClient::exec(const QByteArray &debuggerId, const QString &expr) +{ + QByteArray reply; + QDataStream rs(&reply, QIODevice::WriteOnly); + QByteArray cmd = "EXEC"; + rs << cmd; + rs << debuggerId; + rs << expr; + sendMessage(reply); +} + +void QJSDebugClient::setBreakpoints(const QSet<JSAgentBreakpointData> &breakpoints) +{ + QByteArray reply; + QDataStream rs(&reply, QIODevice::WriteOnly); + QByteArray cmd = "BREAKPOINTS"; + rs << cmd + << breakpoints; + sendMessage(reply); +} + +void QJSDebugClient::setWatchExpressions(const QStringList &watchExpressions) +{ + QByteArray reply; + QDataStream rs(&reply, QIODevice::WriteOnly); + QByteArray cmd = "WATCH_EXPRESSIONS"; + rs << cmd + << watchExpressions; + sendMessage(reply); +} + +void QJSDebugClient::stepOver() +{ + QByteArray reply; + QDataStream rs(&reply, QIODevice::WriteOnly); + QByteArray cmd = "STEPOVER"; + rs << cmd; + sendMessage(reply); +} + +void QJSDebugClient::stepInto() +{ + QByteArray reply; + QDataStream rs(&reply, QIODevice::WriteOnly); + QByteArray cmd = "STEPINTO"; + rs << cmd; + sendMessage(reply); +} + +void QJSDebugClient::interrupt() +{ + QByteArray reply; + QDataStream rs(&reply, QIODevice::WriteOnly); + QByteArray cmd = "INTERRUPT"; + rs << cmd; + sendMessage(reply); +} + +void QJSDebugClient::stepOut() +{ + QByteArray reply; + QDataStream rs(&reply, QIODevice::WriteOnly); + QByteArray cmd = "STEPOUT"; + rs << cmd; + sendMessage(reply); +} + +void QJSDebugClient::continueExecution() +{ + QByteArray reply; + QDataStream rs(&reply, QIODevice::WriteOnly); + QByteArray cmd = "CONTINUE"; + rs << cmd; + sendMessage(reply); +} + +void QJSDebugClient::expandObjectById(const QByteArray& objectName, quint64 objectId) +{ + QByteArray reply; + QDataStream rs(&reply, QIODevice::WriteOnly); + QByteArray cmd = "EXPAND"; + rs << cmd + << objectName + << objectId; + sendMessage(reply); +} + +void QJSDebugClient::setProperty(const QByteArray& id, qint64 objectId, const QString &property, const QString &value) +{ + QByteArray reply; + QDataStream rs(&reply, QIODevice::WriteOnly); + QByteArray cmd = "SET_PROPERTY"; + rs << cmd + << id + << objectId + << property + << value; + sendMessage(reply); +} + +void QJSDebugClient::activateFrame(int frameId) +{ + QByteArray reply; + QDataStream rs(&reply, QIODevice::WriteOnly); + QByteArray cmd = "ACTIVATE_FRAME"; + rs << cmd + << frameId; + sendMessage(reply); +} + +void QJSDebugClient::statusChanged(Status /*status*/) +{ + emit statusHasChanged(); +} + +void QJSDebugClient::messageReceived(const QByteArray &data) +{ + QByteArray rwData = data; + QDataStream stream(&rwData, QIODevice::ReadOnly); + + QByteArray command; + stream >> command; + + if (command == "STOPPED") { + stream >> break_stackFrames >> break_watches >> break_locals >> break_becauseOfException >> break_error; + if (!break_becauseOfException) { + break_error.clear(); + } + emit stopped(); + } else if (command == "RESULT") { + stream >> exec_iname; + stream >> exec_data; + emit result(); + } else if (command == "EXPANDED") { + stream >> object_name >> object_children; + emit expanded(); + } else if (command == "LOCALS") { + stream >> frame_id >> break_locals; + if (!stream.atEnd()) { // compatibility with jsdebuggeragent from 2.1, 2.2 + stream >> break_watches; + } + emit watchTriggered(); + } else if (command == "PONG") { + int ping; + stream >> ping; + QCOMPARE(ping, m_ping); + emit pong(); + } else { + QFAIL("Unknown message :" + command); + } + QVERIFY(stream.atEnd()); +} + +QJSDebugProcess::QJSDebugProcess() + : m_started(false) +{ + m_process.setProcessChannelMode(QProcess::MergedChannels); + connect(&m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(processAppOutput())); + connect(&m_timer, SIGNAL(timeout()), &m_eventLoop, SLOT(quit())); + m_timer.setSingleShot(true); + m_timer.setInterval(5000); + QStringList environment = QProcess::systemEnvironment(); + environment.append("QML_DISABLE_OPTIMIZER=1"); + m_process.setEnvironment(environment); +} + +QJSDebugProcess::~QJSDebugProcess() +{ + if (m_process.state() != QProcess::NotRunning) { + m_process.kill(); + m_process.waitForFinished(5000); + } +} + +void QJSDebugProcess::start(const QStringList &arguments) +{ + QString currentDir = QFileInfo(__FILE__).absoluteDir().absolutePath(); + m_process.start(currentDir + "/app/app", arguments); + m_timer.start(); +} + +bool QJSDebugProcess::waitForStarted() +{ + m_eventLoop.exec(QEventLoop::ExcludeUserInputEvents); + + return m_started; +} + +void QJSDebugProcess::processAppOutput() +{ + const QString appOutput = m_process.readAll(); + static QRegExp newline("[\n\r]{1,2}"); + QStringList lines = appOutput.split(newline); + foreach (const QString &line, lines) { + if (line.isEmpty()) + continue; + if (line.startsWith("Qml debugging is enabled")) // ignore + continue; + if (line.startsWith("QDeclarativeDebugServer:")) { + if (line.contains("Waiting for connection ")) { + m_started = true; + m_eventLoop.quit(); + continue; + } + if (line.contains("Connection established")) { + continue; + } + } + qDebug() << line; + } +} + +inline QString TEST_FILE(const QString &filename) +{ + QFileInfo fileInfo(__FILE__); + return fileInfo.absoluteDir().filePath("data/" + filename); +} + +void tst_QDeclarativeDebugJS::pingPong() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QJSDebugClient client(&connection); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + client.ping(); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(pong()))); +} + +void tst_QDeclarativeDebugJS::exec() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QJSDebugClient client(&connection); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + // Evaluate script without context + client.exec("queryid", "1+1"); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(result()))); + QCOMPARE(client.exec_iname, QByteArray("queryid")); + QCOMPARE(client.exec_data.exp, QByteArray("1+1")); + QCOMPARE(client.exec_data.name, QByteArray("1+1")); + QCOMPARE(client.exec_data.hasChildren, false); + QCOMPARE(client.exec_data.type, QByteArray("Number")); + QCOMPARE(client.exec_data.value, QByteArray("2")); + + // TODO: Test access to context after breakpoint is hit +} + + +void tst_QDeclarativeDebugJS::setBreakpoint() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded(); + bp1.lineNumber = 11; + + //TEST LINE + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + JSAgentStackData data = client.break_stackFrames.at(0); + QCOMPARE(data.fileUrl, bp1.fileUrl); + QCOMPARE(data.lineNumber, bp1.lineNumber); + +} + +void tst_QDeclarativeDebugJS::stepOver() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded(); + bp1.lineNumber = 11; + + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + //TEST LINE + client.stepOver(); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + JSAgentStackData data = client.break_stackFrames.at(0); + QCOMPARE(data.fileUrl, bp1.fileUrl); + QCOMPARE(data.lineNumber, bp1.lineNumber +1); +} + +void tst_QDeclarativeDebugJS::stepInto() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded(); + bp1.lineNumber = 12; + + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + //TEST LINE + client.stepInto(); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + QByteArray functionName("functionInScript"); + JSAgentStackData data = client.break_stackFrames.at(0); + QCOMPARE(data.functionName, functionName); + QCOMPARE(data.fileUrl, QByteArray(QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded())); +} + +void tst_QDeclarativeDebugJS::interrupt() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded(); + bp1.lineNumber = 12; + + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + //TEST LINE + client.interrupt(); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + QByteArray functionName("functionInScript"); + JSAgentStackData data = client.break_stackFrames.at(0); + QCOMPARE(data.functionName, functionName); + QCOMPARE(data.fileUrl, QByteArray(QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded())); +} + +void tst_QDeclarativeDebugJS::stepOut() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1,bp2; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded(); + bp1.lineNumber = 12; + + bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded(); + bp2.lineNumber = 13; + + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + client.stepInto(); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + //TEST LINE + client.stepOut(); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + JSAgentStackData data = client.break_stackFrames.at(0); + + QCOMPARE(data.fileUrl, bp2.fileUrl); + QCOMPARE(data.lineNumber, bp2.lineNumber); + +} + +void tst_QDeclarativeDebugJS::continueExecution() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1, bp2; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded(); + bp1.lineNumber = 11; + + bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded(); + bp2.lineNumber = 13; + + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + //TEST LINE + client.continueExecution(); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + JSAgentStackData data = client.break_stackFrames.at(0); + QCOMPARE(data.fileUrl, bp2.fileUrl); + QCOMPARE(data.lineNumber, bp2.lineNumber); +} + +void tst_QDeclarativeDebugJS::expandObject() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded(); + bp1.lineNumber = 17; + + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + foreach ( JSAgentWatchData data, client.break_locals) + { + if( data.name == "details") + { + //TEST LINE + client.expandObjectById(data.name,data.objectId); + } + } + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(expanded()))); + QCOMPARE(client.object_name,QByteArray("details")); + QCOMPARE(client.object_children.at(0).name,QByteArray("category")); + QCOMPARE(client.object_children.at(0).type,QByteArray("String")); + QCOMPARE(client.object_children.at(1).name,QByteArray("names")); + QCOMPARE(client.object_children.at(1).type,QByteArray("Array")); + QCOMPARE(client.object_children.at(2).name,QByteArray("aliases")); + QCOMPARE(client.object_children.at(2).type,QByteArray("Array")); + +} + +void tst_QDeclarativeDebugJS::setProperty() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1, bp2; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded(); + bp1.lineNumber = 17; + bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded(); + bp2.lineNumber = 18; + + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + quint64 objectId; + QByteArray objectName; + + foreach ( JSAgentWatchData data, client.break_locals) + { + if( data.name == "details") + { + objectId = data.objectId; + objectName = data.name; + //TEST LINE + client.setProperty(data.name, data.objectId, "total", "names.length"); + } + } + + client.continueExecution(); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + client.expandObjectById(objectName,objectId); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(expanded()))); + + QCOMPARE(client.object_name,QByteArray("details")); + QCOMPARE(client.object_children.at(0).name,QByteArray("category")); + QCOMPARE(client.object_children.at(0).type,QByteArray("String")); + QCOMPARE(client.object_children.at(0).value,QByteArray("Superheroes")); + QCOMPARE(client.object_children.at(1).name,QByteArray("names")); + QCOMPARE(client.object_children.at(1).type,QByteArray("Array")); + QCOMPARE(client.object_children.at(2).name,QByteArray("aliases")); + QCOMPARE(client.object_children.at(2).type,QByteArray("Array")); + QCOMPARE(client.object_children.at(3).name,QByteArray("total")); + QCOMPARE(client.object_children.at(3).type,QByteArray("Number")); + // foreach ( JSAgentWatchData data, client.object_children) + // { + // qDebug() << data.name << data.type << data.value; + // } +} + +void tst_QDeclarativeDebugJS::setProperty2() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1, bp2; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded(); + bp1.lineNumber = 17; + bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded(); + bp2.lineNumber = 18; + + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + quint64 objectId; + QByteArray objectName; + + foreach ( JSAgentWatchData data, client.break_locals) + { + if( data.name == "details") + { + objectId = data.objectId; + objectName = data.name; + //TEST LINE + client.setProperty(data.name, data.objectId, "category", data.name + ".category = 'comic characters'"); + } + } + + client.continueExecution(); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + client.expandObjectById(objectName,objectId); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(expanded()))); + + QCOMPARE(client.object_name,QByteArray("details")); + QCOMPARE(client.object_children.at(0).name,QByteArray("category")); + QCOMPARE(client.object_children.at(0).type,QByteArray("String")); + QCOMPARE(client.object_children.at(0).value,QByteArray("comic characters")); + QCOMPARE(client.object_children.at(1).name,QByteArray("names")); + QCOMPARE(client.object_children.at(1).type,QByteArray("Array")); + QCOMPARE(client.object_children.at(2).name,QByteArray("aliases")); + QCOMPARE(client.object_children.at(2).type,QByteArray("Array")); + + // foreach ( JSAgentWatchData data, client.object_children) + // { + // qDebug() << data.name << data.type << data.value; + // } +} + +void tst_QDeclarativeDebugJS::watchExpression() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + QByteArray watchExpression("root.result = 20"); + QStringList watchList; + watchList.append(QString(watchExpression)); + + //TEST LINE + client.setWatchExpressions(watchList); + + JSAgentBreakpointData bp1; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded(); + bp1.lineNumber = 11; + + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + JSAgentWatchData data = client.break_watches.at(0); + QCOMPARE(data.exp, watchExpression); + QCOMPARE(data.value.toInt(), 20); + QCOMPARE(data.type, QByteArray("Number")); +} + +void tst_QDeclarativeDebugJS::activateFrame() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1, bp2; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded(); + bp1.lineNumber = 3; + + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + client.stepInto(); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + //TEST LINE + client.activateFrame(2); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(watchTriggered()))); + + QCOMPARE(client.break_locals.at(1).name,QByteArray("names")); + QCOMPARE(client.break_locals.at(1).type,QByteArray("Array")); + QCOMPARE(client.break_locals.at(2).name,QByteArray("a")); + QCOMPARE(client.break_locals.at(2).type,QByteArray("Number")); + QCOMPARE(client.break_locals.at(2).value,QByteArray("4")); + QCOMPARE(client.break_locals.at(3).name,QByteArray("b")); + QCOMPARE(client.break_locals.at(3).type,QByteArray("Number")); + QCOMPARE(client.break_locals.at(3).value,QByteArray("5")); + + // foreach ( JSAgentWatchData data, client.break_locals) + // { + // qDebug() << data.name << data.type << data.value; + // } + +} + +void tst_QDeclarativeDebugJS::setBreakpoint2() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded(); + bp1.lineNumber = 40; + + //TEST LINE + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1); + QVERIFY(!QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); +} + +void tst_QDeclarativeDebugJS::stepOver2() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded(); + bp1.lineNumber = 11; + + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + //TEST LINE + client.stepOver(); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + client.stepOver(); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + JSAgentStackData data = client.break_stackFrames.at(0); + QCOMPARE(data.fileUrl, bp1.fileUrl); + QCOMPARE(data.lineNumber, bp1.lineNumber +2); +} + +void tst_QDeclarativeDebugJS::stepInto2() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded(); + bp1.lineNumber = 17; + + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + //TEST LINE + client.stepInto(); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + client.stepInto(); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + QByteArray functionName("logger"); + JSAgentStackData data = client.break_stackFrames.at(0); + QCOMPARE(data.functionName, functionName); + QCOMPARE(data.fileUrl, QByteArray(QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded())); +} + +void tst_QDeclarativeDebugJS::interrupt2() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded(); + bp1.lineNumber = 17; + + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + //TEST LINE + client.interrupt(); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + client.interrupt(); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + QByteArray functionName("logger"); + JSAgentStackData data = client.break_stackFrames.at(0); + QCOMPARE(data.functionName, functionName); + QCOMPARE(data.fileUrl, QByteArray(QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded())); +} + +void tst_QDeclarativeDebugJS::stepOut2() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1,bp2; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded(); + bp1.lineNumber = 12; + + bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded(); + bp2.lineNumber = 13; + + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + client.stepInto(); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + client.stepInto(); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + //TEST LINE + client.stepOut(); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + client.stepOut(); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + JSAgentStackData data = client.break_stackFrames.at(0); + + QCOMPARE(data.fileUrl, bp2.fileUrl); + QCOMPARE(data.lineNumber, bp2.lineNumber); + +} + +void tst_QDeclarativeDebugJS::continueExecution2() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1, bp2, bp3; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded(); + bp1.lineNumber = 11; + + bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded(); + bp2.lineNumber = 12; + + bp3.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded(); + bp3.lineNumber = 13; + + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2 << bp3); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + //TEST LINE + client.continueExecution(); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + client.continueExecution(); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + JSAgentStackData data = client.break_stackFrames.at(0); + QCOMPARE(data.fileUrl, bp3.fileUrl); + QCOMPARE(data.lineNumber, bp3.lineNumber); +} + +void tst_QDeclarativeDebugJS::expandObject2() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded(); + bp1.lineNumber = 17; + + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + //TEST LINE + client.expandObjectById(QByteArray("details"),123); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(expanded()))); + QCOMPARE(client.object_name,QByteArray("details")); + + QEXPECT_FAIL("", "", Continue); + QCOMPARE(client.object_children.length(),0); + +} + +void tst_QDeclarativeDebugJS::setProperty3() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1, bp2; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded(); + bp1.lineNumber = 17; + bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded(); + bp2.lineNumber = 18; + + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + quint64 objectId; + QByteArray objectName; + + foreach ( JSAgentWatchData data, client.break_locals) + { + if( data.name == "details") + { + objectId = data.objectId; + objectName = data.name; + //TEST LINE + client.setProperty(data.name, 123, "total", "names.length"); + } + } + + client.continueExecution(); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + client.expandObjectById(objectName,objectId); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(expanded()))); + + QCOMPARE(client.object_name,QByteArray("details")); + QCOMPARE(client.object_children.length(),3); + + // foreach ( JSAgentWatchData data, client.object_children) + // { + // qDebug() << data.name << data.type << data.value; + // } +} + +void tst_QDeclarativeDebugJS::setProperty4() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1, bp2; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded(); + bp1.lineNumber = 17; + bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded(); + bp2.lineNumber = 18; + + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + quint64 objectId; + QByteArray objectName; + + foreach ( JSAgentWatchData data, client.break_locals) + { + if( data.name == "details") + { + objectId = data.objectId; + objectName = data.name; + //TEST LINE + client.setProperty(data.name, 123, "category", data.name + ".category = 'comic characters'"); + } + } + + client.continueExecution(); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + client.expandObjectById(objectName,objectId); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(expanded()))); + + QCOMPARE(client.object_name,QByteArray("details")); + QCOMPARE(client.object_children.at(0).name,QByteArray("category")); + QCOMPARE(client.object_children.at(0).type,QByteArray("String")); + QCOMPARE(client.object_children.at(0).value,QByteArray("Superheroes")); + QCOMPARE(client.object_children.at(1).name,QByteArray("names")); + QCOMPARE(client.object_children.at(1).type,QByteArray("Array")); + QCOMPARE(client.object_children.at(2).name,QByteArray("aliases")); + QCOMPARE(client.object_children.at(2).type,QByteArray("Array")); + + // foreach ( JSAgentWatchData data, client.object_children) + // { + // qDebug() << data.name << data.type << data.value; + // } +} + +void tst_QDeclarativeDebugJS::activateFrame2() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1, bp2; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded(); + bp1.lineNumber = 4; + + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + client.stepInto(); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + + //TEST LINE + client.activateFrame(5); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(watchTriggered()))); + + QCOMPARE(client.break_locals.length(),0); + + // foreach ( JSAgentWatchData data, client.break_locals) + // { + // qDebug() << data.name << data.type << data.value; + // } + +} + +void tst_QDeclarativeDebugJS::verifyQMLOptimizerDisabled() +{ + QJSDebugProcess process; + process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml")); + QVERIFY(process.waitForStarted()); + + QDeclarativeDebugConnection connection; + QJSDebugClient client(&connection); + + connection.connectToHost("127.0.0.1", 3771); + QVERIFY(connection.waitForConnected()); + + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + if (client.status() == QJSDebugClient::Unavailable) + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()))); + QCOMPARE(client.status(), QJSDebugClient::Enabled); + + JSAgentBreakpointData bp1; + bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded(); + bp1.lineNumber = 21; + + client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1); + QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped()))); + +} +QTEST_MAIN(tst_QDeclarativeDebugJS) + +#include "tst_qdeclarativedebugjs.moc" diff --git a/tests/auto/declarative/qdeclarativescriptdebugging/qdeclarativescriptdebugging.pro b/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.pro index 171f308..8aea1b5 100644 --- a/tests/auto/declarative/qdeclarativescriptdebugging/qdeclarativescriptdebugging.pro +++ b/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.pro @@ -1,8 +1,12 @@ load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative script +contains(QT_CONFIG,declarative): QT += declarative network script macx:CONFIG -= app_bundle -SOURCES += tst_qdeclarativescriptdebugging.cpp +HEADERS += ../shared/debugutil_p.h + +SOURCES += tst_qdeclarativedebugjs.cpp \ + ../shared/debugutil.cpp + INCLUDEPATH += ../shared # QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage @@ -16,5 +20,7 @@ symbian: { DEFINES += SRCDIR=\\\"$$PWD\\\" } +OTHER_FILES = data/backtrace1.js data/backtrace1.qml + CONFIG += parallel_test diff --git a/tests/auto/declarative/qdeclarativelanguage/data/NestedComponentRoot.qml b/tests/auto/declarative/qdeclarativelanguage/data/NestedComponentRoot.qml new file mode 100644 index 0000000..785a27d --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/NestedComponentRoot.qml @@ -0,0 +1,6 @@ +import QtQuick 1.0 + +Component { + Item { + } +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nestedComponentRoots.qml b/tests/auto/declarative/qdeclarativelanguage/data/nestedComponentRoots.qml new file mode 100644 index 0000000..361bcbc --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/nestedComponentRoots.qml @@ -0,0 +1,4 @@ +import QtQuick 1.0 + +NestedComponentRoot { +} diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index d6e6a4a..7f186b3 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -135,6 +135,7 @@ private slots: void reservedWords_data(); void reservedWords(); void inlineAssignmentsOverrideBindings(); + void nestedComponentRoots(); void basicRemote_data(); void basicRemote(); @@ -1425,6 +1426,12 @@ void tst_qdeclarativelanguage::inlineAssignmentsOverrideBindings() delete o; } +// QTBUG-19354 +void tst_qdeclarativelanguage::nestedComponentRoots() +{ + QDeclarativeComponent component(&engine, TEST_FILE("nestedComponentRoots.qml")); +} + // Import tests (QT-558) void tst_qdeclarativelanguage::importsBuiltin_data() { diff --git a/tests/auto/declarative/qdeclarativescriptdebugging/data/backtrace1.js b/tests/auto/declarative/qdeclarativescriptdebugging/data/backtrace1.js deleted file mode 100644 index 8decbf0..0000000 --- a/tests/auto/declarative/qdeclarativescriptdebugging/data/backtrace1.js +++ /dev/null @@ -1,11 +0,0 @@ - -function function2InScript(a) -{ - mainRectangle.foo = a; -} - - -function functionInScript(a , b) -{ - function2InScript(a + b); -} diff --git a/tests/auto/declarative/qdeclarativescriptdebugging/data/backtrace1.qml b/tests/auto/declarative/qdeclarativescriptdebugging/data/backtrace1.qml deleted file mode 100644 index 9096c32..0000000 --- a/tests/auto/declarative/qdeclarativescriptdebugging/data/backtrace1.qml +++ /dev/null @@ -1,27 +0,0 @@ -import QtQuick 1.0 -import Qt.test 1.0 -import "backtrace1.js" as Script - -Rectangle { - id: mainRectangle - - property string foo: "Default"; - width: 200 - height: 200 - - - MyTestObject { - - function append(a, b) { - return a + " " + b; - } - - - id: testObject; - someProperty: append("Hello", mainRectangle.foo) - - onSignaled: { - Script.functionInScript(value , "b"); - } - } -} diff --git a/tests/auto/declarative/qdeclarativescriptdebugging/tst_qdeclarativescriptdebugging.cpp b/tests/auto/declarative/qdeclarativescriptdebugging/tst_qdeclarativescriptdebugging.cpp deleted file mode 100644 index 4301174..0000000 --- a/tests/auto/declarative/qdeclarativescriptdebugging/tst_qdeclarativescriptdebugging.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** 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, Nokia gives you certain additional -** rights. These rights are described in the Nokia 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. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include <qtest.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativeitem.h> -#include <QtDeclarative/qdeclarativecontext.h> -#include <QtCore/QDir> -#include <QtScript/QScriptEngineAgent> -#include <private/qdeclarativeengine_p.h> - -class MyTestObject : public QObject { - Q_OBJECT - Q_PROPERTY(QString someProperty READ someProperty WRITE setSomeProperty NOTIFY somePropertyChanged) - -public: - QString someProperty() { return _someProperty; } - void setSomeProperty(const QString &p) { _someProperty = p; } - QString _someProperty; - - void emitSignal(const QString &value) { emit signaled(value); } - -signals: - void signaled(const QString &value); - void somePropertyChanged(); -}; - - -class BtAgent : public QScriptEngineAgent { -public: - BtAgent(QScriptEngine *engine) : QScriptEngineAgent(engine) - { count = 0; engine->setAgent(this); } - - QStringList bt; - int count; - int breakpoint; - void positionChange(qint64 , int lineNumber, int ) - { - if(lineNumber == breakpoint) { - count++; - bt = engine()->currentContext()->backtrace(); - } - } -}; - - - -/* -This test covers evaluation of ECMAScript expressions and bindings from within -QML. This does not include static QML language issues. - -Static QML language issues are covered in qmllanguage -*/ -inline QUrl TEST_FILE(const QString &filename) -{ - QFileInfo fileInfo(__FILE__); - return QUrl::fromLocalFile(fileInfo.absoluteDir().filePath("data/" + filename)); -} - -inline QUrl TEST_FILE(const char *filename) -{ - return TEST_FILE(QLatin1String(filename)); -} - -class tst_qdeclarativescriptdebugging : public QObject -{ - Q_OBJECT -public: - tst_qdeclarativescriptdebugging() {} - -private slots: - void initTestCase(); - void backtrace1(); -}; - -void tst_qdeclarativescriptdebugging::initTestCase() -{ - qmlRegisterType<MyTestObject>("Qt.test", 1,0, "MyTestObject"); -} - -void tst_qdeclarativescriptdebugging::backtrace1() -{ - { - QDeclarativeEngine engine; - QUrl file = TEST_FILE("backtrace1.qml"); - QDeclarativeComponent component(&engine, file); - QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(component.create()); - QVERIFY(item); - MyTestObject *obj = item->findChild<MyTestObject *>(); - QVERIFY(obj); - QCOMPARE(obj->someProperty(), QString("Hello Default")); - - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(&engine); - BtAgent agent(&ep->scriptEngine); - agent.breakpoint = 16; - - obj->emitSignal("blah"); - QCOMPARE(obj->someProperty(), QString("Hello blahb")); - QCOMPARE(agent.count, 1); - - QStringList expected; - expected << "append(a = 'Hello', b = 'blahb') at @PREFIX@/backtrace1.qml:16" - << "$someProperty() at @PREFIX@/backtrace1.qml:21" - << "function2InScript(a = 'blahb') at @PREFIX@/backtrace1.js:4" - << "functionInScript(a = 'blah', b = 'b') at @PREFIX@/backtrace1.js:10" - << "onSignaled() at @PREFIX@/backtrace1.qml:24" - << "<global>() at -1"; - expected.replaceInStrings("@PREFIX@", file.toString().section('/', 0, -2)); - QCOMPARE(agent.bt, expected); - } -} - - -QTEST_MAIN(tst_qdeclarativescriptdebugging) - -#include "tst_qdeclarativescriptdebugging.moc" diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.4.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.4.png Binary files differindex bc65634..4c4d17c 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.4.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.4.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.6.png b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.6.png Binary files differindex be041d8..d7b5943 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.6.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.6.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.0.png b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.0.png Binary files differindex 0efb20a..75a6c49 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.0.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.0.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.0.png Binary files differindex 6525dbb..ae89849 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.0.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.1.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.1.png Binary files differindex 5b8d209..7b7db05 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.1.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.1.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.2.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.2.png Binary files differindex cf012ba..7c1442f 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.2.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.2.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.3.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.3.png Binary files differindex 57e77a4..c01c980 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.3.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.3.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.4.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.4.png Binary files differindex 24d26bd..8806e4c 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.4.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.4.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.5.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.5.png Binary files differindex a540734..b331119 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.5.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.5.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.6.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.6.png Binary files differindex 17da643..76e3c6f 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.6.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.6.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.7.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.7.png Binary files differindex e03cfe4..141753c 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.7.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.7.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/multilineAlign.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/multilineAlign.0.png Binary files differindex 1b808ef..8b6329d 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/multilineAlign.0.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/multilineAlign.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.0.png Binary files differindex 666d272..38f2051 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.0.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.0.png Binary files differindex 823199c..d85498b 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.0.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.0.png Binary files differindex 7e84164..7547856 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.0.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.1.png Binary files differindex 7e84164..84430bb 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.1.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.1.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.0.png Binary files differindex 6119f92..026d06c 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.0.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.1.png Binary files differindex 6119f92..026d06c 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.1.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.1.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.1.png Binary files differindex f2e6117..16202c4 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.1.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.1.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.0.png Binary files differindex 2f4c84a..38b9668 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.0.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.1.png Binary files differindex ae786a2..801ec2b 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.1.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.1.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.1.png Binary files differindex 93c16dc..ddd6cc5 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.1.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.1.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.2.png Binary files differindex acec1ee..4679774 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.2.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.2.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.3.png Binary files differindex f380c08..51018b4 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.3.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.3.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.4.png Binary files differindex 18142dd..f5ed905 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.4.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.4.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.5.png Binary files differindex c7f59b8..5005724 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.5.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.5.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.0.png Binary files differindex be676c0..e47b479 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.0.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.0.png Binary files differindex df2fe2f..0d3c672 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.0.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.0.png Binary files differindex b4e1d3a..56d98ff 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.0.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.0.png Binary files differindex 4177b9e..1ab1eb5 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.0.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.0.png Binary files differindex 36e5d35..68921f6 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.0.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.0.png Binary files differindex 34f8e38..c9450c7 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.0.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.0.png Binary files differindex 0b4ca4e..5049c3f 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.0.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.1.png Binary files differindex 251beb6..ee6e16a 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.1.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.1.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.10.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.10.png Binary files differindex 5cd2d7d..d9d2252 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.10.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.10.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.11.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.11.png Binary files differindex 5cd2d7d..d9d2252 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.11.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.11.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.2.png Binary files differindex bf6a44e..cf99d98 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.2.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.2.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.3.png Binary files differindex 1089578..e3937f0 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.3.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.3.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.4.png Binary files differindex c9113de..2fe3337 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.4.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.4.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.5.png Binary files differindex 47b4744..97b9913 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.5.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.5.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.6.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.6.png Binary files differindex c518204..08e059f 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.6.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.6.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.7.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.7.png Binary files differindex 9f1c26a..bbc5ba2 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.7.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.7.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.8.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.8.png Binary files differindex cd8d0a5..465b64e 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.8.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.8.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.9.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.9.png Binary files differindex 8f5f872..d9d2252 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.9.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.9.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.0.png Binary files differindex a61ba5a..61606b2 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.0.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.1.png Binary files differindex 2a28c96..a4b28fc 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.1.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.1.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.2.png Binary files differindex d1ddaa6..5be6bbb 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.2.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.2.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.3.png Binary files differindex 493c5cd..a220f65 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.3.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.3.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.4.png Binary files differindex 2b2ce59..6946707 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.4.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.4.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.5.png Binary files differindex 044eea4..4eeb8ec 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.5.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.5.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.6.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.6.png Binary files differindex f0748b2..4eeb8ec 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.6.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.6.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.0.png Binary files differindex 8d74b8d..59fc0fc 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.0.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.1.png Binary files differindex 8a642d2..2747b50 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.1.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.1.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.2.png Binary files differindex 5698741..74efe73 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.2.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.2.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.3.png Binary files differindex 7f56f34..02f6e17 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.3.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.3.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.4.png Binary files differindex 8d74b8d..59fc0fc 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.4.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.4.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.10.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.10.png Binary files differindex 8effaef..56f6ece 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.10.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.10.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.11.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.11.png Binary files differindex 8effaef..56f6ece 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.11.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.11.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.12.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.12.png Binary files differindex 8effaef..56f6ece 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.12.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.12.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.7.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.7.png Binary files differindex b79af19..f8bc3b4 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.7.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.7.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.9.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.9.png Binary files differindex ef15fdf..e156cd5 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.9.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.9.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.7.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.7.png Binary files differindex 99d451c..d624a71 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.7.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.7.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.0.png Binary files differindex 5f632d0..57a1599 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.0.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.1.png Binary files differindex 060be22..d327d5b 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.1.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.1.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.2.png Binary files differindex d373aef..c1e3dce 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.2.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.2.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.11.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.11.png Binary files differindex 0ea21f3..7829e03 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.11.png +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.11.png diff --git a/tests/auto/qcomplextext/bidireorderstring.h b/tests/auto/qcomplextext/bidireorderstring.h index e51011e..e0bbf6e 100644 --- a/tests/auto/qcomplextext/bidireorderstring.h +++ b/tests/auto/qcomplextext/bidireorderstring.h @@ -145,6 +145,7 @@ const LV logical_visual[] = { { "embed10", "\342\200\253x \327\251\327\234\327\225\327\235 y\342\200\254", "\342\200\254y \327\235\327\225\327\234\327\251 x\342\200\253", QChar::DirL }, { "embed11", "\342\200\252x \327\251\327\234\327\225\327\235 y\342\200\254", "\342\200\252x \327\235\327\225\327\234\327\251 y\342\200\254", QChar::DirR }, { "embed12", "\342\200\253x \327\251\327\234\327\225\327\235 y\342\200\254", "\342\200\254y \327\235\327\225\327\234\327\251 x\342\200\253", QChar::DirR }, + { "zwsp", "+0\342\200\213f-1", "+0\342\200\213f-1", QChar::DirL }, { 0, 0, 0, QChar::DirON } }; diff --git a/tests/auto/qdatetime/qdatetime.pro b/tests/auto/qdatetime/qdatetime.pro index a3f3091..72ca333 100644 --- a/tests/auto/qdatetime/qdatetime.pro +++ b/tests/auto/qdatetime/qdatetime.pro @@ -10,4 +10,3 @@ win32-msvc|win32-msvc9x { QMAKE_CXXFLAGS_RELEASE -= -O1 } CONFIG += parallel_test -HEADERS = tst_qdatetime.loc diff --git a/tests/auto/qfont/tst_qfont.cpp b/tests/auto/qfont/tst_qfont.cpp index cfafa78..711ffc0 100644 --- a/tests/auto/qfont/tst_qfont.cpp +++ b/tests/auto/qfont/tst_qfont.cpp @@ -77,6 +77,7 @@ private slots: void insertAndRemoveSubstitutions(); void serializeSpacing(); void lastResortFont(); + void styleName(); }; // Testing get/set functions @@ -612,5 +613,17 @@ void tst_QFont::lastResortFont() QVERIFY(!font.lastResortFont().isEmpty()); } +void tst_QFont::styleName() +{ +#if !defined(Q_WS_MAC) + QSKIP("Only tested on Mac", SkipAll); +#else + QFont font("Helvetica Neue"); + font.setStyleName("UltraLight"); + + QCOMPARE(QFontInfo(font).styleName(), QString("UltraLight")); +#endif +} + QTEST_MAIN(tst_QFont) #include "tst_qfont.moc" diff --git a/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp b/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp index d5d56fc..cd91008 100644 --- a/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp +++ b/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp @@ -63,6 +63,14 @@ private slots: void automaticReparenting(); void verifyActivate(); void invalidate(); + void moveAndResize_data(); + void moveAndResize(); + void moveAndResizeWidgetInWidget_data(); + void moveAndResizeWidgetInWidget(); + void changingMinimumSize_data(); + void changingMinimumSize(); + void invalidateAndMove_data(); + void invalidateAndMove(); void constructors(); void alternativeLayoutItems(); void ownership(); @@ -443,7 +451,7 @@ void tst_QGraphicsLayout::invalidate() QCoreApplication::sendPostedEvents(); QCOMPARE(a->eventCount(QEvent::LayoutRequest), 1); QCOMPARE(b->eventCount(QEvent::LayoutRequest), 0); - QCOMPARE(c->eventCount(QEvent::LayoutRequest), 1); + QCOMPARE(c->eventCount(QEvent::GraphicsSceneResize), 1); QCOMPARE(d->eventCount(QEvent::LayoutRequest), 0); QCOMPARE(a->functionCount[SetGeometry], 1); @@ -479,30 +487,18 @@ void tst_QGraphicsLayout::invalidate() QCOMPARE(c->eventCount(QEvent::LayoutRequest), 0); QCoreApplication::sendPostedEvents(); - QCOMPARE(a->eventCount(QEvent::LayoutRequest), 1); + QCOMPARE(a->eventCount(QEvent::GraphicsSceneResize), 1); QCOMPARE(b->eventCount(QEvent::LayoutRequest), 0); - QCOMPARE(c->eventCount(QEvent::LayoutRequest), 1); + QCOMPARE(c->eventCount(QEvent::GraphicsSceneResize), 1); QCOMPARE(d->eventCount(QEvent::LayoutRequest), 0); QCOMPARE(a->functionCount[SetGeometry], 1); - /* well, ideally one call to setGeometry(), but it will currently - * get two calls to setGeometry(): - * 1. The first LayoutRequest will call activate() - that will call - * setGeometry() on the layout. This geometry will be based on - * the widget geometry which is not correct at this moment. - * (it is still 150 wide) - * 2. Next, we check if the widget is top level, and then we call - * parentWidget->resize(parentWidget->size()); - * This will be adjusted to be minimum 200 pixels wide. - * The new size will then be propagated down to the layout - * - */ - QCOMPARE(alay->functionCount[SetGeometry], 2); - - QCOMPARE(b->functionCount[SetGeometry], 2); - QCOMPARE(c->functionCount[SetGeometry], 2); - QCOMPARE(d->functionCount[SetGeometry], 2); + QCOMPARE(alay->functionCount[SetGeometry], 1); + + QCOMPARE(b->functionCount[SetGeometry], 1); + QCOMPARE(c->functionCount[SetGeometry], 1); + QCOMPARE(d->functionCount[SetGeometry], 1); // f actually got wider, need to rearrange its siblings QCOMPARE(blay->functionCount[SetGeometry], 1); QCOMPARE(clay->functionCount[SetGeometry], 1); @@ -555,7 +551,236 @@ void tst_QGraphicsLayout::invalidate() QGraphicsLayout::setInstantInvalidatePropagation(false); } +void tst_QGraphicsLayout::changingMinimumSize_data() +{ + QTest::addColumn<bool>("instantInvalidatePropagation"); + QTest::newRow("Without instantInvalidatePropagation") << false; + QTest::newRow("With instantInvalidatePropagation") << true; +} +void tst_QGraphicsLayout::changingMinimumSize() +{ + QFETCH(bool, instantInvalidatePropagation); + QGraphicsLayout::setInstantInvalidatePropagation(instantInvalidatePropagation); + QGraphicsWidget *widget = new QGraphicsWidget; + qApp->processEvents(); + widget->setMinimumSize(300,300); + qApp->processEvents(); + QCOMPARE(widget->size(), QSizeF(300,300)); + QGraphicsLayout::setInstantInvalidatePropagation(false); +} + +struct WidgetToTestResizeEvents : public QGraphicsWidget +{ + virtual void resizeEvent ( QGraphicsSceneResizeEvent * event ) + { + QGraphicsWidget::resizeEvent(event); + resizeEventCalled = true; + } + + bool resizeEventCalled; +}; + +void tst_QGraphicsLayout::moveAndResizeWidgetInWidget_data() +{ + QTest::addColumn<bool>("instantInvalidatePropagation"); + + QTest::newRow("Without instantInvalidatePropagation") << false; + QTest::newRow("With instantInvalidatePropagation") << true; +} +void tst_QGraphicsLayout::moveAndResizeWidgetInWidget() +{ + QFETCH(bool, instantInvalidatePropagation); + QGraphicsLayout::setInstantInvalidatePropagation(instantInvalidatePropagation); + QGraphicsScene scene; + + QGraphicsWidget *widget = new QGraphicsWidget; + QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(widget); + layout->setContentsMargins(0,0,0,0); + WidgetToTestResizeEvents *innerWidget = new WidgetToTestResizeEvents; + QGraphicsLinearLayout *innerLayout = new QGraphicsLinearLayout(innerWidget); + innerLayout->setContentsMargins(0,0,0,0); + QCOMPARE(widget->maximumSize(), QSizeF(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX)); + layout->addItem(innerWidget); + widget->setMinimumSize(1,1); + widget->setPreferredSize(1000,1000); + widget->setMaximumSize(2000,2000); + widget->resize(widget->preferredSize()); + innerWidget->setMinimumSize(1,1); + qApp->processEvents(); + innerWidget->resizeEventCalled = false; + + QCOMPARE(widget->size(), QSizeF(1000, 1000)); + QCOMPARE(layout->geometry().size(), QSizeF(1000, 1000)); + QCOMPARE(innerWidget->size(), QSizeF(1000, 1000)); + + innerLayout->invalidate(); + widget->setMaximumHeight(500); + widget->setX(1); + qApp->processEvents(); + QCOMPARE(widget->size(), QSizeF(1000, 500)); + QCOMPARE(innerWidget->size(), QSizeF(1000, 500)); + QVERIFY(innerWidget->resizeEventCalled); +} +void tst_QGraphicsLayout::moveAndResize_data() +{ + QTest::addColumn<bool>("instantInvalidatePropagation"); + QTest::addColumn<bool>("insideLayout"); + QTest::addColumn<bool>("insideLayoutInLayout"); + QTest::addColumn<bool>("insideWidget"); + QTest::newRow("Without instantInvalidatePropagation") << false << false << false << false; + QTest::newRow("With instantInvalidatePropagation") << true << false << false << false; + QTest::newRow("Without instantInvalidatePropagation, inside widget with no layout") << false << false << false << true; + QTest::newRow("With instantInvalidatePropagation, inside widget with no layout") << true << false << false << true; + QTest::newRow("Without instantInvalidatePropagation, inside widget with layout") << false << true << false << true; + QTest::newRow("With instantInvalidatePropagation, inside widget with layout") << true << true << false << true; + QTest::newRow("Without instantInvalidatePropagation, inside widget with layout in layout") << false << true << true << true; + QTest::newRow("With instantInvalidatePropagation, inside widget with layout in layout") << true << true << true << true; + +} +void tst_QGraphicsLayout::moveAndResize() +{ + QFETCH(bool, instantInvalidatePropagation); + QFETCH(bool, insideLayout); + QFETCH(bool, insideLayoutInLayout); + QFETCH(bool, insideWidget); + QGraphicsLayout::setInstantInvalidatePropagation(instantInvalidatePropagation); + QGraphicsScene scene; + + WidgetToTestResizeEvents *widget = new WidgetToTestResizeEvents; + + /* Setup its parent if we want them */ + QGraphicsWidget *parent = NULL; + if (insideWidget) + parent = new QGraphicsWidget; + if (insideLayout) { + QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(parent); + QGraphicsLinearLayout *innerLayout = NULL; + if (insideLayoutInLayout) { + innerLayout = new QGraphicsLinearLayout; + layout->addItem(innerLayout); + innerLayout->addItem(widget); + } else + layout->addItem(widget); + } else if (insideWidget) { + widget->setParentItem(parent); + } + + new QGraphicsLinearLayout(widget); + widget->setGeometry(0,0,100,100); + qApp->processEvents(); + widget->resizeEventCalled = false; + + /* Force it grow by changing the minimum size */ + widget->setMinimumSize(200,200); + qApp->processEvents(); + qApp->processEvents(); + qApp->processEvents(); + QCOMPARE(widget->size(), QSizeF(200,200)); + QVERIFY(widget->resizeEventCalled); + widget->resizeEventCalled = false; + + /* Call setPos followed by a resize. We should get a resize event */ + widget->setPos(10,10); + widget->resize(300,300); + qApp->processEvents(); + QVERIFY(widget->resizeEventCalled); + widget->resizeEventCalled = false; + + /* Check that just calling setGeometry gives us a resize event */ + widget->setGeometry(10,10, 400, 400); + qApp->processEvents(); + QVERIFY(widget->resizeEventCalled); + widget->resizeEventCalled = false; + + /* Now call setPos followed by increasing the size using setGeometry,*/ + widget->setPos(30,30); + widget->setGeometry(10,10, 500, 500); + qApp->processEvents(); + QVERIFY(widget->resizeEventCalled); + widget->resizeEventCalled = false; + + /* Now call setPos followed by increasing the minimum size, to force it to grow */ + widget->setMinimumSize(600,600); + widget->setPos(30,30); + qApp->processEvents(); + QCOMPARE(widget->size(), QSizeF(600,600)); + QVERIFY(widget->resizeEventCalled); + widget->resizeEventCalled = false; + + QGraphicsLayout::setInstantInvalidatePropagation(false); +} +void tst_QGraphicsLayout::invalidateAndMove_data() +{ + QTest::addColumn<bool>("instantInvalidatePropagation"); + QTest::newRow("Without instantInvalidatePropagation") << false; + QTest::newRow("With instantInvalidatePropagation") << true; + +} +void tst_QGraphicsLayout::invalidateAndMove() +{ + // Check that if we set the position of an item and invalidate its layout at the same + // time, the widget keeps its correct size + QFETCH(bool, instantInvalidatePropagation); + QGraphicsLayout::setInstantInvalidatePropagation(instantInvalidatePropagation); + QGraphicsScene scene; + + QGraphicsWidget *widget = new QGraphicsWidget; + new QGraphicsLinearLayout(widget); + + widget->setMinimumSize(1,1); + widget->setPreferredSize(34,34); + widget->setMaximumSize(100,100); + widget->resize(widget->preferredSize()); + + scene.addItem(widget); + + qApp->processEvents(); + + /* Invalidate and reactivate. The size should not have changed */ + widget->layout()->invalidate(); + widget->layout()->activate(); + + QCOMPARE(widget->geometry().size(), widget->preferredSize()); + QCOMPARE(widget->layout()->geometry().size(), widget->preferredSize()); + qApp->processEvents(); + QCOMPARE(widget->geometry().size(), widget->preferredSize()); + QCOMPARE(widget->layout()->geometry().size(), widget->preferredSize()); + + widget->layout()->invalidate(); + widget->setX(1); //Change just the position using setX + QCOMPARE(widget->geometry().size(), widget->preferredSize()); + QCOMPARE(widget->layout()->geometry().size(), widget->preferredSize()); + qApp->processEvents(); + QCOMPARE(widget->geometry().size(), widget->preferredSize()); + QCOMPARE(widget->layout()->geometry().size(), widget->preferredSize()); + + widget->layout()->invalidate(); + widget->setGeometry(1,1,34,34); //Change just the position using setGeometry + QCOMPARE(widget->geometry().size(), widget->preferredSize()); + QCOMPARE(widget->layout()->geometry().size(), widget->preferredSize()); + qApp->processEvents(); + QCOMPARE(widget->geometry().size(), widget->preferredSize()); + QCOMPARE(widget->layout()->geometry().size(), widget->preferredSize()); + + widget->layout()->invalidate(); + widget->setGeometry(1,1,60,60); //Change just the size using setGeometry + QCOMPARE(widget->geometry().size(), QSizeF(60,60)); + QCOMPARE(widget->layout()->geometry().size(), QSizeF(60,60)); + qApp->processEvents(); + QCOMPARE(widget->geometry().size(), QSizeF(60,60)); + QCOMPARE(widget->layout()->geometry().size(), QSizeF(60,60)); + + widget->layout()->invalidate(); + widget->setGeometry(0,0,34,34); //Change the size and position using setGeometry + QCOMPARE(widget->geometry().size(), widget->preferredSize()); + QCOMPARE(widget->layout()->geometry().size(), widget->preferredSize()); + qApp->processEvents(); + QCOMPARE(widget->geometry().size(), widget->preferredSize()); + QCOMPARE(widget->layout()->geometry().size(), widget->preferredSize()); + + QGraphicsLayout::setInstantInvalidatePropagation(false); +} class Layout : public QGraphicsLayout { public: diff --git a/tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp b/tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp index 1b4256b..d1c376a 100644 --- a/tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp +++ b/tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp @@ -52,6 +52,7 @@ private slots: void getterSetter(); void setCookiesFromUrl_data(); void setCookiesFromUrl(); + void setCookiesFromUrl_50CookiesLimitPerDomain(); void cookiesForUrl_data(); void cookiesForUrl(); void effectiveTLDs_data(); @@ -251,6 +252,46 @@ void tst_QNetworkCookieJar::setCookiesFromUrl() QVERIFY2(result.isEmpty(), QTest::toString(result)); } +static bool findCookieName(const QList<QNetworkCookie> &cookieList, const QString &name) +{ + foreach(QNetworkCookie cookie, cookieList) + if (cookie.name() == name) + return true; + return false; +} + +void tst_QNetworkCookieJar::setCookiesFromUrl_50CookiesLimitPerDomain() +{ + QNetworkCookie cookie; + cookie.setValue("value"); + MyCookieJar jar; + QUrl url("http://a.b.c.com"); + + for (int i = 0; i < 20; ++i) { + // Add a list of 3 domain-matched cookies on each iteration for a total of 60 cookies. + QList<QNetworkCookie> cookieList; + cookie.setName(QString("CookieNo%1").arg(i*3+1).toAscii()); + cookie.setDomain("a.b.c.com"); + cookieList += cookie; + cookie.setName(QString("CookieNo%1").arg(i*3+2).toAscii()); + cookie.setDomain(".b.c.com"); + cookieList += cookie; + cookie.setName(QString("CookieNo%1").arg(i*3+3).toAscii()); + cookie.setDomain(".c.com"); + cookieList += cookie; + jar.setCookiesFromUrl(cookieList, url); + + int expectedNumCookies = std::min((i+1)*3, 50); + QCOMPARE(jar.allCookies().size(), expectedNumCookies); + } + + // Verify that the oldest cookies were the ones overwritten. + QVERIFY(!findCookieName(jar.allCookies(), "CookieNo1")); + QVERIFY(!findCookieName(jar.allCookies(), "CookieNo10")); + QVERIFY(findCookieName(jar.allCookies(), "CookieNo11")); + QVERIFY(findCookieName(jar.allCookies(), "CookieNo60")); +} + void tst_QNetworkCookieJar::cookiesForUrl_data() { QTest::addColumn<QList<QNetworkCookie> >("allCookies"); diff --git a/tests/auto/qtextdocument/tst_qtextdocument.cpp b/tests/auto/qtextdocument/tst_qtextdocument.cpp index 1129219..c98a703 100644 --- a/tests/auto/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/qtextdocument/tst_qtextdocument.cpp @@ -182,6 +182,8 @@ private slots: void copiedFontSize(); + void htmlExportImportBlockCount(); + private: void backgroundImage_checkExpectedHtml(const QTextDocument &doc); @@ -1582,7 +1584,7 @@ void tst_QTextDocument::toHtml() expectedOutput.replace("OPENDEFAULTBLOCKSTYLE", "style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"); expectedOutput.replace("DEFAULTBLOCKSTYLE", "style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\""); - expectedOutput.replace("EMPTYBLOCK", "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n"); + expectedOutput.replace("EMPTYBLOCK", "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p>\n"); if (expectedOutput.endsWith(QLatin1Char('\n'))) expectedOutput.chop(1); expectedOutput.append(htmlTail); @@ -2760,5 +2762,27 @@ void tst_QTextDocument::copiedFontSize() QCOMPARE(cursorOutput.charFormat().font().pixelSize(), 24); } +void tst_QTextDocument::htmlExportImportBlockCount() +{ + QTextDocument document; + { + QTextCursor cursor(&document); + cursor.insertText("Foo"); + cursor.insertBlock(); + cursor.insertBlock(); + cursor.insertBlock(); + cursor.insertBlock(); + cursor.insertText("Bar"); + } + + QCOMPARE(document.blockCount(), 5); + QString html = document.toHtml(); + + document.clear(); + document.setHtml(html); + + QCOMPARE(document.blockCount(), 5); +} + QTEST_MAIN(tst_QTextDocument) #include "tst_qtextdocument.moc" diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 5550fe8..86773ad 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -71,6 +71,7 @@ #include <QtGui/qpaintengine.h> #include <private/qbackingstore_p.h> #include <qmenubar.h> +#include <qtableview.h> #include <QtGui/QGraphicsView> #include <QtGui/QGraphicsProxyWidget> @@ -406,6 +407,7 @@ private slots: void childAt(); #ifdef Q_WS_MAC void childAt_unifiedToolBar(); + void taskQTBUG_17333_ResizeInfiniteRecursion(); #ifdef QT_MAC_USE_COCOA void taskQTBUG_11373(); #endif // QT_MAC_USE_COCOA @@ -10572,6 +10574,18 @@ void tst_QWidget::childAt_unifiedToolBar() QCOMPARE(mainWindow.childAt(labelTopLeft), static_cast<QWidget *>(label)); } +void tst_QWidget::taskQTBUG_17333_ResizeInfiniteRecursion() +{ + QTableView tb; + const char *s = "border: 1px solid;"; + tb.setStyleSheet(s); + tb.show(); + + QTest::qWaitForWindowShown(&tb); + tb.setGeometry(QRect(100, 100, 0, 100)); + // No crash, it works. +} + #ifdef QT_MAC_USE_COCOA void tst_QWidget::taskQTBUG_11373() { diff --git a/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro b/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro index e5b9346..4bdfcb7 100644 --- a/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro +++ b/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro @@ -11,3 +11,5 @@ CONFIG += release # Input SOURCES += tst_qtcpserver.cpp + +symbian:TARGET.CAPABILITY += NetworkServices
\ No newline at end of file diff --git a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp index f81853b..f06c4eb 100644 --- a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp +++ b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp @@ -54,6 +54,10 @@ #include <qplatformdefs.h> #include <qhostinfo.h> +#include <QNetworkConfiguration> +#include <QNetworkConfigurationManager> +#include <QNetworkSession> + #include <QNetworkProxy> Q_DECLARE_METATYPE(QNetworkProxy) Q_DECLARE_METATYPE(QList<QNetworkProxy>) @@ -75,16 +79,42 @@ public: public slots: void initTestCase_data(); void init(); + void initTestCase(); void cleanup(); private slots: void ipv4LoopbackPerformanceTest(); void ipv6LoopbackPerformanceTest(); void ipv4PerformanceTest(); +private: +#ifndef QT_NO_BEARERMANAGEMENT + QNetworkConfigurationManager *netConfMan; + QNetworkConfiguration networkConfiguration; + QSharedPointer<QNetworkSession> networkSession; +#endif }; tst_QTcpServer::tst_QTcpServer() { - Q_SET_DEFAULT_IAP +} + +void tst_QTcpServer::initTestCase() +{ +#ifndef QT_NO_BEARERMANAGEMENT + netConfMan = new QNetworkConfigurationManager(this); + netConfMan->updateConfigurations(); + connect(netConfMan, SIGNAL(updateCompleted()), &QTestEventLoop::instance(), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(10); + networkConfiguration = netConfMan->defaultConfiguration(); + if (networkConfiguration.isValid()) { + networkSession = QSharedPointer<QNetworkSession>(new QNetworkSession(networkConfiguration)); + if (!networkSession->isOpen()) { + networkSession->open(); + QVERIFY(networkSession->waitForOpened(30000)); + } + } else { + QVERIFY(!(netConfMan->capabilities() & QNetworkConfigurationManager::NetworkSessionRequired)); + } +#endif } tst_QTcpServer::~tst_QTcpServer() @@ -98,6 +128,7 @@ void tst_QTcpServer::initTestCase_data() QTest::newRow("WithoutProxy") << false << 0; QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy); + QTest::newRow("WithHttpProxy") << true << int(QNetworkProxy::HttpProxy); } void tst_QTcpServer::init() @@ -179,9 +210,6 @@ void tst_QTcpServer::ipv6LoopbackPerformanceTest() QSKIP("WinCE WM: Not yet supported", SkipAll); #endif -#if defined(Q_OS_SYMBIAN) - QSKIP("Symbian: IPv6 is not yet supported", SkipAll); -#endif QTcpServer server; if (!server.listen(QHostAddress::LocalHostIPv6, 0)) { QVERIFY(server.serverError() == QAbstractSocket::UnsupportedSocketOperationError); @@ -236,6 +264,11 @@ void tst_QTcpServer::ipv4PerformanceTest() QTcpServer server; QVERIFY(server.listen(probeSocket.localAddress(), 0)); + QFETCH_GLOBAL(int, proxyType); + //For http proxy, only the active connection can be proxied and not the server socket + if (proxyType == QNetworkProxy::HttpProxy) + QNetworkProxy::setApplicationProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128)); + QTcpSocket clientA; clientA.connectToHost(server.serverAddress(), server.serverPort()); QVERIFY(clientA.waitForConnected(5000)); |