From fb20d2f7b149725b0fcc8e5bbb377cd6dababc9b Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 19 Apr 2018 18:29:30 +0200 Subject: Use Los Angeles to represent PST8PDT, not Vancouver This amends commit 2b8b7a162be52f8cd6c2bc39f498a1ddfb59dd68. The very last test (15.9.5.43-0-8) in the ES test-suite relies on constructing a time *just* outside the valid range, to provoke (and check it gets) a RangeError. However, it uses the current time-zone offset in computing this; and the local time -> UTC conversion in the Date constructor uses the zone information for the zone at the given time. The TZ db uses each zone's local mean solar time for the period before a formal zone was introduced; and Vancouver is further West than the nominal meridian for its zone. The test code throws in an hour's correction in case it's run in daylight-saving time, which would put the test time, when run during standard time, an hour (and a millisecond, rather than just the millisecond) outside the valid Date range, so as to ensure it's still a ms outside when the test is run during DST. However, the 12m28s mean solar offset overcomes the 1ms and puts the time back in range durign DST (but still 47m32.001s outside during standard time, which is why this problem only surfaced when North America entered summer time). Fortunately, Los Angeles is further East than the meridian in question, and uses the same zone. Task-number: QTBUG-67010 Change-Id: I58fd7bf14366ebe5842b8abd7e6802c9c78ca27e Reviewed-by: Lars Knoll Reviewed-by: Simon Hausmann --- tests/auto/qml/ecmascripttests/test262.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/qml/ecmascripttests/test262.py b/tests/auto/qml/ecmascripttests/test262.py index ae4c54df9d..e055c7a8e7 100755 --- a/tests/auto/qml/ecmascripttests/test262.py +++ b/tests/auto/qml/ecmascripttests/test262.py @@ -555,7 +555,7 @@ def Main(): # Uncomment the next line for more logging info. #logging.basicConfig(level=logging.DEBUG) # Some date tests rely on being run in pacific time and the USA's locale: - os.environ["TZ"] = "America/Vancouver" + os.environ["TZ"] = "America/Los_Angeles" # it *matters* that this is (7m8s) *East* of PST's nominal meridian ! os.environ["LANG"] = "en_US.UTF-8" os.environ["LC_TIME"] = "en_US.UTF-8" parser = BuildOptions() -- cgit v1.2.3 From bea27694ae60bc0273ee3a6f34a57168c9bf01a1 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 20 Apr 2018 19:08:22 +0200 Subject: Update submodule now that I've fixed the actual bug here The submodule has now reverted my "fix" for a test the ES spec initially lead me to think was misguided; the test is fine, in fact, but I was using the wrong time-zone to run it. That's now fixed here, so we can take in the revert of the mis-fix. Task-number: QTBUG-67010 Change-Id: I89c8236ce11ee4dc16eb145e37f4510e19977bb2 Reviewed-by: Simon Hausmann --- tests/auto/qml/ecmascripttests/test262 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/qml/ecmascripttests/test262 b/tests/auto/qml/ecmascripttests/test262 index 40b4f28e98..e505c11eeb 160000 --- a/tests/auto/qml/ecmascripttests/test262 +++ b/tests/auto/qml/ecmascripttests/test262 @@ -1 +1 @@ -Subproject commit 40b4f28e98c416a092e26aa17489bf94ccb8bf4f +Subproject commit e505c11eebe5a389a7d47a4bf570c66469740b01 -- cgit v1.2.3 From 03739f2150d59248fb2c4b688c6352182f630f3e Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 23 Apr 2018 12:23:42 +0200 Subject: Make QtQmlDebug independent of QtQml This means QtQmlDebug needs its own qqmlprofilerdefintions.h. This is a good thing because this way we notice if we change the definitions in an incompatible way. The test uses QtQmlDebug after all. Also, qqmldebugserviceinterfaces_p.h is not available anymore, which means the service names have to be spelled out. This, also, is beneficial as it prevents us from accidentally changing the names. In the context of QmlDebug we don't need to namespace the profiler definitions, either. This simplifies some code. Task-number: QTBUG-60996 Change-Id: Ibb39e48c9b758687d68b8ce4431f45eb26939a09 Reviewed-by: Simon Hausmann --- .../tst_qqmlprofilerservice.cpp | 84 ++++++++++------------ 1 file changed, 37 insertions(+), 47 deletions(-) (limited to 'tests') diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp index 562804bc45..a6fbdf41e4 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp +++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp @@ -40,7 +40,7 @@ #include #include -class QQmlProfilerTestClient : public QQmlProfilerEventReceiver, public QQmlProfilerDefinitions +class QQmlProfilerTestClient : public QQmlProfilerEventReceiver { Q_OBJECT @@ -229,8 +229,8 @@ private: bool m_isComplete = false; // Don't use ({...}) here as MSVC will interpret that as the "QVector(int size)" ctor. - const QVector m_rangeStart = (QVector() << QQmlProfilerDefinitions::RangeStart); - const QVector m_rangeEnd = (QVector() << QQmlProfilerDefinitions::RangeEnd); + const QVector m_rangeStart = (QVector() << RangeStart); + const QVector m_rangeEnd = (QVector() << RangeEnd); }; #define VERIFY(type, position, expected, checks, numbers) \ @@ -247,7 +247,7 @@ QQmlDebugTest::ConnectResult tst_QQmlProfilerService::connect( // ### Still using qmlscene due to QTBUG-33377 return QQmlDebugTest::connect( QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", - restrictServices ? QQmlDebuggingEnabler::profilerServices().join(',') : QString(), + restrictServices ? "CanvasFrameRate,EngineControl,DebugMessages" : QString(), testFile(file), block); } @@ -272,15 +272,11 @@ void tst_QQmlProfilerService::checkTraceReceived() QVector numbers; // must start with "StartTrace" - QQmlProfilerEventType expected(QQmlProfilerDefinitions::Event, - QQmlProfilerDefinitions::MaximumRangeType, - QQmlProfilerDefinitions::StartTrace); + QQmlProfilerEventType expected(Event, MaximumRangeType, StartTrace); VERIFY(MessageListAsynchronous, 0, expected, CheckMessageType | CheckDetailType, numbers); // must end with "EndTrace" - expected = QQmlProfilerEventType(QQmlProfilerDefinitions::Event, - QQmlProfilerDefinitions::MaximumRangeType, - QQmlProfilerDefinitions::EndTrace); + expected = QQmlProfilerEventType(Event, MaximumRangeType, EndTrace); VERIFY(MessageListAsynchronous, m_client->asynchronousMessages.length() - 1, expected, CheckMessageType | CheckDetailType, numbers); } @@ -299,15 +295,15 @@ void tst_QQmlProfilerService::checkJsHeap() const qint64 amount = message.number(0); const QQmlProfilerEventType &type = m_client->types.at(message.typeIndex()); switch (type.detailType()) { - case QV4::Profiling::HeapPage: + case HeapPage: allocated += amount; seen_alloc = true; break; - case QV4::Profiling::SmallItem: + case SmallItem: used += amount; seen_small = true; break; - case QV4::Profiling::LargeItem: + case LargeItem: allocated += amount; used += amount; seen_large = true; @@ -548,28 +544,27 @@ void tst_QQmlProfilerService::pixmapCacheData() checkTraceReceived(); checkJsHeap(); - auto createType = [](QQmlProfilerDefinitions::PixmapEventType type) { - return QQmlProfilerEventType(QQmlProfilerDefinitions::PixmapCacheEvent, - QQmlProfilerDefinitions::MaximumRangeType, type); + auto createType = [](PixmapEventType type) { + return QQmlProfilerEventType(PixmapCacheEvent, MaximumRangeType, type); }; QVector numbers; // image starting to load - VERIFY(MessageListPixmap, 0, createType(QQmlProfilerDefinitions::PixmapLoadingStarted), + VERIFY(MessageListPixmap, 0, createType(PixmapLoadingStarted), CheckMessageType | CheckDetailType, numbers); // image size numbers = QVector({2, 2, 1}); - VERIFY(MessageListPixmap, 1, createType(QQmlProfilerDefinitions::PixmapSizeKnown), + VERIFY(MessageListPixmap, 1, createType(PixmapSizeKnown), CheckMessageType | CheckDetailType | CheckNumbers, numbers); // image loaded - VERIFY(MessageListPixmap, 2, createType(QQmlProfilerDefinitions::PixmapLoadingFinished), + VERIFY(MessageListPixmap, 2, createType(PixmapLoadingFinished), CheckMessageType | CheckDetailType, numbers); // cache size - VERIFY(MessageListPixmap, 3, createType(QQmlProfilerDefinitions::PixmapCacheCountChanged), + VERIFY(MessageListPixmap, 3, createType(PixmapCacheCountChanged), CheckMessageType | CheckDetailType, numbers); } @@ -597,8 +592,8 @@ void tst_QQmlProfilerService::scenegraphData() if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL)) { foreach (const QQmlProfilerEvent &msg, m_client->asynchronousMessages) { const QQmlProfilerEventType &type = m_client->types.at(msg.typeIndex()); - if (type.message() == QQmlProfilerDefinitions::SceneGraphFrame) { - if (type.detailType() == QQmlProfilerDefinitions::SceneGraphContextFrame) { + if (type.message() == SceneGraphFrame) { + if (type.detailType() == SceneGraphContextFrame) { contextFrameTime = msg.timestamp(); break; } @@ -610,7 +605,7 @@ void tst_QQmlProfilerService::scenegraphData() #endif foreach (const QQmlProfilerEvent &msg, m_client->asynchronousMessages) { const QQmlProfilerEventType &type = m_client->types.at(msg.typeIndex()); - if (type.detailType() == QQmlProfilerDefinitions::SceneGraphRendererFrame) { + if (type.detailType() == SceneGraphRendererFrame) { QVERIFY(msg.timestamp() >= contextFrameTime); renderFrameTime = msg.timestamp(); break; @@ -621,7 +616,7 @@ void tst_QQmlProfilerService::scenegraphData() foreach (const QQmlProfilerEvent &msg, m_client->asynchronousMessages) { const QQmlProfilerEventType &type = m_client->types.at(msg.typeIndex()); - if (type.detailType() == QQmlProfilerDefinitions::SceneGraphRenderLoopFrame) { + if (type.detailType() == SceneGraphRenderLoopFrame) { if (msg.timestamp() >= contextFrameTime) { // Make sure SceneGraphRenderLoopFrame is not between SceneGraphContextFrame and // SceneGraphRendererFrame. A SceneGraphRenderLoopFrame before everything else is @@ -664,8 +659,7 @@ void tst_QQmlProfilerService::signalSourceLocation() auto createType = [](int line, int column) { return QQmlProfilerEventType( - QQmlProfilerDefinitions::MaximumMessage, - QQmlProfilerDefinitions::HandlingSignal, -1, + MaximumMessage, HandlingSignal, -1, QQmlProfilerEventLocation(QLatin1String("signalSourceLocation.qml"), line, column)); }; @@ -684,23 +678,21 @@ void tst_QQmlProfilerService::javascript() checkTraceReceived(); checkJsHeap(); - VERIFY(MessageListJavaScript, 2, QQmlProfilerEventType(QQmlProfilerDefinitions::MaximumMessage, - QQmlProfilerDefinitions::Javascript), + VERIFY(MessageListJavaScript, 2, QQmlProfilerEventType(MaximumMessage, Javascript), CheckMessageType | CheckDetailType | CheckNumbers, m_rangeStart); VERIFY(MessageListJavaScript, 3, - QQmlProfilerEventType(QQmlProfilerDefinitions::MaximumMessage, - QQmlProfilerDefinitions::Javascript, -1, - QQmlProfilerEventLocation(QLatin1String("javascript.qml"), 4, 5)), + QQmlProfilerEventType( + MaximumMessage, Javascript, -1, + QQmlProfilerEventLocation(QLatin1String("javascript.qml"), 4, 5)), CheckType | CheckNumbers, m_rangeStart); VERIFY(MessageListJavaScript, 4, QQmlProfilerEventType( - QQmlProfilerDefinitions::MaximumMessage, QQmlProfilerDefinitions::Javascript, -1, + MaximumMessage, Javascript, -1, QQmlProfilerEventLocation(), QLatin1String("something")), CheckMessageType | CheckDetailType | CheckDataEndsWith | CheckNumbers, m_rangeStart); - VERIFY(MessageListJavaScript, 10, QQmlProfilerEventType(QQmlProfilerDefinitions::MaximumMessage, - QQmlProfilerDefinitions::Javascript), + VERIFY(MessageListJavaScript, 10, QQmlProfilerEventType(MaximumMessage, Javascript), CheckMessageType | CheckDetailType | CheckNumbers, m_rangeEnd); } @@ -726,8 +718,7 @@ void tst_QQmlProfilerService::translationBinding() checkTraceReceived(); checkJsHeap(); - const QQmlProfilerEventType type(QQmlProfilerDefinitions::MaximumMessage, - QQmlProfilerDefinitions::Binding); + const QQmlProfilerEventType type(MaximumMessage, Binding); VERIFY(MessageListQML, 4, type, CheckDetailType | CheckMessageType | CheckNumbers, m_rangeStart); @@ -746,7 +737,7 @@ void tst_QQmlProfilerService::memory() int smallItems = 0; for (auto message : m_client->jsHeapMessages) { const QQmlProfilerEventType &type = m_client->types[message.typeIndex()]; - if (type.detailType() == QV4::Profiling::SmallItem) + if (type.detailType() == SmallItem) ++smallItems; } @@ -756,8 +747,7 @@ void tst_QQmlProfilerService::memory() static bool hasCompileEvents(const QVector &types) { for (const QQmlProfilerEventType &type : types) { - if (type.message() == QQmlProfilerDefinitions::MaximumMessage - && type.rangeType() == QQmlProfilerDefinitions::Compiling) + if (type.message() == MaximumMessage && type.rangeType() == Compiling) return true; } return false; @@ -776,29 +766,29 @@ void tst_QQmlProfilerService::compile() checkTraceReceived(); checkJsHeap(); - QQmlProfilerDefinitions::Message rangeStage = QQmlProfilerDefinitions::MaximumMessage; + Message rangeStage = MaximumMessage; for (auto message : m_client->qmlMessages) { const QQmlProfilerEventType &type = m_client->types[message.typeIndex()]; - if (type.rangeType() == QQmlProfilerDefinitions::Compiling) { + if (type.rangeType() == Compiling) { switch (rangeStage) { - case QQmlProfilerDefinitions::MaximumMessage: - QCOMPARE(message.rangeStage(), QQmlProfilerDefinitions::RangeStart); + case MaximumMessage: + QCOMPARE(message.rangeStage(), RangeStart); break; - case QQmlProfilerDefinitions::RangeStart: - QCOMPARE(message.rangeStage(), QQmlProfilerDefinitions::RangeEnd); + case RangeStart: + QCOMPARE(message.rangeStage(), RangeEnd); break; default: QFAIL("Wrong range stage"); } rangeStage = message.rangeStage(); - QCOMPARE(type.message(), QQmlProfilerDefinitions::MaximumMessage); + QCOMPARE(type.message(), MaximumMessage); QCOMPARE(type.location().filename(), testFileUrl("test.qml").toString()); QCOMPARE(type.location().line(), 0); QCOMPARE(type.location().column(), 0); } } - QCOMPARE(rangeStage, QQmlProfilerDefinitions::RangeEnd); + QCOMPARE(rangeStage, RangeEnd); } QTEST_MAIN(tst_QQmlProfilerService) -- cgit v1.2.3 From ac6e893c5c7b43cfc50c25bebee1dfd4d3840124 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 23 Apr 2018 13:57:11 +0200 Subject: Make the shared test code independent of QtQml This enables us to drop the QML dependency from a number of tests. This is desirable because we want to test that we didn't do any incompatible changes to the debug framework. Change-Id: I937dd45d3079eac15c200c9d68bb4c911f61afc0 Reviewed-by: Simon Hausmann --- .../qdebugmessageservice/qdebugmessageservice.pro | 2 +- .../debugger/qpacketprotocol/qpacketprotocol.pro | 2 +- .../debugger/qqmldebuglocal/tst_qqmldebuglocal.cpp | 1 - .../qqmlenginecontrol/qqmlenginecontrol.pro | 2 +- .../qqmlenginedebuginspectorintegrationtest.pro | 2 +- .../qqmlenginedebugservice.pro | 2 +- .../qml/debugger/qqmlinspector/qqmlinspector.pro | 2 +- .../qqmlprofilerservice/qqmlprofilerservice.pro | 2 +- .../tst_qqmlprofilerservice.cpp | 1 - tests/auto/qml/debugger/shared/debugutil.cpp | 16 ++++++++---- .../qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp | 28 ++++++++++++++++++-- tests/auto/shared/util.cpp | 30 ---------------------- tests/auto/shared/util.h | 6 ----- 13 files changed, 44 insertions(+), 52 deletions(-) (limited to 'tests') diff --git a/tests/auto/qml/debugger/qdebugmessageservice/qdebugmessageservice.pro b/tests/auto/qml/debugger/qdebugmessageservice/qdebugmessageservice.pro index 9cf323ba36..3f2c0ca390 100644 --- a/tests/auto/qml/debugger/qdebugmessageservice/qdebugmessageservice.pro +++ b/tests/auto/qml/debugger/qdebugmessageservice/qdebugmessageservice.pro @@ -1,6 +1,6 @@ CONFIG += testcase TARGET = tst_qdebugmessageservice -QT += qml network testlib gui-private core-private +QT += network testlib gui-private core-private osx:CONFIG -= app_bundle SOURCES += tst_qdebugmessageservice.cpp diff --git a/tests/auto/qml/debugger/qpacketprotocol/qpacketprotocol.pro b/tests/auto/qml/debugger/qpacketprotocol/qpacketprotocol.pro index b1e3835844..dc0120cd87 100644 --- a/tests/auto/qml/debugger/qpacketprotocol/qpacketprotocol.pro +++ b/tests/auto/qml/debugger/qpacketprotocol/qpacketprotocol.pro @@ -6,4 +6,4 @@ SOURCES += tst_qpacketprotocol.cpp include(../shared/debugutil.pri) -QT += qml network testlib gui-private core-private +QT += network testlib gui-private core-private diff --git a/tests/auto/qml/debugger/qqmldebuglocal/tst_qqmldebuglocal.cpp b/tests/auto/qml/debugger/qqmldebuglocal/tst_qqmldebuglocal.cpp index 9f0501241d..5b3c0c5240 100644 --- a/tests/auto/qml/debugger/qqmldebuglocal/tst_qqmldebuglocal.cpp +++ b/tests/auto/qml/debugger/qqmldebuglocal/tst_qqmldebuglocal.cpp @@ -32,7 +32,6 @@ #include #include -#include #include #include diff --git a/tests/auto/qml/debugger/qqmlenginecontrol/qqmlenginecontrol.pro b/tests/auto/qml/debugger/qqmlenginecontrol/qqmlenginecontrol.pro index 73455bd903..36957628b2 100644 --- a/tests/auto/qml/debugger/qqmlenginecontrol/qqmlenginecontrol.pro +++ b/tests/auto/qml/debugger/qqmlenginecontrol/qqmlenginecontrol.pro @@ -8,7 +8,7 @@ include(../shared/debugutil.pri) TESTDATA = data/* -QT += core qml testlib gui-private core-private +QT += core testlib gui-private core-private OTHER_FILES += \ data/test.qml \ diff --git a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/qqmlenginedebuginspectorintegrationtest.pro b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/qqmlenginedebuginspectorintegrationtest.pro index 5f58e5ec7f..54244c6d16 100644 --- a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/qqmlenginedebuginspectorintegrationtest.pro +++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/qqmlenginedebuginspectorintegrationtest.pro @@ -1,7 +1,7 @@ CONFIG += testcase TARGET = tst_qqmlenginedebuginspectorintegration -QT += qml testlib gui-private core-private +QT += testlib gui-private core-private osx:CONFIG -= app_bundle SOURCES += tst_qqmlenginedebuginspectorintegration.cpp diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/qqmlenginedebugservice.pro b/tests/auto/qml/debugger/qqmlenginedebugservice/qqmlenginedebugservice.pro index 33ee023c06..ed4224446e 100644 --- a/tests/auto/qml/debugger/qqmlenginedebugservice/qqmlenginedebugservice.pro +++ b/tests/auto/qml/debugger/qqmlenginedebugservice/qqmlenginedebugservice.pro @@ -10,4 +10,4 @@ include(../shared/debugutil.pri) DEFINES += QT_QML_DEBUG_NO_WARNING -QT += core-private qml-private quick-private testlib gui-private +QT += quick qml-private testlib diff --git a/tests/auto/qml/debugger/qqmlinspector/qqmlinspector.pro b/tests/auto/qml/debugger/qqmlinspector/qqmlinspector.pro index fd07255ae5..3d4473c693 100644 --- a/tests/auto/qml/debugger/qqmlinspector/qqmlinspector.pro +++ b/tests/auto/qml/debugger/qqmlinspector/qqmlinspector.pro @@ -1,7 +1,7 @@ CONFIG += testcase TARGET = tst_qqmlinspector -QT += qml testlib gui-private core-private +QT += testlib gui-private core-private osx:CONFIG -= app_bundle SOURCES += tst_qqmlinspector.cpp diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro b/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro index 7c78b5fcb3..2a685ed877 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro +++ b/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro @@ -8,7 +8,7 @@ include(../shared/debugutil.pri) TESTDATA = data/* -QT += core qml testlib testlib-private gui-private core-private +QT += testlib gui-private OTHER_FILES += \ data/pixmapCacheTest.qml \ diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp index a6fbdf41e4..3cb315b355 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp +++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp @@ -34,7 +34,6 @@ #include #include -#include #include #include diff --git a/tests/auto/qml/debugger/shared/debugutil.cpp b/tests/auto/qml/debugger/shared/debugutil.cpp index 8ecbe53822..b118b22c64 100644 --- a/tests/auto/qml/debugger/shared/debugutil.cpp +++ b/tests/auto/qml/debugger/shared/debugutil.cpp @@ -31,8 +31,6 @@ #include -#include - #include #include @@ -52,15 +50,23 @@ bool QQmlDebugTest::waitForSignal(QObject *receiver, const char *member, int tim QList QQmlDebugTest::createOtherClients(QQmlDebugConnection *connection) { QList ret; - foreach (const QString &service, QQmlDebuggingEnabler::debuggerServices()) { + + static const auto debuggerServices + = QStringList({"V8Debugger", "QmlDebugger", "DebugMessages"}); + static const auto inspectorServices + = QStringList({"QmlInspector"}); + static const auto profilerServices + = QStringList({"CanvasFrameRate", "EngineControl", "DebugMessages"}); + + for (const QString &service : debuggerServices) { if (!connection->client(service)) ret << new QQmlDebugClient(service, connection); } - foreach (const QString &service, QQmlDebuggingEnabler::inspectorServices()) { + for (const QString &service : inspectorServices) { if (!connection->client(service)) ret << new QQmlDebugClient(service, connection); } - foreach (const QString &service, QQmlDebuggingEnabler::profilerServices()) { + for (const QString &service : profilerServices) { if (!connection->client(service)) ret << new QQmlDebugClient(service, connection); } diff --git a/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp b/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp index fac3ff15fd..97ca3fa1de 100644 --- a/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -332,6 +333,29 @@ void tst_qqmlmoduleplugin::remoteImportWithUnquotedUri() VERIFY_ERRORS(0); } +static QByteArray msgComponentError(const QQmlComponent &c, const QQmlEngine *engine /* = 0 */) +{ + QString result; + const QList errors = c.errors(); + QTextStream str(&result); + str << "Component '" << c.url().toString() << "' has " << errors.size() << " errors: '"; + for (int i = 0; i < errors.size(); ++i) { + if (i) + str << ", '"; + str << errors.at(i).toString() << '\''; + } + if (!engine) { + if (QQmlContext *context = c.creationContext()) + engine = context->engine(); + } + if (engine) { + str << " Import paths: (" << engine->importPathList().join(QStringLiteral(", ")) + << ") Plugin paths: (" << engine->pluginPathList().join(QStringLiteral(", ")) + << ')'; + } + return result.toLocal8Bit(); +} + // QTBUG-17324 void tst_qqmlmoduleplugin::importsMixedQmlCppPlugin() @@ -345,7 +369,7 @@ void tst_qqmlmoduleplugin::importsMixedQmlCppPlugin() QQmlComponent component(&engine, testFileUrl(QStringLiteral("importsMixedQmlCppPlugin.qml"))); QObject *o = component.create(); - QVERIFY2(o != nullptr, QQmlDataTest::msgComponentError(component, &engine)); + QVERIFY2(o != nullptr, msgComponentError(component, &engine)); QCOMPARE(o->property("test").toBool(), true); delete o; } @@ -354,7 +378,7 @@ void tst_qqmlmoduleplugin::importsMixedQmlCppPlugin() QQmlComponent component(&engine, testFileUrl(QStringLiteral("importsMixedQmlCppPlugin.2.qml"))); QObject *o = component.create(); - QVERIFY2(o != nullptr, QQmlDataTest::msgComponentError(component, &engine)); + QVERIFY2(o != nullptr, msgComponentError(component, &engine)); QCOMPARE(o->property("test").toBool(), true); QCOMPARE(o->property("test2").toBool(), true); delete o; diff --git a/tests/auto/shared/util.cpp b/tests/auto/shared/util.cpp index 96beb51612..189398f0c2 100644 --- a/tests/auto/shared/util.cpp +++ b/tests/auto/shared/util.cpp @@ -28,11 +28,6 @@ #include "util.h" -#include -#include -#include -#include -#include #include #include @@ -72,31 +67,6 @@ QString QQmlDataTest::testFile(const QString &fileName) const return result; } -QByteArray QQmlDataTest::msgComponentError(const QQmlComponent &c, - const QQmlEngine *engine /* = 0 */) -{ - QString result; - const QList errors = c.errors(); - QTextStream str(&result); - str << "Component '" << c.url().toString() << "' has " << errors.size() - << " errors: '"; - for (int i = 0; i < errors.size(); ++i) { - if (i) - str << ", '"; - str << errors.at(i).toString() << '\''; - - } - if (!engine) - if (QQmlContext *context = c.creationContext()) - engine = context->engine(); - if (engine) { - str << " Import paths: (" << engine->importPathList().join(QStringLiteral(", ")) - << ") Plugin paths: (" << engine->pluginPathList().join(QStringLiteral(", ")) - << ')'; - } - return result.toLocal8Bit(); -} - Q_GLOBAL_STATIC(QMutex, qQmlTestMessageHandlerMutex) QQmlTestMessageHandler *QQmlTestMessageHandler::m_instance = 0; diff --git a/tests/auto/shared/util.h b/tests/auto/shared/util.h index 33d7cbd1d0..6f3f0a06a8 100644 --- a/tests/auto/shared/util.h +++ b/tests/auto/shared/util.h @@ -35,9 +35,6 @@ #include #include -QT_FORWARD_DECLARE_CLASS(QQmlComponent) -QT_FORWARD_DECLARE_CLASS(QQmlEngine) - /* Base class for tests with data that are located in a "data" subfolder. */ class QQmlDataTest : public QObject @@ -61,9 +58,6 @@ public: static inline QQmlDataTest *instance() { return m_instance; } - static QByteArray msgComponentError(const QQmlComponent &, - const QQmlEngine *engine = 0); - public slots: virtual void initTestCase(); -- cgit v1.2.3 From 281c24d9169396a62f409de6dce3545f8d48ca8b Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Mon, 23 Apr 2018 13:13:31 +0200 Subject: Fix QQuickListViewPrivate::snapItemAt for lists with spacing If lists had spacing, snapping would have gaps where snapItemAt would return nullptr eventhough there were items above and below in the list. I.e. if we have a list with items of size 100, and a spacing of 100, and scroll to 110 (right below the first item), then the first item would fail because this is false: itemTop+itemSize()/2 >= pos (50 >= 110) And the next item (the one we should have snapped to), would fail because this is false: itemTop-prevItemSize/2 < pos (200-100/2 < 110) The meaning of first part was probably to see if the middle of the current item is inside the view. The meaning of the second part was probably to see if the middle of the previous item is outside the view. This patch refactors the code so it's more visible what's happening and fixes the bug by taking the spacing into account when computing the position of the halfway positions. Task-number: QTBUG-59852 Change-Id: I60eec0d16e91d2f22d70b97d11bcde5d88ac2997 Reviewed-by: Mitch Curtis --- .../qquicklistview/data/snapToItemWithSpacing.qml | 18 +++++++++++++++ .../quick/qquicklistview/tst_qquicklistview.cpp | 26 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 tests/auto/quick/qquicklistview/data/snapToItemWithSpacing.qml (limited to 'tests') diff --git a/tests/auto/quick/qquicklistview/data/snapToItemWithSpacing.qml b/tests/auto/quick/qquicklistview/data/snapToItemWithSpacing.qml new file mode 100644 index 0000000000..50b5abb206 --- /dev/null +++ b/tests/auto/quick/qquicklistview/data/snapToItemWithSpacing.qml @@ -0,0 +1,18 @@ +import QtQuick 2.0 + +ListView { + width: 100 + height: 300 + snapMode: ListView.SnapToItem + spacing: 100 + model: 10 + delegate: Rectangle { + height: 100 + width: 100 + color: "blue" + Text { + anchors.centerIn: parent + text: index + } + } +} diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp index 8bc5575e34..4d3a665255 100644 --- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp @@ -176,6 +176,7 @@ private slots: void creationContext(); void snapToItem_data(); void snapToItem(); + void snapToItemWithSpacing_QTBUG_59852(); void snapOneItemResize_QTBUG_43555(); void snapOneItem_data(); void snapOneItem(); @@ -5197,6 +5198,31 @@ void tst_QQuickListView::snapToItem() releaseView(window); } +void tst_QQuickListView::snapToItemWithSpacing_QTBUG_59852() +{ + QQuickView *window = getView(); + + window->setSource(testFileUrl("snapToItemWithSpacing.qml")); + window->show(); + QVERIFY(QTest::qWaitForWindowExposed(window)); + + auto *listView = qobject_cast(window->rootObject()); + QVERIFY(listView); + + QTRY_COMPARE(QQuickItemPrivate::get(listView)->polishScheduled, false); + + // each item in the list is 100 pixels tall, and the spacing is 100 + + listView->setContentY(110); // this is right below the first item + listView->returnToBounds(); + QCOMPARE(listView->contentY(), 200); // the position of the second item + + listView->setContentY(60); // this is right below the middle of the first item + listView->returnToBounds(); + QCOMPARE(listView->contentY(), 0); // it's farther to go to the next item, so snaps to the first + + releaseView(window); +} void tst_QQuickListView::snapOneItemResize_QTBUG_43555() { -- cgit v1.2.3 From f95c18b04e260a633d7a1d7cb0d3aaca01f9782f Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 20 Apr 2018 14:02:48 +0200 Subject: Make the test pass on my high resolution screen Change-Id: I08e952fb8c19c21caf33ffb1cfdc260b533a01d9 Reviewed-by: Shawn Rutledge --- .../multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp b/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp index 8d8c915e39..4b096f9c3a 100644 --- a/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp +++ b/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp @@ -211,7 +211,7 @@ void tst_MptaInterop::touchesThenPinch() pinchStoleGrab = i; } qCDebug(lcPointerTests) << "pinch started after" << pinchStoleGrab << "moves; ended with scale" << pinch->scale() << "rot" << pinch->rotation(); - QTRY_VERIFY(pinch->rotation() > 8); + QTRY_VERIFY(pinch->rotation() > 4); QVERIFY(pinch->scale() > 1); // Press one more point (pinkie finger) -- cgit v1.2.3 From f6bbeeb417102c61e8bf23f41e412ed9753a348d Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Tue, 24 Apr 2018 11:35:43 +0200 Subject: Normalize URL before loading types This prevents loading of types with slightly different paths multiple times, like "qrc:/One.qml" and "qrc:///One.qml". Task-number: QTBUG-65723 Change-Id: I6e26db6d1d271b2ed37b97eb990618843e99c372 Reviewed-by: Simon Hausmann --- tests/auto/qml/qqmlengine/data/qrcurls.js | 1 + tests/auto/qml/qqmlengine/data/qrcurls.qml | 4 ++++ tests/auto/qml/qqmlengine/qqmlengine.pro | 4 ++++ tests/auto/qml/qqmlengine/tst_qqmlengine.cpp | 27 +++++++++++++++++++++++++++ 4 files changed, 36 insertions(+) create mode 100644 tests/auto/qml/qqmlengine/data/qrcurls.js create mode 100644 tests/auto/qml/qqmlengine/data/qrcurls.qml (limited to 'tests') diff --git a/tests/auto/qml/qqmlengine/data/qrcurls.js b/tests/auto/qml/qqmlengine/data/qrcurls.js new file mode 100644 index 0000000000..15a4d5a70c --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/qrcurls.js @@ -0,0 +1 @@ +function someFunction() {} diff --git a/tests/auto/qml/qqmlengine/data/qrcurls.qml b/tests/auto/qml/qqmlengine/data/qrcurls.qml new file mode 100644 index 0000000000..e879577e10 --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/qrcurls.qml @@ -0,0 +1,4 @@ +import QtQml 2.0 + +QtObject { +} diff --git a/tests/auto/qml/qqmlengine/qqmlengine.pro b/tests/auto/qml/qqmlengine/qqmlengine.pro index 8d1e149d62..d2eb92bfd5 100644 --- a/tests/auto/qml/qqmlengine/qqmlengine.pro +++ b/tests/auto/qml/qqmlengine/qqmlengine.pro @@ -12,3 +12,7 @@ boot2qt: { # GC corruption test is too heavy for qemu-arm DEFINES += SKIP_GCCORRUPTION_TEST } + +RESOURCES += \ + data/qrcurls.qml \ + data/qrcurls.js diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp index 52e18011cb..6ae786469d 100644 --- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp +++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp @@ -77,6 +77,7 @@ private slots: void testGCCorruption(); void testGroupedPropertyRevisions(); void componentFromEval(); + void qrcUrls(); public slots: QObject *createAQObjectForOwnershipTest () @@ -897,6 +898,32 @@ void tst_qqmlengine::componentFromEval() QVERIFY(!item.isNull()); } +void tst_qqmlengine::qrcUrls() +{ + QQmlEngine engine; + QQmlEnginePrivate *pEngine = QQmlEnginePrivate::get(&engine); + + { + QQmlRefPointer oneQml(pEngine->typeLoader.getType(QUrl("qrc:/qrcurls.qml")), + QQmlRefPointer::Adopt); + QVERIFY(oneQml != nullptr); + QQmlRefPointer twoQml(pEngine->typeLoader.getType(QUrl("qrc:///qrcurls.qml")), + QQmlRefPointer::Adopt); + QVERIFY(twoQml != nullptr); + QCOMPARE(oneQml, twoQml); + } + + { + QQmlRefPointer oneJS(pEngine->typeLoader.getType(QUrl("qrc:/qrcurls.js")), + QQmlRefPointer::Adopt); + QVERIFY(oneJS != nullptr); + QQmlRefPointer twoJS(pEngine->typeLoader.getType(QUrl("qrc:///qrcurls.js")), + QQmlRefPointer::Adopt); + QVERIFY(twoJS != nullptr); + QCOMPARE(oneJS, twoJS); + } +} + QTEST_MAIN(tst_qqmlengine) #include "tst_qqmlengine.moc" -- cgit v1.2.3 From 3d80bbb6b47bc524f8243de26ff181026e8fc52d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 26 Apr 2018 15:05:14 +0200 Subject: Fix qmlInfo and friends for anonymous components When used on for example delegates we can and should also print the line number and column where the component is declared. Change-Id: I0f02c675425700cde119352d0001895cc31a4c73 Reviewed-by: Mitch Curtis Reviewed-by: Michael Brasser --- tests/auto/qml/qqmlinfo/data/Component.qml | 8 ++++++++ tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp | 14 ++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 tests/auto/qml/qqmlinfo/data/Component.qml (limited to 'tests') diff --git a/tests/auto/qml/qqmlinfo/data/Component.qml b/tests/auto/qml/qqmlinfo/data/Component.qml new file mode 100644 index 0000000000..fefbbfae76 --- /dev/null +++ b/tests/auto/qml/qqmlinfo/data/Component.qml @@ -0,0 +1,8 @@ +import QtQml 2.0 + +QtObject { + property Component delegate: Component { + QtObject { + } + } +} diff --git a/tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp b/tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp index ada3f9e37b..5ff72de0a0 100644 --- a/tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp +++ b/tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp @@ -50,6 +50,7 @@ private slots: void types(); void chaining(); void messageTypes(); + void component(); private: QQmlEngine engine; @@ -216,6 +217,19 @@ void tst_qqmlinfo::messageTypes() qmlWarning(nullptr) << QLatin1String("warning"); } +void tst_qqmlinfo::component() +{ + QQmlComponent component(&engine, testFileUrl("Component.qml")); + QScopedPointer object(component.create()); + QVERIFY(object != nullptr); + QQmlComponent *delegate = qobject_cast(object->property("delegate").value()); + QVERIFY(delegate); + + QString message = component.url().toString() + ":4:34: QML Component: Delegate error"; + QTest::ignoreMessage(QtInfoMsg, qPrintable(message)); + qmlInfo(delegate) << "Delegate error"; +} + QTEST_MAIN(tst_qqmlinfo) #include "tst_qqmlinfo.moc" -- cgit v1.2.3 From 8f031fe77673a023c0a9d6ed38eca2d06267f259 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Thu, 26 Apr 2018 14:08:52 +0200 Subject: test: fix flaky in tst_QQuickPathView::movementDirection() Due to heavy load in ci test vm, the animation perhaps didn't start after QTest::qWait(100). Task-number: QTBUG-67939 Change-Id: I8c786c82ea41c3d3514ab6bddaefb0c584f35fe0 Reviewed-by: Mitch Curtis --- tests/auto/quick/qquickpathview/tst_qquickpathview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp index 5f7f35b5d7..4211d08393 100644 --- a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp +++ b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp @@ -2462,9 +2462,11 @@ static void verify_offsets(QQuickPathView *pathview, int toidx, qreal fromoffset QTest::qWait(100); first = pathview->offset(); while (1) { + if (first == 0) + first = pathview->offset(); QTest::qWait(10); // highlightMoveDuration: 1000 second = pathview->offset(); - if (!started && second != first) { // animation started + if (!started && first != 0 && second != first) { // animation started started = true; break; } -- cgit v1.2.3 From 8e98b175fa9fc896b0372ec814ee6600116a027b Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 27 Apr 2018 16:13:02 +0200 Subject: Tests: Silence Clang warnings ./stringmodel.h(63,9): warning: 'rowCount' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] int rowCount(const QModelIndex &) const ^ ./stringmodel.h(73,17): warning: 'columnCount' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] virtual int columnCount(const QModelIndex &) const ^ ./stringmodel.h(83,25): warning: 'index' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] virtual QModelIndex index(int row, int column, const QModelIndex &parent) const ./stringmodel.h(92,25): warning: 'parent' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] virtual QModelIndex parent(const QModelIndex &) const ^ ./stringmodel.h(97,14): warning: 'data' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] QVariant data (const QModelIndex & index, int role) const ^ tst_qquicklistview.cpp(8695,18): warning: unused variable 'ctxt' [-Wunused-variable] QQmlContext *ctxt = window->rootContext(); Task-number: QTBUG-63512 Change-Id: Ie928981a601d0462cfadd093815d110f6971d7f5 Reviewed-by: Simon Hausmann --- tests/auto/qml/qqmlinstantiator/stringmodel.h | 10 +++++----- tests/auto/quick/qquicklistview/tst_qquicklistview.cpp | 2 -- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/auto/qml/qqmlinstantiator/stringmodel.h b/tests/auto/qml/qqmlinstantiator/stringmodel.h index b01817375a..6ae3cbb6ee 100644 --- a/tests/auto/qml/qqmlinstantiator/stringmodel.h +++ b/tests/auto/qml/qqmlinstantiator/stringmodel.h @@ -60,7 +60,7 @@ public: endInsertRows(); } - int rowCount(const QModelIndex &) const + int rowCount(const QModelIndex &) const override { return items.count(); } @@ -70,7 +70,7 @@ public: return roles; } - virtual int columnCount(const QModelIndex &) const + int columnCount(const QModelIndex &) const override { return 1; } @@ -80,7 +80,7 @@ public: return rowCount(QModelIndex()) > 0; } - virtual QModelIndex index(int row, int column, const QModelIndex &parent) const + QModelIndex index(int row, int column, const QModelIndex &parent) const override { Q_UNUSED(column); if (row>=0 && row=items.count())) diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp index 4d3a665255..c1daddb561 100644 --- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp @@ -8692,8 +8692,6 @@ void tst_QQuickListView::QTBUG_34576_velocityZero() QQuickView *window = new QQuickView(nullptr); window->setGeometry(0,0,240,320); - QQmlContext *ctxt = window->rootContext(); - QString filename(testFile("qtbug34576.qml")); window->setSource(QUrl::fromLocalFile(filename)); window->show(); -- cgit v1.2.3 From f9686bc68696ad1e99a0587f15d05300d003d990 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Mon, 9 Apr 2018 15:41:02 +0200 Subject: QQuickItem: Guard against null deref in transformations Change-Id: Ieb14322c104d816842e04e521b556bfc11855f1c Task-number: QTBUG-67024 Reviewed-by: Robin Burchell Reviewed-by: Michael Brasser --- tests/auto/quick/qquickitem2/data/mapCoordinates.qml | 17 +++++++++++++++++ tests/auto/quick/qquickitem2/tst_qquickitem.cpp | 10 ++++++++++ 2 files changed, 27 insertions(+) (limited to 'tests') diff --git a/tests/auto/quick/qquickitem2/data/mapCoordinates.qml b/tests/auto/quick/qquickitem2/data/mapCoordinates.qml index b410b445c5..596dedab90 100644 --- a/tests/auto/quick/qquickitem2/data/mapCoordinates.qml +++ b/tests/auto/quick/qquickitem2/data/mapCoordinates.qml @@ -39,6 +39,11 @@ Item { Item { id: itemB; objectName: "itemB"; x: 100; y: 100 } } + Component { + id: itemComponent + Item { x: 150; y: 150 } + } + function mapAToB(x, y) { var pos = itemA.mapToItem(itemB, x, y) return Qt.point(pos.x, pos.y) @@ -69,6 +74,18 @@ Item { return Qt.point(pos.x, pos.y) } + function mapOrphanToGlobal(x, y) { + var obj = itemComponent.createObject(null); + var pos = obj.mapToGlobal(x, y) + return Qt.point(pos.x, pos.y) + } + + function mapOrphanFromGlobal(x, y) { + var obj = itemComponent.createObject(null); + var pos = obj.mapFromGlobal(x, y) + return Qt.point(pos.x, pos.y) + } + function checkMapAToInvalid(x, y) { try { itemA.mapToItem(1122, x, y) diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp index 0f4850d4a7..f0f5873ace 100644 --- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp +++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp @@ -2364,6 +2364,16 @@ void tst_QQuickItem::mapCoordinates() Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y))); QCOMPARE(result.value(), qobject_cast(a)->mapFromGlobal(QPointF(x, y))); + // for orphans we are primarily testing that we don't crash. + // when orphaned the final position is the original position of the item translated by x,y + QVERIFY(QMetaObject::invokeMethod(root, "mapOrphanToGlobal", + Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y))); + QCOMPARE(result.value(), QPointF(150,150) + QPointF(x, y)); + + QVERIFY(QMetaObject::invokeMethod(root, "mapOrphanFromGlobal", + Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y))); + QCOMPARE(result.value(), -QPointF(150,150) + QPointF(x, y)); + QString warning1 = testFileUrl("mapCoordinates.qml").toString() + ":35:5: QML Item: mapToItem() given argument \"1122\" which is neither null nor an Item"; QString warning2 = testFileUrl("mapCoordinates.qml").toString() + ":35:5: QML Item: mapFromItem() given argument \"1122\" which is neither null nor an Item"; -- cgit v1.2.3 From 4115adb95f2670b96b036215abe98e0f40c58b95 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Mon, 7 May 2018 09:47:59 +0200 Subject: tests: blacklist tst_qquickitem::qtBug60123 Its unreliable and we don't know why yet. Task-number: QTBUG-66866 Change-Id: I963a0070e5819b20d0e811f749cf623113eb9d26 Reviewed-by: Mitch Curtis --- tests/auto/quick/qquickitem/BLACKLIST | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/auto/quick/qquickitem/BLACKLIST b/tests/auto/quick/qquickitem/BLACKLIST index d94a3ef102..85c4df4feb 100644 --- a/tests/auto/quick/qquickitem/BLACKLIST +++ b/tests/auto/quick/qquickitem/BLACKLIST @@ -1,2 +1,5 @@ [contains:hollow square: testing points inside] xcb + +[qtBug60123] +offscreen -- cgit v1.2.3 From bdbf6a53c0ab8a7f6ea5586767a6ed818e3d555e Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 4 May 2018 15:17:29 +0200 Subject: Fix loading of composite singletons from resources Commit f6bbeeb417102c61e8bf23f41e412ed9753a348d began normalizing the resource urls in the type loader, which broke loading of qml singletons from resources, as the normalized url is also used for the "pragma singleton" verification to check that the singleton is in the meta-type registry. If the registration was done with a non-normalized url, the check would fail with a misleading error message. Task-number: QTBUG-68025 Change-Id: I1093ee0cbee884b4a51195c302c8908f748e747e Reviewed-by: Lars Knoll Reviewed-by: Christopher Adams --- tests/auto/qml/qqmlmetatype/qqmlmetatype.pro | 4 ++++ tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp | 14 ++++++++++++++ 2 files changed, 18 insertions(+) (limited to 'tests') diff --git a/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro b/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro index 0d8de91931..345bc59615 100644 --- a/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro +++ b/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro @@ -6,4 +6,8 @@ macx:CONFIG -= app_bundle TESTDATA = data/* include (../../shared/util.pri) +qmlfiles.files = data/CompositeType.qml +qmlfiles.prefix = /tstqqmlmetatype +RESOURCES += qmlfiles + QT += core-private gui-private qml-private testlib diff --git a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp index ff3361ff82..1d0d353668 100644 --- a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp +++ b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp @@ -62,6 +62,8 @@ private slots: void defaultObject(); void unregisterCustomType(); void unregisterCustomSingletonType(); + + void normalizeUrls(); }; class TestType : public QObject @@ -523,6 +525,18 @@ void tst_qqmlmetatype::unregisterCustomSingletonType() } } +void tst_qqmlmetatype::normalizeUrls() +{ + const QUrl url("qrc:///tstqqmlmetatype/data/CompositeType.qml"); + QVERIFY(!QQmlMetaType::qmlType(url).isValid()); + const auto registrationId = qmlRegisterType(url, "Test", 1, 0, "ResourceCompositeType"); + QVERIFY(QQmlMetaType::qmlType(url, /*includeNonFileImports=*/true).isValid()); + QUrl normalizedURL("qrc:/tstqqmlmetatype/data/CompositeType.qml"); + QVERIFY(QQmlMetaType::qmlType(normalizedURL, /*includeNonFileImports=*/true).isValid()); + qmlUnregisterType(registrationId); + QVERIFY(!QQmlMetaType::qmlType(url, /*includeNonFileImports=*/true).isValid()); +} + QTEST_MAIN(tst_qqmlmetatype) #include "tst_qqmlmetatype.moc" -- cgit v1.2.3 From a609554c031fd57d9a2a3905f5a02cc6b4aa19e9 Mon Sep 17 00:00:00 2001 From: Louis du Verdier Date: Mon, 2 Apr 2018 20:25:37 +0200 Subject: Fix crash when changing the source of AnimatedImage after a frame change QMovie emits the signals updated() and frameChanged(), and restarts right after its timer to prepare for the next frame. Since AnimatedImage destroys its underlying QMovie when its source changes, the lines after emit frameChanged() in QMovie will use free'd memory and will most of the time produce a crash. This fix delays the destruction of the underlying QMovie of AnimatedImage using deleteLater() to prevent this kind of behavior from happening without impact/behavior change in the code of QMovie. Unit tests added as well to cover this situation. This commit also fixes a similar crash when Component.onCompleted is called and when the source changes in the associated callback. Task-number: QTBUG-67427 Change-Id: Ic6568a1bc251e5fa2ee1cf8e5f50eaa56c3007db Reviewed-by: VaL Doroshchuk Reviewed-by: Shawn Rutledge Reviewed-by: Louis du Verdier --- .../tst_qquickanimatedimage.cpp | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tests') diff --git a/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp b/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp index 3e5a054cc7..8026bafb9e 100644 --- a/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp +++ b/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp @@ -67,6 +67,7 @@ private slots: void progressAndStatusChanges(); void playingAndPausedChanges(); void noCaching(); + void sourceChangesOnFrameChanged(); }; void tst_qquickanimatedimage::cleanup() @@ -590,6 +591,33 @@ void tst_qquickanimatedimage::noCaching() } } +void tst_qquickanimatedimage::sourceChangesOnFrameChanged() +{ + QQmlEngine engine; + QQmlComponent component(&engine, testFileUrl("colors.qml")); + QVector images; + + // Run multiple animations in parallel, this should be fast + for (int loops = 0; loops < 25; ++loops) { + QQuickAnimatedImage *anim = qobject_cast(component.create()); + + // QTBUG-67427: this should not produce a segfault + QObject::connect(anim, + &QQuickAnimatedImage::frameChanged, + [this, anim]() { anim->setSource(testFileUrl("hearts.gif")); }); + + QVERIFY(anim); + QVERIFY(anim->isPlaying()); + + images.append(anim); + } + + for (auto *anim : images) + QTRY_COMPARE(anim->source(), testFileUrl("hearts.gif")); + + qDeleteAll(images); +} + QTEST_MAIN(tst_qquickanimatedimage) #include "tst_qquickanimatedimage.moc" -- cgit v1.2.3 From 6a02e8801c71d8008c5b4db922a736c358fee00e Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Wed, 18 Apr 2018 14:34:12 +0200 Subject: tests: unblacklist tst_qquickwindow.cpp::touchEvent_propagation For details see QTBUG-67757. Task-number: QTBUG-53916 Change-Id: I142a418fc22e6cdf64ab571ea2759e00c8101c47 Reviewed-by: Kari Oikarinen --- tests/auto/quick/qquickwindow/BLACKLIST | 3 --- 1 file changed, 3 deletions(-) (limited to 'tests') diff --git a/tests/auto/quick/qquickwindow/BLACKLIST b/tests/auto/quick/qquickwindow/BLACKLIST index 6c2671ad9e..bb9f403188 100644 --- a/tests/auto/quick/qquickwindow/BLACKLIST +++ b/tests/auto/quick/qquickwindow/BLACKLIST @@ -1,6 +1,3 @@ # QTBUG-62177 [attachedProperty] osx -# QTBUG-53916 -[touchEvent_propagation:hide item] -ubuntu -- cgit v1.2.3 From 0a2aaee61cfc2888bc71f54ac5b165d248cbf5e8 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 11 May 2018 15:39:04 +0200 Subject: Fix .import within .js files with CONFIG+=qtquickcompiler When loading a .js file without QQC, we scan the sources and use the ScriptDirectivesCollector to extract things like .pragma library or .import ahead of time. That information is passed on to the compilation unit generator for serialization. When compiling .js files ahead of time, we also used the same collector, but we forgot to save the data into the right location before serialization, so we essentially lost the imports. This patch fixes that by centralizing this code into the ScriptDirectivesCollector itself. [ChangeLog][QtQml] Fix regression with .import in .js files not working when using CONFIG+=qtquickcompiler. Change-Id: I5413c14b1b8bd3114a997011534fe55cdb7634aa Reviewed-by: Lars Knoll --- tests/auto/qml/qmlcachegen/jsimport.qml | 6 ++++++ tests/auto/qml/qmlcachegen/library.js | 4 ++++ tests/auto/qml/qmlcachegen/qmlcachegen.pro | 2 ++ tests/auto/qml/qmlcachegen/script.js | 6 ++++++ tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp | 11 +++++++++++ 5 files changed, 29 insertions(+) create mode 100644 tests/auto/qml/qmlcachegen/jsimport.qml create mode 100644 tests/auto/qml/qmlcachegen/library.js create mode 100644 tests/auto/qml/qmlcachegen/script.js (limited to 'tests') diff --git a/tests/auto/qml/qmlcachegen/jsimport.qml b/tests/auto/qml/qmlcachegen/jsimport.qml new file mode 100644 index 0000000000..9c40878e60 --- /dev/null +++ b/tests/auto/qml/qmlcachegen/jsimport.qml @@ -0,0 +1,6 @@ +import QtQml 2.0 +import "script.js" as Script + +QtObject { + property int value: Script.getter() +} diff --git a/tests/auto/qml/qmlcachegen/library.js b/tests/auto/qml/qmlcachegen/library.js new file mode 100644 index 0000000000..51fb41dc23 --- /dev/null +++ b/tests/auto/qml/qmlcachegen/library.js @@ -0,0 +1,4 @@ + +function getter() { + return 42; +} diff --git a/tests/auto/qml/qmlcachegen/qmlcachegen.pro b/tests/auto/qml/qmlcachegen/qmlcachegen.pro index a2f963e8c3..f62b950844 100644 --- a/tests/auto/qml/qmlcachegen/qmlcachegen.pro +++ b/tests/auto/qml/qmlcachegen/qmlcachegen.pro @@ -12,4 +12,6 @@ RESOURCES += versionchecks.qml RESOURCES += trickypaths.qrc +RESOURCES += jsimport.qml script.js library.js + QT += core-private qml-private testlib diff --git a/tests/auto/qml/qmlcachegen/script.js b/tests/auto/qml/qmlcachegen/script.js new file mode 100644 index 0000000000..fa55f9069e --- /dev/null +++ b/tests/auto/qml/qmlcachegen/script.js @@ -0,0 +1,6 @@ + +.import "library.js" as Library + +function getter() { + return Library.getter() +} diff --git a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp index 5c1692f086..c95a5a5d25 100644 --- a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp +++ b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp @@ -54,6 +54,8 @@ private slots: void workerScripts(); void trickyPaths(); + + void scriptImport(); }; // A wrapper around QQmlComponent to ensure the temporary reference counts @@ -416,6 +418,15 @@ void tst_qmlcachegen::trickyPaths() QCOMPARE(obj->property("success").toInt(), 42); } +void tst_qmlcachegen::scriptImport() +{ + QQmlEngine engine; + CleanlyLoadingComponent component(&engine, QUrl("qrc:///jsimport.qml")); + QScopedPointer obj(component.create()); + QVERIFY(!obj.isNull()); + QTRY_COMPARE(obj->property("value").toInt(), 42); +} + QTEST_GUILESS_MAIN(tst_qmlcachegen) #include "tst_qmlcachegen.moc" -- cgit v1.2.3 From 1f3713a2b40a467e8a8c552d0980dbdd9f7a1ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Arve=20S=C3=A6ther?= Date: Fri, 11 May 2018 13:36:52 +0200 Subject: Fix bug where Ungrab event was not sent clearGrabbers() will also clear QQuickWindow::mouseGrabberItem(), so we have to retrieve a copy of the mouse grabber item in advance of calling clearGrabbers(). This could happen when a filtering parent actually called grabMouse() on mouse release(!) event. Change-Id: I287214dbdff802707be625d73c38dd9c5d723aef Task-number: QTBUG-68030 Reviewed-by: Shawn Rutledge --- tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'tests') diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp index cd3486f95f..042908bf0c 100644 --- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp +++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp @@ -179,6 +179,7 @@ public: bool acceptTouchEvents; bool acceptMouseEvents; + bool grabOnRelease = false; TouchEventData lastEvent; int mousePressCount; int mouseMoveCount; @@ -248,6 +249,10 @@ public: case QEvent::MouseButtonPress: mousePressCount = ++mousePressNum; break; + case QEvent::MouseButtonRelease: + if (grabOnRelease) + grabMouse(); + break; case QEvent::MouseMove: mouseMoveCount = ++mouseMoveNum; break; @@ -468,6 +473,7 @@ private slots: void testChildMouseEventFilter(); void testChildMouseEventFilter_data(); + void cleanupGrabsOnRelease(); private: QTouchDevice *touchDevice; @@ -3514,6 +3520,41 @@ void tst_qquickwindow::testChildMouseEventFilter() QTest::mouseRelease(&window, Qt::LeftButton, Qt::NoModifier, mousePos); } +void tst_qquickwindow::cleanupGrabsOnRelease() +{ + TestTouchItem::clearMouseEventCounters(); + + QQuickWindow *window = new QQuickWindow; + QScopedPointer cleanup(window); + window->resize(250, 250); + window->setPosition(100, 100); + window->setTitle(QTest::currentTestFunction()); + window->show(); + QVERIFY(QTest::qWaitForWindowActive(window)); + + TestTouchItem *parent = new TestTouchItem(window->contentItem()); + parent->setObjectName("parent"); + parent->setSize(QSizeF(150, 150)); + parent->acceptMouseEvents = true; + parent->grabOnRelease = true; + + TestTouchItem *child = new TestTouchItem(parent); + child->setObjectName("child"); + child->setSize(QSizeF(100, 100)); + child->acceptMouseEvents = true; + + QPoint pos(80, 80); + + QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, pos); + QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, pos); + // There is an explicit parent->grabMouse on release(!). This means grab changes from child + // to parent: + // This will emit two ungrab events: + // 1. One for the child (due to the explicit call to parent->grabMouse()) + // 2. One for the parent (since the mouse button was finally released) + QCOMPARE(child->mouseUngrabEventCount, 1); + QCOMPARE(parent->mouseUngrabEventCount, 1); +} QTEST_MAIN(tst_qquickwindow) -- cgit v1.2.3 From 7d1af10821e7356fb7e33f412e028da99e0e306c Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 16 May 2018 09:07:20 +0200 Subject: tst_qquickanimatedsprite: add all QML files to OTHER_FILES Makes it easier to open them via the locator, for example. Change-Id: I8a5a0beba315da25b14bf2d519974e175f39567f Reviewed-by: Andy Nichols --- tests/auto/quick/qquickanimatedsprite/qquickanimatedsprite.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/quick/qquickanimatedsprite/qquickanimatedsprite.pro b/tests/auto/quick/qquickanimatedsprite/qquickanimatedsprite.pro index 81c73be831..85f71bb605 100644 --- a/tests/auto/quick/qquickanimatedsprite/qquickanimatedsprite.pro +++ b/tests/auto/quick/qquickanimatedsprite/qquickanimatedsprite.pro @@ -11,4 +11,4 @@ TESTDATA = data/* QT += core-private gui-private qml-private quick-private network testlib OTHER_FILES += \ - data/largeAnimation.qml + $$files(data/*.qml) -- cgit v1.2.3 From 1aecb24682075cbb99f21a367c399387b12257d0 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 22 May 2018 14:07:14 -0500 Subject: Ensure we restore QML-defined enums This code path was previously missed, leading to some AOT-compiled types generating errors of the form: Unable to assign [undefined] to int [ChangeLog][QtQml] Fix QML declared enums with CONFIG+=qtquickcompiler. Change-Id: Ib46a2b2505aa3863f091a6ccdebf8425e62fc38f Reviewed-by: Simon Hausmann --- tests/auto/qml/qmlcachegen/Enums.qml | 9 +++++++++ tests/auto/qml/qmlcachegen/qmlcachegen.pro | 2 ++ tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp | 11 +++++++++++ 3 files changed, 22 insertions(+) create mode 100644 tests/auto/qml/qmlcachegen/Enums.qml (limited to 'tests') diff --git a/tests/auto/qml/qmlcachegen/Enums.qml b/tests/auto/qml/qmlcachegen/Enums.qml new file mode 100644 index 0000000000..830babb73e --- /dev/null +++ b/tests/auto/qml/qmlcachegen/Enums.qml @@ -0,0 +1,9 @@ +import QtQml 2.0 +QtObject { + enum Test { + First = 100, + Second = 200 + } + property int value: 0 + Component.onCompleted: value = Enums.Second +} diff --git a/tests/auto/qml/qmlcachegen/qmlcachegen.pro b/tests/auto/qml/qmlcachegen/qmlcachegen.pro index f62b950844..40de4548a7 100644 --- a/tests/auto/qml/qmlcachegen/qmlcachegen.pro +++ b/tests/auto/qml/qmlcachegen/qmlcachegen.pro @@ -14,4 +14,6 @@ RESOURCES += trickypaths.qrc RESOURCES += jsimport.qml script.js library.js +RESOURCES += Enums.qml + QT += core-private qml-private testlib diff --git a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp index c95a5a5d25..3b7d268f7b 100644 --- a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp +++ b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp @@ -56,6 +56,8 @@ private slots: void trickyPaths(); void scriptImport(); + + void enums(); }; // A wrapper around QQmlComponent to ensure the temporary reference counts @@ -427,6 +429,15 @@ void tst_qmlcachegen::scriptImport() QTRY_COMPARE(obj->property("value").toInt(), 42); } +void tst_qmlcachegen::enums() +{ + QQmlEngine engine; + CleanlyLoadingComponent component(&engine, QUrl("qrc:///Enums.qml")); + QScopedPointer obj(component.create()); + QVERIFY(!obj.isNull()); + QTRY_COMPARE(obj->property("value").toInt(), 200); +} + QTEST_GUILESS_MAIN(tst_qmlcachegen) #include "tst_qmlcachegen.moc" -- cgit v1.2.3 From eaec83583fff3e3bf431f6179936b84f4acca553 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 23 May 2018 10:26:15 +0200 Subject: Fix crash when modifying objects used as prototypes Changing the prototype of an object back and forth leads to a 'cyclic' reference in the internal class transition tables. If one of those objects then gets a new property, we would get an infinite stack recursion trying to update the internal class IDs of the classes using this prototype. Fixed by skipping protochanges and vtable changes in the update code. That's ok, as those classes will always be reached through other paths from the empty class. Task-number: QTBUG-68369 Change-Id: Ie54ca5171a92f8e8b146a91376e435478ff70185 Reviewed-by: Simon Hausmann --- tests/auto/qml/qjsengine/tst_qjsengine.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests') diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp index f862cdb048..c3a3926144 100644 --- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp +++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp @@ -205,6 +205,8 @@ private slots: void scriptScopes(); + void protoChanges_QTBUG68369(); + signals: void testSignal(); }; @@ -4157,6 +4159,22 @@ void tst_QJSEngine::scriptScopes() QCOMPARE(use.toInt(), 42); } +void tst_QJSEngine::protoChanges_QTBUG68369() +{ + QJSEngine engine; + QJSValue ok = engine.evaluate( + "var o = { x: true };" + "var p1 = {};" + "var p2 = {};" + "o.__proto__ = p1;" + "o.__proto__ = p2;" + "o.__proto__ = p1;" + "p1.y = true;" + "o.y" + ); + QVERIFY(ok.toBool() == true); +} + QTEST_MAIN(tst_QJSEngine) #include "tst_qjsengine.moc" -- cgit v1.2.3 From 60176efa7843fda048b2eb5d347fab0dd991e26d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 23 May 2018 12:55:11 +0200 Subject: Fix crash when incubating objects with non-existent initial properties When incubation is triggered from C++ and reaches the state of setting the initial properties (as supplied to incubateObject), we'd set engine->currentStackFrame to a CppStackFrame that provides access to the correct QML context. As we're not called from the interpreter, the v4Function pointer would be a null pointer. If during the initial property setting an exception is thrown (due to non-existent property access) and a back-trace is created, we'd end up dereferencing v4Function. Change-Id: I7f6b0ba7893bfb4186f55d4c213b4bb602d29aa0 Task-number: QTBUG-68416 Reviewed-by: Lars Knoll --- .../qml/qqmlcomponent/data/InitialPropertyTest.qml | 4 ++++ .../qqmlcomponent/data/nonExistentInitialProperty.qml | 9 +++++++++ tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp | 18 ++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 tests/auto/qml/qqmlcomponent/data/InitialPropertyTest.qml create mode 100644 tests/auto/qml/qqmlcomponent/data/nonExistentInitialProperty.qml (limited to 'tests') diff --git a/tests/auto/qml/qqmlcomponent/data/InitialPropertyTest.qml b/tests/auto/qml/qqmlcomponent/data/InitialPropertyTest.qml new file mode 100644 index 0000000000..7de276f2d8 --- /dev/null +++ b/tests/auto/qml/qqmlcomponent/data/InitialPropertyTest.qml @@ -0,0 +1,4 @@ +import QtQml 2.0 +QtObject { + property bool ok: false +} diff --git a/tests/auto/qml/qqmlcomponent/data/nonExistentInitialProperty.qml b/tests/auto/qml/qqmlcomponent/data/nonExistentInitialProperty.qml new file mode 100644 index 0000000000..ef89e46088 --- /dev/null +++ b/tests/auto/qml/qqmlcomponent/data/nonExistentInitialProperty.qml @@ -0,0 +1,9 @@ +import QtQml 2.0 +QtObject { + property Component factory: Qt.createComponent(Qt.resolvedUrl("InitialPropertyTest.qml"), Component.PreferSynchronous) + property var incubator + function startIncubation() + { + incubator = factory.incubateObject(null, { ok: true, nonExistent: 42 }, Qt.Asynchronous) + } +} diff --git a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp index 6a0dc28ca4..3a70890362 100644 --- a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp +++ b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp @@ -117,6 +117,7 @@ private slots: void recursion(); void recursionContinuation(); void callingContextForInitialProperties(); + void setNonExistentInitialProperty(); void relativeUrl_data(); void relativeUrl(); @@ -583,6 +584,23 @@ void tst_qqmlcomponent::callingContextForInitialProperties() QVERIFY(checker->scopeObject->metaObject()->indexOfProperty("incubatedObject") != -1); } +void tst_qqmlcomponent::setNonExistentInitialProperty() +{ + QQmlIncubationController controller; + QQmlEngine engine; + engine.setIncubationController(&controller); + QQmlComponent component(&engine, testFileUrl("nonExistentInitialProperty.qml")); + QScopedPointer obj(component.create()); + QVERIFY(!obj.isNull()); + QMetaObject::invokeMethod(obj.data(), "startIncubation"); + QJSValue incubatorStatus = obj->property("incubator").value(); + incubatorStatus.property("forceCompletion").callWithInstance(incubatorStatus); + QJSValue objectWrapper = incubatorStatus.property("object"); + QVERIFY(objectWrapper.isQObject()); + QPointer object(objectWrapper.toQObject()); + QVERIFY(object->property("ok").toBool()); +} + void tst_qqmlcomponent::relativeUrl_data() { QTest::addColumn("url"); -- cgit v1.2.3 From cda2680d801acce4e221b23e88d9b3c5504f86e8 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 23 May 2018 12:28:46 +0200 Subject: On network redirects, update finalUrl, not url We want all further imports to be relative to the redirected URL, not the base one. Note that this will incorporate any prior URL interceptions into the final URL if a redirect happens. We don't really want this to happen because the result of interception is not meant to be the base for further URL lookup. However, as interception occurs before redirection, this is unavoidable. Don't use URL interceptors on remote URLs. Task-number: QTBUG-67882 Change-Id: I2717bdd4de119ac67caa08fdccc041432025abff Reviewed-by: Simon Hausmann --- tests/auto/qml/qqmltypeloader/data/Base.qml | 3 +++ tests/auto/qml/qqmltypeloader/data/Load.qml | 11 +++++++++++ .../qml/qqmltypeloader/data/redirected/Imported.qml | 5 +++++ .../qml/qqmltypeloader/data/redirected/Redirected.qml | 5 +++++ tests/auto/qml/qqmltypeloader/data/redirected/qmldir | 1 + tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp | 18 ++++++++++++++++++ tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.pro | 7 ++++++- 7 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 tests/auto/qml/qqmltypeloader/data/Base.qml create mode 100644 tests/auto/qml/qqmltypeloader/data/Load.qml create mode 100644 tests/auto/qml/qqmltypeloader/data/redirected/Imported.qml create mode 100644 tests/auto/qml/qqmltypeloader/data/redirected/Redirected.qml create mode 100644 tests/auto/qml/qqmltypeloader/data/redirected/qmldir (limited to 'tests') diff --git a/tests/auto/qml/qqmltypeloader/data/Base.qml b/tests/auto/qml/qqmltypeloader/data/Base.qml new file mode 100644 index 0000000000..431c659424 --- /dev/null +++ b/tests/auto/qml/qqmltypeloader/data/Base.qml @@ -0,0 +1,3 @@ +import QtQml 2.0 + +QtObject {} diff --git a/tests/auto/qml/qqmltypeloader/data/Load.qml b/tests/auto/qml/qqmltypeloader/data/Load.qml new file mode 100644 index 0000000000..0b893bb5cd --- /dev/null +++ b/tests/auto/qml/qqmltypeloader/data/Load.qml @@ -0,0 +1,11 @@ +import QtQuick 2.0 + +Item { + property int xy: loader.xy + Loader { + id: loader + asynchronous: true + source: 'Base.qml' + property int xy: item.xy + } +} diff --git a/tests/auto/qml/qqmltypeloader/data/redirected/Imported.qml b/tests/auto/qml/qqmltypeloader/data/redirected/Imported.qml new file mode 100644 index 0000000000..62954fe1b2 --- /dev/null +++ b/tests/auto/qml/qqmltypeloader/data/redirected/Imported.qml @@ -0,0 +1,5 @@ +import QtQml 2.0 + +QtObject { + property int xy: 323232 +} diff --git a/tests/auto/qml/qqmltypeloader/data/redirected/Redirected.qml b/tests/auto/qml/qqmltypeloader/data/redirected/Redirected.qml new file mode 100644 index 0000000000..40fec5ed31 --- /dev/null +++ b/tests/auto/qml/qqmltypeloader/data/redirected/Redirected.qml @@ -0,0 +1,5 @@ +import QtQml 2.0 + +Imported { + +} diff --git a/tests/auto/qml/qqmltypeloader/data/redirected/qmldir b/tests/auto/qml/qqmltypeloader/data/redirected/qmldir new file mode 100644 index 0000000000..8eb1fa5c18 --- /dev/null +++ b/tests/auto/qml/qqmltypeloader/data/redirected/qmldir @@ -0,0 +1 @@ +Imported 1.0 Imported.qml diff --git a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp index c10a8a08c1..d336d033a3 100644 --- a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp +++ b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp @@ -33,6 +33,7 @@ #include #include #include +#include "../../shared/testhttpserver.h" #include "../../shared/util.h" class tst_QQMLTypeLoader : public QQmlDataTest @@ -48,6 +49,7 @@ private slots: void keepSingleton(); void keepRegistrations(); void intercept(); + void redirect(); }; void tst_QQMLTypeLoader::testLoadComplete() @@ -410,6 +412,22 @@ void tst_QQMLTypeLoader::intercept() QVERIFY(factory.loadedFiles.contains(QLatin1String(QT_TESTCASE_BUILDDIR) + "/Slow/qmldir")); } +void tst_QQMLTypeLoader::redirect() +{ + TestHTTPServer server; + QVERIFY2(server.listen(), qPrintable(server.errorString())); + QVERIFY(server.serveDirectory(dataDirectory())); + server.addRedirect("Base.qml", server.urlString("/redirected/Redirected.qml")); + + QQmlEngine engine; + QQmlComponent component(&engine); + component.loadUrl(server.urlString("/Load.qml"), QQmlComponent::Asynchronous); + QTRY_VERIFY2(component.isReady(), qPrintable(component.errorString())); + + QObject *object = component.create(); + QTRY_COMPARE(object->property("xy").toInt(), 323232); +} + QTEST_MAIN(tst_QQMLTypeLoader) #include "tst_qqmltypeloader.moc" diff --git a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.pro b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.pro index 3a20e94741..0352561e03 100644 --- a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.pro +++ b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.pro @@ -3,7 +3,12 @@ TARGET = tst_qqmltypeloader QT += qml testlib qml-private quick macx:CONFIG -= app_bundle -SOURCES += tst_qqmltypeloader.cpp +SOURCES += \ + tst_qqmltypeloader.cpp \ + ../../shared/testhttpserver.cpp + +HEADERS += \ + ../../shared/testhttpserver.h include (../../shared/util.pri) -- cgit v1.2.3 From 5b8a94eb8e5d4e3b79ab73a9a0325f838ecbe41a Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 11 May 2018 12:27:25 +0200 Subject: V4 debugger: Allow retrieval of non-CallContext scopes We need to encode the scope type properly and we need to return something from the "scope" command. Previously the client didn't even get notified about QML contexts and couldn't actually retrieve anything but call context. The other scope types are not terribly interesting right now, but at least for the global context it should be possible to provide more data in the future. Task-number: QTBUG-68218 Change-Id: I88d3dbc15a93f19b00f6f12365e4fb64ec78862e Reviewed-by: hjk Reviewed-by: Simon Hausmann --- .../qqmldebugjs/data/encodeQmlScope.qml | 19 ++++++ .../qqmldebugjs/qqmldebugjs/qqmldebugjs.pro | 3 +- .../qqmldebugjs/qqmldebugjs/tst_qqmldebugjs.cpp | 67 ++++++++++++++++++++++ 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/data/encodeQmlScope.qml (limited to 'tests') diff --git a/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/data/encodeQmlScope.qml b/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/data/encodeQmlScope.qml new file mode 100644 index 0000000000..7ea048044f --- /dev/null +++ b/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/data/encodeQmlScope.qml @@ -0,0 +1,19 @@ +import QtQuick 2.0 + +Item { + property int a: 0 + property int b: 0 + onAChanged: console.log("inline") + onBChanged: { + console.log("extra braces"); + } + + Timer { + interval: 10 + running: true + onTriggered: { + parent.a += 10; + parent.b -= 10; + } + } +} diff --git a/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/qqmldebugjs.pro b/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/qqmldebugjs.pro index 90623c75a6..52d70bd1b1 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/qqmldebugjs.pro +++ b/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/qqmldebugjs.pro @@ -20,4 +20,5 @@ OTHER_FILES += data/test.qml data/test.js \ data/changeBreakpoint.qml \ data/stepAction.qml \ data/breakpointRelocation.qml \ - data/createComponent.qml + data/createComponent.qml \ + data/encodeQmlScope.qml diff --git a/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/tst_qqmldebugjs.cpp b/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/tst_qqmldebugjs.cpp index 3cd359cf48..660afce216 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/tst_qqmldebugjs.cpp +++ b/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/tst_qqmldebugjs.cpp @@ -124,6 +124,7 @@ const char *QUIT_QMLFILE = "quit.qml"; const char *CHANGEBREAKPOINT_QMLFILE = "changeBreakpoint.qml"; const char *STEPACTION_QMLFILE = "stepAction.qml"; const char *BREAKPOINTRELOCATION_QMLFILE = "breakpointRelocation.qml"; +const char *ENCODEQMLSCOPE_QMLFILE = "encodeQmlScope.qml"; #define VARIANTMAPINIT \ QString obj("{}"); \ @@ -217,6 +218,8 @@ private slots: void getScripts_data() { targetData(); } void getScripts(); + void encodeQmlScope(); + private: ConnectResult init(bool qmlscene, const QString &qmlFile = QString(TEST_QMLFILE), bool blockMode = true, bool restrictServices = false); @@ -1455,6 +1458,70 @@ void tst_QQmlDebugJS::getScripts() QVERIFY(scripts.first().toMap()[QStringLiteral("name")].toString().endsWith(QStringLiteral("data/test.qml"))); } +void tst_QQmlDebugJS::encodeQmlScope() +{ + QString file(ENCODEQMLSCOPE_QMLFILE); + QCOMPARE(init(true, file), ConnectSuccess); + + int numFrames = 0; + int numExpectedScopes = 0; + int numReceivedScopes = 0; + bool isStopped = false; + bool scopesFailed = false; + + QObject::connect(m_client, &QJSDebugClient::failure, this, [&]() { + qWarning() << "received failure" << m_client->response; + scopesFailed = true; + m_process->stop(); + numFrames = 2; + isStopped = false; + }); + + QObject::connect(m_client, &QJSDebugClient::stopped, this, [&]() { + m_client->frame(); + isStopped = true; + }); + + QObject::connect(m_client, &QJSDebugClient::result, this, [&]() { + const QVariantMap value = m_client->parser.call( + QJSValueList() << QJSValue(QString(m_client->response))).toVariant().toMap(); + + const QMap body = value.value("body").toMap(); + const QString command = value.value("command").toString(); + + if (command == QString("scope")) { + // If the scope commands fail we get a failure() signal above. + if (++numReceivedScopes == numExpectedScopes) { + m_client->continueDebugging(QJSDebugClient::Continue); + isStopped = false; + } + } else if (command == QString("frame")) { + + // We want at least a global scope and some kind of local scope here. + const QList scopes = body.value("scopes").toList(); + if (scopes.length() < 2) + scopesFailed = true; + + for (const QVariant &scope : scopes) { + ++numExpectedScopes; + m_client->scope(scope.toMap().value("index").toInt()); + } + + ++numFrames; + } + }); + + m_client->setBreakpoint(file, 6); + m_client->setBreakpoint(file, 8); + m_client->connect(); + + QTRY_COMPARE(numFrames, 2); + QVERIFY(numExpectedScopes > 3); + QVERIFY(!scopesFailed); + QTRY_VERIFY(!isStopped); + QCOMPARE(numReceivedScopes, numExpectedScopes); +} + QList tst_QQmlDebugJS::createClients() { m_client = new QJSDebugClient(m_connection); -- cgit v1.2.3 From 43aef854425a5efce8b74c3b796baa1f8a78f72f Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 24 May 2018 16:28:13 +0200 Subject: tst_gradient.qml: fix warnings about type coercion Change-Id: Ic3ab7cb4fa1772a0d92c06285f9cddf3378bd411 Reviewed-by: Simon Hausmann --- .../quick/qquickcanvasitem/data/tst_gradient.qml | 216 ++++++++++----------- 1 file changed, 108 insertions(+), 108 deletions(-) (limited to 'tests') diff --git a/tests/auto/quick/qquickcanvasitem/data/tst_gradient.qml b/tests/auto/quick/qquickcanvasitem/data/tst_gradient.qml index 00a12f2edc..f08a730ba8 100644 --- a/tests/auto/quick/qquickcanvasitem/data/tst_gradient.qml +++ b/tests/auto/quick/qquickcanvasitem/data/tst_gradient.qml @@ -410,13 +410,13 @@ CanvasTestCase { ctx.reset(); try { var err = false; ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1); - } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1)"); } try { var err = false; ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1); - } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1)"); } + } catch (e) { if (e.code !== DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1)"); } try { var err = false; ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1); - } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1)"); } + } catch (e) { if (e.code !== DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1)"); } ctx.reset(); @@ -424,229 +424,229 @@ CanvasTestCase { try { var err = false; ctx.createRadialGradient(Infinity, 0, 1, 0, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, 0, 1)"); } try { var err = false; ctx.createRadialGradient(-Infinity, 0, 1, 0, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(-Infinity, 0, 1, 0, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(-Infinity, 0, 1, 0, 0, 1)"); } try { var err = false; ctx.createRadialGradient(NaN, 0, 1, 0, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(NaN, 0, 1, 0, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(NaN, 0, 1, 0, 0, 1)"); } try { var err = false; ctx.createRadialGradient(0, Infinity, 1, 0, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, 0, 1)"); } try { var err = false; ctx.createRadialGradient(0, -Infinity, 1, 0, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, -Infinity, 1, 0, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, -Infinity, 1, 0, 0, 1)"); } try { var err = false; ctx.createRadialGradient(0, NaN, 1, 0, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, NaN, 1, 0, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, NaN, 1, 0, 0, 1)"); } try { var err = false; ctx.createRadialGradient(0, 0, Infinity, 0, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, 0, 1)"); } try { var err = false; ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 1)"); } try { var err = false; ctx.createRadialGradient(0, 0, NaN, 0, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, NaN, 0, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, NaN, 0, 0, 1)"); } try { var err = false; ctx.createRadialGradient(0, 0, 1, Infinity, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, 0, 1)"); } try { var err = false; ctx.createRadialGradient(0, 0, 1, -Infinity, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, -Infinity, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, -Infinity, 0, 1)"); } try { var err = false; ctx.createRadialGradient(0, 0, 1, NaN, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, NaN, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, NaN, 0, 1)"); } try { var err = false; ctx.createRadialGradient(0, 0, 1, 0, Infinity, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, Infinity, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, Infinity, 1)"); } try { var err = false; ctx.createRadialGradient(0, 0, 1, 0, -Infinity, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, -Infinity, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, -Infinity, 1)"); } try { var err = false; ctx.createRadialGradient(0, 0, 1, 0, NaN, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, NaN, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, NaN, 1)"); } try { var err = false; ctx.createRadialGradient(0, 0, 1, 0, 0, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, Infinity)"); } try { var err = false; ctx.createRadialGradient(0, 0, 1, 0, 0, -Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, -Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, -Infinity)"); } try { var err = false; ctx.createRadialGradient(0, 0, 1, 0, 0, NaN); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, NaN)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, NaN)"); } try { var err = false; ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, 1)"); } try { var err = false; ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, 1)"); } try { var err = false; ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, 1)"); } try { var err = false; ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, 1)"); } try { var err = false; ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity)"); } try { var err = false; ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, Infinity)"); } try { var err = false; ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, 1)"); } try { var err = false; ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, Infinity)"); } try { var err = false; ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, Infinity)"); } try { var err = false; ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, 1)"); } try { var err = false; ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, 1)"); } try { var err = false; ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, Infinity)"); } try { var err = false; ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, Infinity)"); } try { var err = false; ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, 1)"); } try { var err = false; ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, Infinity)"); } try { var err = false; ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, Infinity)"); } try { var err = false; ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, 1)"); } try { var err = false; ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, 1)"); } try { var err = false; ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, 1)"); } try { var err = false; ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, Infinity)"); } try { var err = false; ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, Infinity)"); } try { var err = false; ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, 1)"); } try { var err = false; ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, Infinity)"); } try { var err = false; ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, Infinity)"); } try { var err = false; ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, 1)"); } try { var err = false; ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, 1)"); } try { var err = false; ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, Infinity)"); } try { var err = false; ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, Infinity)"); } try { var err = false; ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, 1)"); } try { var err = false; ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, Infinity)"); } try { var err = false; ctx.createRadialGradient(Infinity, 0, 1, 0, 0, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, 0, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, 0, Infinity)"); } try { var err = false; ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, 1)"); } try { var err = false; ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, 1)"); } try { var err = false; ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, 1)"); } try { var err = false; ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, Infinity)"); } try { var err = false; ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, Infinity)"); } try { var err = false; ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, 1)"); } try { var err = false; ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, Infinity)"); } try { var err = false; ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, Infinity)"); } try { var err = false; ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, 1)"); } try { var err = false; ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, 1)"); } try { var err = false; ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, Infinity)"); } try { var err = false; ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, Infinity)"); } try { var err = false; ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, 1)"); } try { var err = false; ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, Infinity)"); } try { var err = false; ctx.createRadialGradient(0, Infinity, 1, 0, 0, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, 0, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, 0, Infinity)"); } try { var err = false; ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, 1)"); } try { var err = false; ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, 1)"); } try { var err = false; ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, Infinity)"); } try { var err = false; ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, Infinity)"); } try { var err = false; ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, 1)"); } try { var err = false; ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, Infinity)"); } try { var err = false; ctx.createRadialGradient(0, 0, Infinity, 0, 0, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, 0, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, 0, Infinity)"); } try { var err = false; ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, 1); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, 1)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, 1)"); } try { var err = false; ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, Infinity)"); } try { var err = false; ctx.createRadialGradient(0, 0, 1, Infinity, 0, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, 0, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, 0, Infinity)"); } try { var err = false; ctx.createRadialGradient(0, 0, 1, 0, Infinity, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, Infinity, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, Infinity, Infinity)"); } ctx.reset(); @@ -792,73 +792,73 @@ CanvasTestCase { ctx.reset(); try { var err = false; ctx.createLinearGradient(Infinity, 0, 1, 0); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, 1, 0)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, 1, 0)"); } try { var err = false; ctx.createLinearGradient(-Infinity, 0, 1, 0); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(-Infinity, 0, 1, 0)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(-Infinity, 0, 1, 0)"); } try { var err = false; ctx.createLinearGradient(NaN, 0, 1, 0); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(NaN, 0, 1, 0)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(NaN, 0, 1, 0)"); } try { var err = false; ctx.createLinearGradient(0, Infinity, 1, 0); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, 1, 0)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, 1, 0)"); } try { var err = false; ctx.createLinearGradient(0, -Infinity, 1, 0); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, -Infinity, 1, 0)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, -Infinity, 1, 0)"); } try { var err = false; ctx.createLinearGradient(0, NaN, 1, 0); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, NaN, 1, 0)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, NaN, 1, 0)"); } try { var err = false; ctx.createLinearGradient(0, 0, Infinity, 0); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, Infinity, 0)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, Infinity, 0)"); } try { var err = false; ctx.createLinearGradient(0, 0, -Infinity, 0); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, -Infinity, 0)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, -Infinity, 0)"); } try { var err = false; ctx.createLinearGradient(0, 0, NaN, 0); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, NaN, 0)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, NaN, 0)"); } try { var err = false; ctx.createLinearGradient(0, 0, 1, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, Infinity)"); } try { var err = false; ctx.createLinearGradient(0, 0, 1, -Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, -Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, -Infinity)"); } try { var err = false; ctx.createLinearGradient(0, 0, 1, NaN); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, NaN)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, NaN)"); } try { var err = false; ctx.createLinearGradient(Infinity, Infinity, 1, 0); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, 1, 0)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, 1, 0)"); } try { var err = false; ctx.createLinearGradient(Infinity, Infinity, Infinity, 0); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, Infinity, 0)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, Infinity, 0)"); } try { var err = false; ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity)"); } try { var err = false; ctx.createLinearGradient(Infinity, Infinity, 1, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, 1, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, 1, Infinity)"); } try { var err = false; ctx.createLinearGradient(Infinity, 0, Infinity, 0); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, Infinity, 0)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, Infinity, 0)"); } try { var err = false; ctx.createLinearGradient(Infinity, 0, Infinity, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, Infinity, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, Infinity, Infinity)"); } try { var err = false; ctx.createLinearGradient(Infinity, 0, 1, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, 1, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, 1, Infinity)"); } try { var err = false; ctx.createLinearGradient(0, Infinity, Infinity, 0); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, Infinity, 0)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, Infinity, 0)"); } try { var err = false; ctx.createLinearGradient(0, Infinity, Infinity, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, Infinity, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, Infinity, Infinity)"); } try { var err = false; ctx.createLinearGradient(0, Infinity, 1, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, 1, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, 1, Infinity)"); } try { var err = false; ctx.createLinearGradient(0, 0, Infinity, Infinity); - } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, Infinity, Infinity)"); } + } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, Infinity, Infinity)"); } ctx.reset(); var g = ctx.createLinearGradient(0, 0, 200, 0); @@ -918,29 +918,29 @@ CanvasTestCase { var g = ctx.createLinearGradient(0, 0, 100, 0); try { var err = false; g.addColorStop(0, ""); - } catch (e) { if (e.code != DOMException.SYNTAX_ERR) fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type SYNTAX_ERR: g.addColorStop(0, \"\")"); } + } catch (e) { if (e.code !== DOMException.SYNTAX_ERR) fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type SYNTAX_ERR: g.addColorStop(0, \"\")"); } try { var err = false; g.addColorStop(0, 'undefined'); - } catch (e) { if (e.code != DOMException.SYNTAX_ERR) fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type SYNTAX_ERR: g.addColorStop(0, 'undefined')"); } + } catch (e) { if (e.code !== DOMException.SYNTAX_ERR) fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type SYNTAX_ERR: g.addColorStop(0, 'undefined')"); } ctx.reset(); g = ctx.createLinearGradient(0, 0, 100, 0); try { var err = false; g.addColorStop(-1, '#000'); - } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(-1, '#000')"); } + } catch (e) { if (e.code !== DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(-1, '#000')"); } try { var err = false; g.addColorStop(2, '#000'); - } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(2, '#000')"); } + } catch (e) { if (e.code !== DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(2, '#000')"); } try { var err = false; g.addColorStop(Infinity, '#000'); - } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(Infinity, '#000')"); } + } catch (e) { if (e.code !== DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(Infinity, '#000')"); } try { var err = false; g.addColorStop(-Infinity, '#000'); - } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(-Infinity, '#000')"); } + } catch (e) { if (e.code !== DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(-Infinity, '#000')"); } try { var err = false; g.addColorStop(NaN, '#000'); - } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(NaN, '#000')"); } + } catch (e) { if (e.code !== DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(NaN, '#000')"); } ctx.reset(); -- cgit v1.2.3 From dd43adfa2d0d6f4034220cbf917c63709021e392 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 24 May 2018 16:35:20 +0200 Subject: tst_gradient.qml: fix warnings about multiple var declarations Change-Id: Iccfb86de6f8c14d10fcf12e1b7cbd58a13754aa7 Reviewed-by: Simon Hausmann --- .../quick/qquickcanvasitem/data/tst_gradient.qml | 230 ++++++++++----------- 1 file changed, 115 insertions(+), 115 deletions(-) (limited to 'tests') diff --git a/tests/auto/quick/qquickcanvasitem/data/tst_gradient.qml b/tests/auto/quick/qquickcanvasitem/data/tst_gradient.qml index f08a730ba8..7c87d896fb 100644 --- a/tests/auto/quick/qquickcanvasitem/data/tst_gradient.qml +++ b/tests/auto/quick/qquickcanvasitem/data/tst_gradient.qml @@ -33,7 +33,7 @@ CanvasTestCase { //comparePixel(ctx, 75,25, 63,63,191,255,3); ctx.reset(); - var g = ctx.createLinearGradient(0, 0, 100, 0); + g = ctx.createLinearGradient(0, 0, 100, 0); g.addColorStop(0, '#ff0'); g.addColorStop(1, '#00f'); ctx.fillStyle = g; @@ -44,7 +44,7 @@ CanvasTestCase { ctx.reset(); - var g = ctx.createLinearGradient(0, 0, 100, 0); + g = ctx.createLinearGradient(0, 0, 100, 0); g.addColorStop(0, 'rgba(255,255,0, 0)'); g.addColorStop(1, 'rgba(0,0,255, 1)'); ctx.fillStyle = g; @@ -55,7 +55,7 @@ CanvasTestCase { ctx.reset(); canvas.width = 200; - var g = ctx.createLinearGradient(0, 0, 200, 0); + g = ctx.createLinearGradient(0, 0, 200, 0); g.addColorStop(0, '#ff0'); g.addColorStop(0.5, '#0ff'); g.addColorStop(1, '#f0f'); @@ -69,7 +69,7 @@ CanvasTestCase { ctx.fillStyle = '#f00'; ctx.fillRect(0, 0, 100, 50); - var g = ctx.createLinearGradient(25, 0, 75, 0); + g = ctx.createLinearGradient(25, 0, 75, 0); g.addColorStop(0.4, '#0f0'); g.addColorStop(0.6, '#0f0'); @@ -82,7 +82,7 @@ CanvasTestCase { ctx.reset(); ctx.canvas.width = 200; - var g = ctx.createLinearGradient(0, 0, 200, 0); + g = ctx.createLinearGradient(0, 0, 200, 0); g.addColorStop(0, '#f00'); g.addColorStop(0, '#ff0'); g.addColorStop(0.25, '#00f'); @@ -110,7 +110,7 @@ CanvasTestCase { ctx.canvas.width = 100; ctx.reset(); - var g = ctx.createLinearGradient(0, 0, 100, 0); + g = ctx.createLinearGradient(0, 0, 100, 0); var ps = [ 0, 1/10, 1/4, 1/3, 1/2, 3/4, 1 ]; for (var p = 0; p < ps.length; ++p) { @@ -129,7 +129,7 @@ CanvasTestCase { ctx.reset(); - var g = ctx.createLinearGradient(0, 0, 100, 0); + g = ctx.createLinearGradient(0, 0, 100, 0); g.addColorStop(0, '#0f0'); g.addColorStop(1, '#0f0'); ctx.fillStyle = g; @@ -139,7 +139,7 @@ CanvasTestCase { ctx.reset(); - var g = ctx.createLinearGradient(0, 0, 0, 50); + g = ctx.createLinearGradient(0, 0, 0, 50); g.addColorStop(0, '#ff0'); g.addColorStop(1, '#00f'); ctx.fillStyle = g; @@ -154,7 +154,7 @@ CanvasTestCase { ctx.fillStyle = '#0f0'; ctx.fillRect(0, 0, 100, 50); - var g = ctx.createLinearGradient(50, 25, 50, 25); // zero-length line (undefined direction) + g = ctx.createLinearGradient(50, 25, 50, 25); // zero-length line (undefined direction) g.addColorStop(0, '#f00'); g.addColorStop(1, '#f00'); ctx.fillStyle = g; @@ -278,7 +278,7 @@ CanvasTestCase { //comparePixel(ctx, 98,48, 0,255,0,255); ctx.reset(); - var tol = 1; // tolerance to avoid antialiasing artifacts + tol = 1; // tolerance to avoid antialiasing artifacts ctx.fillStyle = '#0f0'; ctx.fillRect(0, 0, 100, 50); @@ -411,10 +411,10 @@ CanvasTestCase { try { var err = false; ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1); } catch (e) { if (e.code !== DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1); } catch (e) { if (e.code !== DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1); } catch (e) { if (e.code !== DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1)"); } @@ -422,229 +422,229 @@ CanvasTestCase { ctx.reset(); - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, 0, 1, 0, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(-Infinity, 0, 1, 0, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(-Infinity, 0, 1, 0, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(NaN, 0, 1, 0, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(NaN, 0, 1, 0, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, Infinity, 1, 0, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, -Infinity, 1, 0, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, -Infinity, 1, 0, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, NaN, 1, 0, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, NaN, 1, 0, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, Infinity, 0, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, NaN, 0, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, NaN, 0, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, 1, Infinity, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, 1, -Infinity, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, -Infinity, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, 1, NaN, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, NaN, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, 1, 0, Infinity, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, Infinity, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, 1, 0, -Infinity, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, -Infinity, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, 1, 0, NaN, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, NaN, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, 1, 0, 0, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, 1, 0, 0, -Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, -Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, 1, 0, 0, NaN); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, NaN)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(Infinity, 0, 1, 0, 0, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, 0, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, Infinity, 1, 0, 0, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, 0, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, Infinity, 0, 0, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, 0, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, 1); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, 1)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, 1, Infinity, 0, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, 0, Infinity)"); } - try { var err = false; + try { err = false; ctx.createRadialGradient(0, 0, 1, 0, Infinity, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, Infinity, Infinity)"); } @@ -793,70 +793,70 @@ CanvasTestCase { try { var err = false; ctx.createLinearGradient(Infinity, 0, 1, 0); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, 1, 0)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(-Infinity, 0, 1, 0); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(-Infinity, 0, 1, 0)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(NaN, 0, 1, 0); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(NaN, 0, 1, 0)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(0, Infinity, 1, 0); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, 1, 0)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(0, -Infinity, 1, 0); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, -Infinity, 1, 0)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(0, NaN, 1, 0); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, NaN, 1, 0)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(0, 0, Infinity, 0); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, Infinity, 0)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(0, 0, -Infinity, 0); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, -Infinity, 0)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(0, 0, NaN, 0); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, NaN, 0)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(0, 0, 1, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, Infinity)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(0, 0, 1, -Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, -Infinity)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(0, 0, 1, NaN); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, NaN)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(Infinity, Infinity, 1, 0); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, 1, 0)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(Infinity, Infinity, Infinity, 0); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, Infinity, 0)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(Infinity, Infinity, 1, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, 1, Infinity)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(Infinity, 0, Infinity, 0); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, Infinity, 0)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(Infinity, 0, Infinity, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, Infinity, Infinity)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(Infinity, 0, 1, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, 1, Infinity)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(0, Infinity, Infinity, 0); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, Infinity, 0)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(0, Infinity, Infinity, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, Infinity, Infinity)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(0, Infinity, 1, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, 1, Infinity)"); } - try { var err = false; + try { err = false; ctx.createLinearGradient(0, 0, Infinity, Infinity); } catch (e) { if (e.code !== DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, Infinity, Infinity)"); } @@ -919,26 +919,26 @@ CanvasTestCase { try { var err = false; g.addColorStop(0, ""); } catch (e) { if (e.code !== DOMException.SYNTAX_ERR) fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type SYNTAX_ERR: g.addColorStop(0, \"\")"); } - try { var err = false; + try { err = false; g.addColorStop(0, 'undefined'); } catch (e) { if (e.code !== DOMException.SYNTAX_ERR) fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type SYNTAX_ERR: g.addColorStop(0, 'undefined')"); } ctx.reset(); g = ctx.createLinearGradient(0, 0, 100, 0); - try { var err = false; + try { err = false; g.addColorStop(-1, '#000'); } catch (e) { if (e.code !== DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(-1, '#000')"); } - try { var err = false; + try { err = false; g.addColorStop(2, '#000'); } catch (e) { if (e.code !== DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(2, '#000')"); } - try { var err = false; + try { err = false; g.addColorStop(Infinity, '#000'); } catch (e) { if (e.code !== DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(Infinity, '#000')"); } - try { var err = false; + try { err = false; g.addColorStop(-Infinity, '#000'); } catch (e) { if (e.code !== DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(-Infinity, '#000')"); } - try { var err = false; + try { err = false; g.addColorStop(NaN, '#000'); } catch (e) { if (e.code !== DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(NaN, '#000')"); } -- cgit v1.2.3 From 0e07410b829e7f879f436ca8a168d05016acf84a Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 23 May 2018 16:21:33 +0200 Subject: Fix crash when modifying list model in worker thread If we call get() on a model in a worker thread, we may end up creating a ModelNodeMetaObject (aka cacheObject). Subsequent mutation of properties may make us end up in emitDirectNotifies(). However since we can't have bindings in there, we should shortcut/suppress the notify emission, which we can do by checking ddata->context via qmlEngine(). The previous code crashed when qmlEngine() return a null pointer but QQmlEnginePrivate::get(const QQmlEngine *) would attempt to dereference the parameter. Started-by: Slava Monich Change-Id: I880619c686436c053692faafa5dba2c96c2ace96 Reviewed-by: Robin Burchell Reviewed-by: Slava Monich --- .../auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp b/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp index 6b8002cce5..21b0508e4d 100644 --- a/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp +++ b/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp @@ -204,6 +204,7 @@ void tst_qqmllistmodelworkerscript::dynamic_data() QTest::newRow("get4") << "{append({'foo':123});get(0).foo}" << 123 << "" << dr; QTest::newRow("get-modify1") << "{append({'foo':123,'bar':456});get(0).foo = 333;get(0).foo}" << 333 << "" << dr; QTest::newRow("get-modify2") << "{append({'z':1});append({'foo':123,'bar':456});get(1).bar = 999;get(1).bar}" << 999 << "" << dr; + QTest::newRow("get-set") << "{append({'foo':123});get(0).foo;setProperty(0, 'foo', 999);get(0).foo}" << 999 << "" << dr; QTest::newRow("append1") << "{append({'foo':123});count}" << 1 << "" << dr; QTest::newRow("append2") << "{append({'foo':123,'bar':456});count}" << 1 << "" << dr; -- cgit v1.2.3 From 9a44e3b6ca81f0e84d774a95e45b449b5d4cb583 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 25 May 2018 16:59:42 +0200 Subject: QML Debugger: Don't crash when encoding JSON data Apparently QVariant::save cannot deal with QJsonObject and friends. Transform them into QVariants before sending them over the wire. Task-number: QTBUG-68474 Change-Id: I8fc9fade4915c2b40f8d16aea51ea6ff65247dc1 Reviewed-by: Simon Hausmann --- .../tst_qqmlenginedebugservice.cpp | 63 +++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp index 89217e7556..417b75e760 100644 --- a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp +++ b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp @@ -53,6 +53,9 @@ #include #include #include +#include +#include +#include #define QVERIFYOBJECT(statement) \ do {\ @@ -82,6 +85,40 @@ public: QModelIndex modelIndex() { return QModelIndex(); } }; +class JsonTest : public QObject +{ + Q_OBJECT + Q_PROPERTY(QJsonObject data READ data WRITE setData NOTIFY dataChanged) + +public: + JsonTest(QObject *parent = 0) : QObject(parent) + { + m_data["foo"] = QJsonValue(12); + m_data["ttt"] = QJsonArray({4, 5, 4, 3, 2}); + m_data["a"] = QJsonValue(QJsonValue::Null); + m_data["b"] = QJsonValue(QJsonValue::Undefined); + m_data["c"] = QJsonValue("fffff"); + } + + QJsonObject data() const { return m_data; } + +signals: + void dataChanged(const QJsonObject &data); + +public slots: + void setData(const QJsonObject &data) + { + if (data != m_data) { + m_data = data; + emit dataChanged(data); + } + } + +private: + QJsonObject m_data; +}; + + class tst_QQmlEngineDebugService : public QObject { Q_OBJECT @@ -139,6 +176,7 @@ private slots: void regression_QTCREATORBUG_7451(); void queryObjectWithNonStreamableTypes(); + void jsonData(); void asynchronousCreate(); void invalidContexts(); void createObjectOnDestruction(); @@ -363,6 +401,11 @@ void tst_QQmlEngineDebugService::initTestCase() "CustomTypes {}" ; + qmlRegisterType("JsonTest", 1, 0, "JsonTest"); + qml << "import JsonTest 1.0\n" + "JsonTest {}" + ; + for (int i=0; i= 0); QCOMPARE(context.contexts[0].name, QString("tst_QQmlDebug_childContext")); } @@ -915,6 +958,24 @@ void tst_QQmlEngineDebugService::queryObjectWithNonStreamableTypes() QVariant(QLatin1String("QModelIndex()"))); } +void tst_QQmlEngineDebugService::jsonData() +{ + bool success; + + QmlDebugObjectReference rootObject = findRootObject(5, true); + QVERIFY(!rootObject.className.isEmpty()); + + m_dbg->queryObject(rootObject, &success); + QVERIFY(success); + QVERIFY(QQmlDebugTest::waitForSignal(m_dbg, SIGNAL(result()))); + + QmlDebugObjectReference obj = m_dbg->object(); + QVERIFY(!obj.className.isEmpty()); + + QCOMPARE(findProperty(obj.properties, "data").value, + QJsonDocument::fromJson("{\"a\":null,\"c\":\"fffff\",\"foo\":12,\"ttt\":[4,5,4,3,2]}") + .toVariant()); +} void tst_QQmlEngineDebugService::queryExpressionResult() { -- cgit v1.2.3 From 854c15cdb64f9693fc8d90f73464d499ebdca4fd Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 28 May 2018 13:49:40 +0200 Subject: Fix a crash in the modulus operation INT_MIN % -1 crashes in C++ with an arithmetic exception, so avoid passing negative numbers into the integer operation, use fmod() instead. Task-number: QTBUG-68513 Change-Id: Ib5a37b55a0f9d41a84c7e6c00ea3f87622155de5 Reviewed-by: Simon Hausmann --- tests/auto/qml/qjsengine/tst_qjsengine.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp index c3a3926144..bb923951a8 100644 --- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp +++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp @@ -201,6 +201,7 @@ private slots: void basicBlockMergeAfterLoopPeeling(); + void modulusCrash(); void malformedExpression(); void scriptScopes(); @@ -4137,6 +4138,15 @@ void tst_QJSEngine::basicBlockMergeAfterLoopPeeling() } +void tst_QJSEngine::modulusCrash() +{ + QJSEngine engine; + QJSValue result = engine.evaluate( + "var a = -2147483648; var b = -1; var c = a % b; c;" + ); + QVERIFY(result.isNumber() && result.toNumber() == 0.); +} + void tst_QJSEngine::malformedExpression() { QJSEngine engine; -- cgit v1.2.3 From 2f4b8f159545b545d4b49cb3c1429c09522519ee Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 29 May 2018 14:27:46 +0200 Subject: Formals come after locals in the CallContext The method updating the internal class for a CallContext messed up the order between locals and formals, leading to wrong name lookups for signal handlers taking implicit arguments Task-number: QTBUG-68522 Change-Id: I36d55b3b0cfe9af6397455782551498b7ddb940a Reviewed-by: Lars Knoll Reviewed-by: Simon Hausmann --- tests/auto/qml/qqmlengine/tst_qqmlengine.cpp | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'tests') diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp index 6ae786469d..95098648fa 100644 --- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp +++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp @@ -78,6 +78,7 @@ private slots: void testGroupedPropertyRevisions(); void componentFromEval(); void qrcUrls(); + void cppSignalAndEval(); public slots: QObject *createAQObjectForOwnershipTest () @@ -924,6 +925,37 @@ void tst_qqmlengine::qrcUrls() } } +class ObjectCaller : public QObject +{ + Q_OBJECT +signals: + void doubleReply(const double a); +}; + +void tst_qqmlengine::cppSignalAndEval() +{ + ObjectCaller objectCaller; + QQmlEngine engine; + engine.rootContext()->setContextProperty(QLatin1Literal("CallerCpp"), &objectCaller); + QQmlComponent c(&engine); + c.setData("import QtQuick 2.9\n" + "Item {\n" + " property var r: 0\n" + " Connections {\n" + " target: CallerCpp;\n" + " onDoubleReply: {\n" + " eval('var z = 1');\n" + " r = a;\n" + " }\n" + " }\n" + "}", + QUrl(QStringLiteral("qrc:/main.qml"))); + QScopedPointer object(c.create()); + QVERIFY(!object.isNull()); + emit objectCaller.doubleReply(1.1234); + QCOMPARE(object->property("r"), 1.1234); +} + QTEST_MAIN(tst_qqmlengine) #include "tst_qqmlengine.moc" -- cgit v1.2.3 From 95b1b468413c2eeae18b0e698e3e37333c719db4 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 30 May 2018 10:09:26 +0200 Subject: V4: Set argumentsCanEscape when debugging This causes the updated arguments to be reported to the debugger when they are overwritten in the function body. Task-number: QTBUG-68534 Change-Id: I30c22d31aa97da0d58a4bbaaa032180a919669a8 Reviewed-by: Simon Hausmann --- .../qml/debugger/qv4debugger/tst_qv4debugger.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests') diff --git a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp index 4ce0f9fd89..c65c592f10 100644 --- a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp +++ b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp @@ -297,6 +297,7 @@ private slots: // context access: void readArguments_data() { redundancy_data(); } void readArguments(); + void readComplicatedArguments(); void readLocals_data() { redundancy_data(); } void readLocals(); void readObject_data() { redundancy_data(); } @@ -549,6 +550,27 @@ void tst_qv4debugger::readArguments() QCOMPARE(frame0.value(QStringLiteral("b")).toString(), QStringLiteral("two")); } +void tst_qv4debugger::readComplicatedArguments() +{ + m_debuggerAgent->collector.setRedundantRefs(false); + m_debuggerAgent->m_captureContextInfo = true; + QString script = + "var f = function(a) {\n" + " a = 12;\n" + " return a;\n" + "}\n" + "f(1, 2);\n"; + debugger()->addBreakPoint("readArguments", 3); + evaluateJavaScript(script, "readArguments"); + QVERIFY(m_debuggerAgent->m_wasPaused); + QVERIFY(m_debuggerAgent->m_capturedScope.size() > 1); + const TestAgent::NamedRefs &frame0 = m_debuggerAgent->m_capturedScope.at(0); + QCOMPARE(frame0.size(), 1); + QVERIFY(frame0.contains(QStringLiteral("a"))); + QCOMPARE(frame0.type(QStringLiteral("a")), QStringLiteral("number")); + QCOMPARE(frame0.value(QStringLiteral("a")).toInt(), 12); +} + void tst_qv4debugger::readLocals() { QFETCH(bool, redundantRefs); -- cgit v1.2.3