From 6067b74bb7baadbd28bfdfa8e2d63b775c972b0f Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 24 Aug 2015 15:29:03 +0200 Subject: Fix hue clamping in Context2D It goes from 0..359, not 0..255. Task-number: QTBUG-47894 Change-Id: I0612a9d5e4999afae7703b5c49741b94fb0da07f Reviewed-by: Mitch Curtis --- tests/auto/quick/qquickcanvasitem/data/tst_context.qml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests') diff --git a/tests/auto/quick/qquickcanvasitem/data/tst_context.qml b/tests/auto/quick/qquickcanvasitem/data/tst_context.qml index f266c16d76..566ad9d3d5 100644 --- a/tests/auto/quick/qquickcanvasitem/data/tst_context.qml +++ b/tests/auto/quick/qquickcanvasitem/data/tst_context.qml @@ -182,4 +182,22 @@ Canvas { } } } + + TestCase { + name: "Colors" + when: canvas.available + + function test_colors() { + wait(100); + compare(contextSpy.count, 1); + + var ctx = canvas.getContext("2d"); + // QTBUG-47894 + ctx.strokeStyle = 'hsl(255, 100%, 50%)'; + var c1 = ctx.strokeStyle.toString(); + ctx.strokeStyle = 'hsl(320, 100%, 50%)'; + var c2 = ctx.strokeStyle.toString(); + verify(c1 !== c2); + } + } } -- cgit v1.2.3 From c962f3c8e874f21743684a52ee520939ae1be938 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 13 Aug 2015 22:08:49 +0200 Subject: Fix autotest The test was not getting a new warning as assumed, but still reading the old warning from a few lines before. This mirrors the intended behavior. Change-Id: I7211923e378db34cdc5f8c1c78f3cfb1bea548d2 Reviewed-by: Simon Hausmann --- tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp index f4765d0e8d..8ad2b6ba2b 100644 --- a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp +++ b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp @@ -338,19 +338,17 @@ void tst_QQuickWorkerScript::script_global() delete worker; } + qquickworkerscript_lastWarning = QString(); + { + QtMessageHandler previousMsgHandler = qInstallMessageHandler(qquickworkerscript_warningsHandler); + QQmlComponent component(&m_engine, testFileUrl("worker_global2.qml")); QQuickWorkerScript *worker = qobject_cast(component.create()); QVERIFY(worker != 0); - QString value("Hello"); - - QtMessageHandler previousMsgHandler = qInstallMessageHandler(qquickworkerscript_warningsHandler); - - QVERIFY(QMetaObject::invokeMethod(worker, "testSend", Q_ARG(QVariant, value))); - QTRY_COMPARE(qquickworkerscript_lastWarning, - testFileUrl("script_global.js").toString() + QLatin1String(":2: Invalid write to global property \"world\"")); + testFileUrl("script_global2.js").toString() + QLatin1String(":1: Invalid write to global property \"world\"")); qInstallMessageHandler(previousMsgHandler); -- cgit v1.2.3 From 89c3c79c257fe53122cce1c739453bc45b5926b8 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 25 Aug 2015 09:08:58 +0200 Subject: Fix warning in tst_qquickdesignersupport.cpp Taking the address of a temporary is not allowed. It is against the standard to pass a non-const reference to a temporary object. Change-Id: Ib333fa9a366725b8f0491a4216597fa5baeef7ff Reviewed-by: Friedemann Kleint --- tests/auto/quick/qquickdesignersupport/tst_qquickdesignersupport.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/quick/qquickdesignersupport/tst_qquickdesignersupport.cpp b/tests/auto/quick/qquickdesignersupport/tst_qquickdesignersupport.cpp index 49535783c1..1104ce1d98 100644 --- a/tests/auto/quick/qquickdesignersupport/tst_qquickdesignersupport.cpp +++ b/tests/auto/quick/qquickdesignersupport/tst_qquickdesignersupport.cpp @@ -394,7 +394,8 @@ void tst_qquickdesignersupport::statesPropertyChanges() //Create new PropertyChanges QQuickPropertyChanges *newPropertyChange = new QQuickPropertyChanges(); newPropertyChange->setParent(state01); - QQuickStatePrivate::operations_append(&state01->changes(), newPropertyChange); + QQmlListProperty changes = state01->changes(); + QQuickStatePrivate::operations_append(&changes, newPropertyChange); newPropertyChange->setObject(rootItem); -- cgit v1.2.3 From c34534ef2019dd47ea3f2c6d9c55da26ef3a3d71 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 25 Aug 2015 10:48:33 +0200 Subject: Fix sha1 of test262 While .gitmodules was pointing at the new URL, the sha1 for the submodule was pointing to the old github repository. Change-Id: Ie0b9f39e13a6e759249aaaf0e90c5a242bb36134 Reviewed-by: Simon Hausmann --- tests/manual/v4/test262 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/manual/v4/test262 b/tests/manual/v4/test262 index 0b5af3dcec..9741ac4655 160000 --- a/tests/manual/v4/test262 +++ b/tests/manual/v4/test262 @@ -1 +1 @@ -Subproject commit 0b5af3dcec772bb06b4d685a20b2859cda59d189 +Subproject commit 9741ac4655808ac46c127e3d1d8ba3d27ada618e -- cgit v1.2.3 From 1faca908dddb90824d94bed6a1561f4f192328d3 Mon Sep 17 00:00:00 2001 From: Julien Brianceau Date: Thu, 27 Aug 2015 14:37:50 +0200 Subject: XHR: Server side errors are not network errors XMLHttpRequest specs state that only 'network errors' should result in a request error, and a server side error like HTTP 500 Internal Server Error (which results in QNetworkReply::InternalServerError) is an indication of the HTTP server response rather than a network error. Change-Id: I94bf678a8487e3d31007dc5119d6fb4e87ea3102 Reviewed-by: Simon Hausmann Reviewed-by: Valery Kotov --- tests/auto/qml/qqmlxmlhttprequest/data/status.500.reply | 3 +++ tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp | 1 + 2 files changed, 4 insertions(+) create mode 100644 tests/auto/qml/qqmlxmlhttprequest/data/status.500.reply (limited to 'tests') diff --git a/tests/auto/qml/qqmlxmlhttprequest/data/status.500.reply b/tests/auto/qml/qqmlxmlhttprequest/data/status.500.reply new file mode 100644 index 0000000000..cbe2424f34 --- /dev/null +++ b/tests/auto/qml/qqmlxmlhttprequest/data/status.500.reply @@ -0,0 +1,3 @@ +HTTP/1.0 500 Internal Server Error +Connection: close +Content-type: text/html; charset=UTF-8 diff --git a/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp b/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp index ae0350278a..47bf151a37 100644 --- a/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp +++ b/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp @@ -989,6 +989,7 @@ void tst_qqmlxmlhttprequest::responseText_data() QTest::newRow("empty body") << testFileUrl("status.200.reply") << QUrl() << ""; QTest::newRow("Not Found") << testFileUrl("status.404.reply") << testFileUrl("testdocument.html") << "QML Rocks!\n"; QTest::newRow("Bad Request") << testFileUrl("status.400.reply") << testFileUrl("testdocument.html") << "QML Rocks!\n"; + QTest::newRow("Internal server error") << testFileUrl("status.500.reply") << testFileUrl("testdocument.html") << "QML Rocks!\n"; } void tst_qqmlxmlhttprequest::nonUtf8() -- cgit v1.2.3 From d1b20513798ed441afddb87fd4e7facce78349e1 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 25 Aug 2015 15:43:56 +0200 Subject: Don't consider QLocale a value type. This fixes a regression where all of the properties of Qt.inputMethod.locale were undefined. Change-Id: Id33890a78296709baad6aeda96d74ca8cb39c61d Task-number: QTBUG-47916 Reviewed-by: Mitch Curtis Reviewed-by: Simon Hausmann --- tests/auto/qml/qqmlvaluetypes/data/locale_read.qml | 22 +++++++++++++ .../auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp | 38 ++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 tests/auto/qml/qqmlvaluetypes/data/locale_read.qml (limited to 'tests') diff --git a/tests/auto/qml/qqmlvaluetypes/data/locale_read.qml b/tests/auto/qml/qqmlvaluetypes/data/locale_read.qml new file mode 100644 index 0000000000..5ae6b41259 --- /dev/null +++ b/tests/auto/qml/qqmlvaluetypes/data/locale_read.qml @@ -0,0 +1,22 @@ +import QtQuick 2.0 + +Item { + property string amText: Qt.inputMethod.locale.amText + property string decimalPoint: Qt.inputMethod.locale.decimalPoint + property string exponential: Qt.inputMethod.locale.exponential + property int firstDayOfWeek: Qt.inputMethod.locale.firstDayOfWeek + property string groupSeparator: Qt.inputMethod.locale.groupSeparator + property int measurementSystem: Qt.inputMethod.locale.measurementSystem + property string name: Qt.inputMethod.locale.name + property string nativeCountryName: Qt.inputMethod.locale.nativeCountryName + property string nativeLanguageName: Qt.inputMethod.locale.nativeLanguageName + property string negativeSign: Qt.inputMethod.locale.negativeSign + property string percent: Qt.inputMethod.locale.percent + property string pmText: Qt.inputMethod.locale.pmText + property string positiveSign: Qt.inputMethod.locale.positiveSign + property int textDirection: Qt.inputMethod.locale.textDirection + property var uiLanguages: Qt.inputMethod.locale.uiLanguages + property var weekDays: Qt.inputMethod.locale.weekDays + property string zeroDigit: Qt.inputMethod.locale.zeroDigit +} + diff --git a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp index 578004b0a1..f93190cab6 100644 --- a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp +++ b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include "../../shared/util.h" #include "testtypes.h" @@ -67,6 +68,7 @@ private slots: void font(); void color(); void variant(); + void locale(); void bindingAssignment(); void bindingRead(); @@ -316,6 +318,42 @@ void tst_qqmlvaluetypes::variant() } } +void tst_qqmlvaluetypes::locale() +{ + { + QQmlComponent component(&engine, testFileUrl("locale_read.qml")); + QScopedPointer object(component.create()); + QVERIFY(!object.isNull()); + + QVERIFY(QQml_guiProvider()->inputMethod()); + QInputMethod *inputMethod = qobject_cast(QQml_guiProvider()->inputMethod()); + QLocale locale = inputMethod->locale(); + + QCOMPARE(object->property("amText").toString(), locale.amText()); + QCOMPARE(object->property("decimalPoint").toString().at(0), locale.decimalPoint()); + QCOMPARE(object->property("exponential").toString().at(0), locale.exponential()); + // Sunday is 0 in JavaScript. + QCOMPARE(object->property("firstDayOfWeek").toInt(), int(locale.firstDayOfWeek() == Qt::Sunday ? 0 : locale.firstDayOfWeek())); + QCOMPARE(object->property("groupSeparator").toString().at(0), locale.groupSeparator()); + QCOMPARE(object->property("measurementSystem").toInt(), int(locale.measurementSystem())); + QCOMPARE(object->property("name").toString(), locale.name()); + QCOMPARE(object->property("nativeCountryName").toString(), locale.nativeCountryName()); + QCOMPARE(object->property("nativeLanguageName").toString(), locale.nativeLanguageName()); + QCOMPARE(object->property("negativeSign").toString().at(0), locale.negativeSign()); + QCOMPARE(object->property("percent").toString().at(0), locale.percent()); + QCOMPARE(object->property("pmText").toString(), locale.pmText()); + QCOMPARE(object->property("positiveSign").toString().at(0), locale.positiveSign()); + QCOMPARE(object->property("textDirection").toInt(), int(locale.textDirection())); + QCOMPARE(object->property("uiLanguages").toStringList(), locale.uiLanguages()); + QList weekDays; + foreach (const QVariant &weekDay, object->property("weekDays").toList()) { + weekDays.append(Qt::DayOfWeek(weekDay.toInt())); + } + QCOMPARE(weekDays, locale.weekdays()); + QCOMPARE(object->property("zeroDigit").toString().at(0), locale.zeroDigit()); + } +} + void tst_qqmlvaluetypes::sizereadonly() { { -- cgit v1.2.3 From 91a96d1de9c3d3f8d598ee8fbcf2d1868635ec46 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 3 Sep 2015 13:32:24 +0200 Subject: Temporarily blacklist importsPath change on Windows The test started failing with no changes in declarative, so the best theory at this point is a networking related change in qtbase. Change-Id: If361253847d781126d3877080648f5ccc07808cd Reviewed-by: Simon Hausmann --- tests/auto/qml/qqmllanguage/BLACKLIST | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests/auto/qml/qqmllanguage/BLACKLIST (limited to 'tests') diff --git a/tests/auto/qml/qqmllanguage/BLACKLIST b/tests/auto/qml/qqmllanguage/BLACKLIST new file mode 100644 index 0000000000..c1c7e56df9 --- /dev/null +++ b/tests/auto/qml/qqmllanguage/BLACKLIST @@ -0,0 +1,2 @@ +[importsPath] +windows -- cgit v1.2.3 From 217bca42934ecf9a5fab74bbddbfa852c9b1bfe6 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 1 Sep 2015 18:04:44 +0200 Subject: QQuickView/QQuickWidget::errors(): fix crash Change-Id: Ie37ed5fac642931b658d2b738ddd45d23cda54c6 Reviewed-by: Robin Burchell Reviewed-by: Mitch Curtis --- tests/auto/quick/qquickview/tst_qquickview.cpp | 4 ++++ tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp | 1 + 2 files changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/auto/quick/qquickview/tst_qquickview.cpp b/tests/auto/quick/qquickview/tst_qquickview.cpp index 2f054e278a..69e27984c7 100644 --- a/tests/auto/quick/qquickview/tst_qquickview.cpp +++ b/tests/auto/quick/qquickview/tst_qquickview.cpp @@ -180,6 +180,10 @@ void tst_QQuickView::resizemodeitem() void tst_QQuickView::errors() { + { + QQuickView view; + QVERIFY(view.errors().isEmpty()); // don't crash + } { QQuickView view; QQmlTestMessageHandler messageHandler; diff --git a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp index 11696e288f..7cc5dfa7c6 100644 --- a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp +++ b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp @@ -223,6 +223,7 @@ void tst_qquickwidget::errors() { QQuickWidget *view = new QQuickWidget; QScopedPointer cleanupView(view); + QVERIFY(view->errors().isEmpty()); // don't crash QQmlTestMessageHandler messageHandler; view->setSource(testFileUrl("error1.qml")); -- cgit v1.2.3 From 7ee93972d0f907725ad47f9a08b65a14ca48e9c0 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Fri, 4 Sep 2015 13:31:43 +0200 Subject: Item views: Don't emit 'currentItemChanged' if the current item didn't really change Change-Id: I8892bb9b6ab6737d4a6f6f8aab836f863668682e Reviewed-by: J-P Nurmi --- tests/auto/quick/qquickgridview/data/gridview-initCurrent.qml | 3 +++ tests/auto/quick/qquickgridview/tst_qquickgridview.cpp | 3 +++ tests/auto/quick/qquicklistview/data/listview-initCurrent.qml | 3 +++ tests/auto/quick/qquicklistview/tst_qquicklistview.cpp | 3 +++ 4 files changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/auto/quick/qquickgridview/data/gridview-initCurrent.qml b/tests/auto/quick/qquickgridview/data/gridview-initCurrent.qml index af35d2fa1b..0a6184c9de 100644 --- a/tests/auto/quick/qquickgridview/data/gridview-initCurrent.qml +++ b/tests/auto/quick/qquickgridview/data/gridview-initCurrent.qml @@ -6,6 +6,7 @@ Rectangle { property int current: grid.currentIndex property bool showHeader: false property bool showFooter: false + property int currentItemChangedCount: 0 width: 240 height: 320 @@ -63,5 +64,7 @@ Rectangle { model: testModel header: root.showHeader ? headerFooter : null footer: root.showFooter ? headerFooter : null + + onCurrentItemChanged: { root.currentItemChangedCount++ } } } diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp index 87042ca7ba..3699bef56d 100644 --- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp +++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp @@ -1886,9 +1886,12 @@ void tst_QQuickGridView::currentIndex() QTRY_COMPARE(gridview->highlightItem()->y(), hlPosY); // insert item before currentIndex + window->rootObject()->setProperty("currentItemChangedCount", QVariant(0)); gridview->setCurrentIndex(28); + QTRY_COMPARE(window->rootObject()->property("currentItemChangedCount").toInt(), 1); model.insertItem(0, "Foo", "1111"); QTRY_COMPARE(window->rootObject()->property("current").toInt(), 29); + QCOMPARE(window->rootObject()->property("currentItemChangedCount").toInt(), 1); // check removing highlight by setting currentIndex to -1; gridview->setCurrentIndex(-1); diff --git a/tests/auto/quick/qquicklistview/data/listview-initCurrent.qml b/tests/auto/quick/qquicklistview/data/listview-initCurrent.qml index a02b66b8af..8aff649a67 100644 --- a/tests/auto/quick/qquicklistview/data/listview-initCurrent.qml +++ b/tests/auto/quick/qquicklistview/data/listview-initCurrent.qml @@ -6,6 +6,7 @@ Rectangle { property int current: list.currentIndex property bool showHeader: false property bool showFooter: false + property int currentItemChangedCount: 0 width: 240 height: 320 @@ -60,5 +61,7 @@ Rectangle { model: testModel header: root.showHeader ? headerFooter : null footer: root.showFooter ? headerFooter : null + + onCurrentItemChanged: { root.currentItemChangedCount++ } } } diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp index 472ffdc4b6..8e7f93849c 100644 --- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp @@ -2718,9 +2718,12 @@ void tst_QQuickListView::currentIndex() QTRY_COMPARE(listview->highlightItem()->y(), hlPos); // insert item before currentIndex + window->rootObject()->setProperty("currentItemChangedCount", QVariant(0)); listview->setCurrentIndex(28); + QTRY_COMPARE(window->rootObject()->property("currentItemChangedCount").toInt(), 1); model.insertItem(0, "Foo", "1111"); QTRY_COMPARE(window->rootObject()->property("current").toInt(), 29); + QCOMPARE(window->rootObject()->property("currentItemChangedCount").toInt(), 1); // check removing highlight by setting currentIndex to -1; listview->setCurrentIndex(-1); -- cgit v1.2.3