diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-01-13 01:07:59 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-01-13 01:07:59 (GMT) |
commit | ef37460d0814879f5022cbb9692f3eaa49d9c8c3 (patch) | |
tree | e320dcb31e985ac25130509e4517c8d795593550 /tests/auto/declarative/xmlhttprequest | |
parent | 6884983aec9afcf71cb34241e453b2edf431a43b (diff) | |
download | Qt-ef37460d0814879f5022cbb9692f3eaa49d9c8c3.zip Qt-ef37460d0814879f5022cbb9692f3eaa49d9c8c3.tar.gz Qt-ef37460d0814879f5022cbb9692f3eaa49d9c8c3.tar.bz2 |
Give full error message (with line number) on XMLHttpRequest slot failures.
Diffstat (limited to 'tests/auto/declarative/xmlhttprequest')
-rw-r--r-- | tests/auto/declarative/xmlhttprequest/tst_xmlhttprequest.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/auto/declarative/xmlhttprequest/tst_xmlhttprequest.cpp b/tests/auto/declarative/xmlhttprequest/tst_xmlhttprequest.cpp index f952099..6e0d582 100644 --- a/tests/auto/declarative/xmlhttprequest/tst_xmlhttprequest.cpp +++ b/tests/auto/declarative/xmlhttprequest/tst_xmlhttprequest.cpp @@ -65,6 +65,7 @@ private slots: void domExceptionCodes(); void callbackException(); + void callbackException_data(); void staticStateValues(); void instanceStateValues(); void constructor(); @@ -167,15 +168,32 @@ void tst_xmlhttprequest::domExceptionCodes() QVERIFY((expr)); \ } while (false) + +void tst_xmlhttprequest::callbackException_data() +{ + QTest::addColumn<QString>("which"); + QTest::addColumn<int>("line"); + + QTest::newRow("on-opened") << "1" << 15; + QTest::newRow("on-loading") << "3" << 15; + QTest::newRow("on-done") << "4" << 15; +} + void tst_xmlhttprequest::callbackException() { - QString expect = TEST_FILE("callbackException.qml").toString() + ":16: Error: Exception from Callback"; + // Test exception reporting for exceptions thrown at various points. + + QFETCH(QString, which); + QFETCH(int, line); + + QString expect = TEST_FILE("callbackException.qml").toString() + ":"+QString::number(line)+": Error: Exception from Callback"; QTest::ignoreMessage(QtWarningMsg, expect.toLatin1()); QmlComponent component(&engine, TEST_FILE("callbackException.qml")); QObject *object = component.beginCreate(engine.rootContext()); QVERIFY(object != 0); object->setProperty("url", "testdocument.html"); + object->setProperty("which", which); component.completeCreate(); TRY_WAIT(object->property("threw").toBool() == true); |