diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-01-17 07:11:26 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-01-17 07:12:23 +0100 |
commit | f596553e03c3969f6e7cb5344c05591da6e70dfb (patch) | |
tree | 8aef667749e1adc015cbc9c5ec5b5af9c6d4c15c /tests | |
parent | e32845b137834ef46d68345a0029d4af7c1d85bb (diff) | |
parent | 7030adff1869e850a7b983e88d7a773d5d594886 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
.qmake.conf
src/imports/dialogs/DefaultFileDialog.qml
src/imports/widgets/qquickqfiledialog.cpp
Change-Id: I00de6dd05cb773f01254061d585a82c90b229acd
Diffstat (limited to 'tests')
11 files changed, 104 insertions, 23 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 8809693647..30bc175346 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -8,13 +8,6 @@ SUBDIRS=\ qmldevtools.CONFIG = host_build -!mac { -SUBDIRS += \ - quick \ - particles \ - qmltest -} - installed_cmake.depends = cmake testcocoon: SUBDIRS -= headersclean diff --git a/tests/auto/qml/debugger/qpacketprotocol/tst_qpacketprotocol.cpp b/tests/auto/qml/debugger/qpacketprotocol/tst_qpacketprotocol.cpp index 8dfd25b58b..7fd1f47838 100644 --- a/tests/auto/qml/debugger/qpacketprotocol/tst_qpacketprotocol.cpp +++ b/tests/auto/qml/debugger/qpacketprotocol/tst_qpacketprotocol.cpp @@ -87,7 +87,7 @@ void tst_QPacketProtocol::init() m_client->connectToHost(m_server->serverAddress(), m_server->serverPort()); QVERIFY(m_client->waitForConnected()); - QVERIFY(m_server->waitForNewConnection(5000)); + QVERIFY(m_server->waitForNewConnection(10000)); m_serverConn = m_server->nextPendingConnection(); } diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/data/controlFromJS.qml b/tests/auto/qml/debugger/qqmlprofilerservice/data/controlFromJS.qml new file mode 100644 index 0000000000..7bcabc33ac --- /dev/null +++ b/tests/auto/qml/debugger/qqmlprofilerservice/data/controlFromJS.qml @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + Timer { + running: true + interval: 1 + onTriggered: { + console.profile(); + stopTimer.start(); + } + } + + Timer { + id: stopTimer + interval: 1000 + onTriggered: { + console.profileEnd(); + endTimer.start(); + } + } + + Timer { + id: endTimer + interval: 1000 + onTriggered: Qt.quit(); + } +} diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro b/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro index b2b325dc72..a83927e720 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro +++ b/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro @@ -14,4 +14,5 @@ QT += core qml testlib gui-private DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 OTHER_FILES += \ - data/pixmapCacheTest.qml + data/pixmapCacheTest.qml \ + data/controlFromJS.qml diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp index 929b079a51..acbc62807b 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp +++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp @@ -180,6 +180,7 @@ private slots: void pixmapCacheData(); void scenegraphData(); void profileOnExit(); + void controlFromJS(); }; void QQmlProfilerClient::messageReceived(const QByteArray &message) @@ -494,6 +495,24 @@ void tst_QQmlProfilerService::profileOnExit() QCOMPARE(m_client->traceMessages.last().detailType, (int)QQmlProfilerClient::EndTrace); } +void tst_QQmlProfilerService::controlFromJS() +{ + connect(true, "controlFromJS.qml"); + QVERIFY(m_client); + QTRY_COMPARE(m_client->state(), QQmlDebugClient::Enabled); + + m_client->setTraceState(false); + QVERIFY2(QQmlDebugTest::waitForSignal(m_client, SIGNAL(complete())), "No trace received in time."); + + // must start with "StartTrace" + QCOMPARE(m_client->traceMessages.first().messageType, (int)QQmlProfilerClient::Event); + QCOMPARE(m_client->traceMessages.first().detailType, (int)QQmlProfilerClient::StartTrace); + + // must end with "EndTrace" + QCOMPARE(m_client->traceMessages.last().messageType, (int)QQmlProfilerClient::Event); + QCOMPARE(m_client->traceMessages.last().detailType, (int)QQmlProfilerClient::EndTrace); +} + QTEST_MAIN(tst_QQmlProfilerService) #include "tst_qqmlprofilerservice.moc" diff --git a/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp b/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp index e6f31dcb83..a37d705284 100644 --- a/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp +++ b/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp @@ -115,8 +115,8 @@ void tst_qqmlconsole::profiling() QUrl testUrl = testFileUrl("profiling.qml"); // profiling() - QTest::ignoreMessage(QtDebugMsg, "Profiling started."); - QTest::ignoreMessage(QtDebugMsg, "Profiling ended."); + QTest::ignoreMessage(QtWarningMsg, "Cannot start profiling because debug service is disabled. Start with -qmljsdebugger=port:XXXXX."); + QTest::ignoreMessage(QtWarningMsg, "Profiling was not started."); QQmlComponent component(&engine, testUrl); QObject *object = component.create(); diff --git a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp index 4f21231184..553663ac22 100644 --- a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp +++ b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp @@ -676,6 +676,7 @@ void tst_qqmlcontext::qobjectDerived() QQmlContext context(engine.rootContext()); QObject *o1 = component.create(&context); + Q_UNUSED(o1); QCOMPARE(command.count, 2); } diff --git a/tests/auto/quick/nodes/tst_nodestest.cpp b/tests/auto/quick/nodes/tst_nodestest.cpp index d07fd7177d..7c84cdb5cf 100644 --- a/tests/auto/quick/nodes/tst_nodestest.cpp +++ b/tests/auto/quick/nodes/tst_nodestest.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** -** This file is part of the Qt scene graph research project. +** This file is part of the test suite of the Qt toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -97,6 +97,8 @@ void NodesTest::initTestCase() void NodesTest::cleanupTestCase() { + renderContext->invalidate(); + delete renderContext; context->doneCurrent(); delete context; delete surface; diff --git a/tests/auto/quick/qquickimage/tst_qquickimage.cpp b/tests/auto/quick/qquickimage/tst_qquickimage.cpp index 8bdb9c9de5..7fa58036dd 100644 --- a/tests/auto/quick/qquickimage/tst_qquickimage.cpp +++ b/tests/auto/quick/qquickimage/tst_qquickimage.cpp @@ -885,6 +885,7 @@ public: QImage requestImage(const QString &id, QSize *size, const QSize& requestedSize) { + Q_UNUSED(requestedSize); if (id == QLatin1String("first-image.png")) { QTest::qWait(50); int width = 100; diff --git a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp index 81d1bbd01d..2c868231c8 100644 --- a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp +++ b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp @@ -793,7 +793,7 @@ void tst_QQuickPathView::dataModel() QCOMPARE(window->rootObject()->property("viewCount").toInt(), model.count()); QTRY_COMPARE(findItems<QQuickItem>(pathview, "wrapper").count(), 14); - QVERIFY(pathview->currentIndex() == 0); + QCOMPARE(pathview->currentIndex(), 0); QCOMPARE(pathview->currentItem(), findItem<QQuickItem>(pathview, "wrapper", 0)); QQuickText *text = findItem<QQuickText>(pathview, "myText", 4); @@ -826,7 +826,7 @@ void tst_QQuickPathView::dataModel() QTest::qWait(100); QTRY_COMPARE(findItems<QQuickItem>(pathview, "wrapper").count(), 5); - QVERIFY(pathview->currentIndex() == 1); + QCOMPARE(pathview->currentIndex(), 1); QCOMPARE(pathview->currentItem(), findItem<QQuickItem>(pathview, "wrapper", 1)); text = findItem<QQuickText>(pathview, "myText", 2); @@ -1876,7 +1876,7 @@ void tst_QQuickPathView::snapToItem() if (enforceRange) QVERIFY(pathview->currentIndex() != currentIndex); else - QVERIFY(pathview->currentIndex() == currentIndex); + QCOMPARE(pathview->currentIndex(), currentIndex); } @@ -1908,7 +1908,7 @@ void tst_QQuickPathView::snapOneItem() QSignalSpy snapModeSpy(pathview, SIGNAL(snapModeChanged())); window->rootObject()->setProperty("snapOne", true); - QVERIFY(snapModeSpy.count() == 1); + QCOMPARE(snapModeSpy.count(), 1); QTRY_VERIFY(!pathview->isMoving()); // ensure stable int currentIndex = pathview->currentIndex(); @@ -1923,9 +1923,9 @@ void tst_QQuickPathView::snapOneItem() QCOMPARE(pathview->offset(), fmodf(3.0 + startOffset - 1.0, 3.0)); if (enforceRange) - QVERIFY(pathview->currentIndex() == currentIndex+1); + QCOMPARE(pathview->currentIndex(), currentIndex + 1); else - QVERIFY(pathview->currentIndex() == currentIndex); + QCOMPARE(pathview->currentIndex(), currentIndex); } @@ -2061,7 +2061,7 @@ void tst_QQuickPathView::cacheItemCount() pathview->setOffset(0); pathview->setCacheItemCount(3); - QVERIFY(pathview->cacheItemCount() == 3); + QCOMPARE(pathview->cacheItemCount(), 3); QQmlIncubationController controller; window->engine()->setIncubationController(&controller); diff --git a/tests/auto/quick/qquickview/tst_qquickview.cpp b/tests/auto/quick/qquickview/tst_qquickview.cpp index 77aeba9028..9b4fd2b32f 100644 --- a/tests/auto/quick/qquickview/tst_qquickview.cpp +++ b/tests/auto/quick/qquickview/tst_qquickview.cpp @@ -186,10 +186,6 @@ void tst_QQuickView::resizemodeitem() delete view; } -static void silentErrorsMsgHandler(QtMsgType, const QMessageLogContext &, const QString &) -{ -} - void tst_QQuickView::errors() { QQuickView *view = new QQuickView; |