equal
deleted
inserted
replaced
144 delete item; |
144 delete item; |
145 } |
145 } |
146 |
146 |
147 void tst_QDeclarativeLoader::invalidUrl() |
147 void tst_QDeclarativeLoader::invalidUrl() |
148 { |
148 { |
149 QTest::ignoreMessage(QtWarningMsg, QString("<Unknown File>: File error for URL " + QUrl::fromLocalFile(SRCDIR "/data/IDontExist.qml").toString()).toUtf8().constData()); |
149 QTest::ignoreMessage(QtWarningMsg, QString(QUrl::fromLocalFile(SRCDIR "/data/IDontExist.qml").toString() + ": File not found").toUtf8().constData()); |
150 |
150 |
151 QDeclarativeComponent component(&engine); |
151 QDeclarativeComponent component(&engine); |
152 component.setData(QByteArray("import Qt 4.7\nLoader { source: \"IDontExist.qml\" }"), TEST_FILE("")); |
152 component.setData(QByteArray("import Qt 4.7\nLoader { source: \"IDontExist.qml\" }"), TEST_FILE("")); |
153 QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create()); |
153 QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create()); |
154 QVERIFY(loader != 0); |
154 QVERIFY(loader != 0); |
506 { |
506 { |
507 TestHTTPServer server(SERVER_PORT); |
507 TestHTTPServer server(SERVER_PORT); |
508 QVERIFY(server.isValid()); |
508 QVERIFY(server.isValid()); |
509 server.serveDirectory(SRCDIR "/data"); |
509 server.serveDirectory(SRCDIR "/data"); |
510 |
510 |
511 QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: Network error for URL http://127.0.0.1:14450/IDontExist.qml"); |
511 QTest::ignoreMessage(QtWarningMsg, "http://127.0.0.1:14450/IDontExist.qml: File not found"); |
512 |
512 |
513 QDeclarativeComponent component(&engine); |
513 QDeclarativeComponent component(&engine); |
514 component.setData(QByteArray("import Qt 4.7\nLoader { property int did_load: 123; source: \"http://127.0.0.1:14450/IDontExist.qml\"; onLoaded: did_load=456 }"), QUrl::fromLocalFile("http://127.0.0.1:14450/dummy.qml")); |
514 component.setData(QByteArray("import Qt 4.7\nLoader { property int did_load: 123; source: \"http://127.0.0.1:14450/IDontExist.qml\"; onLoaded: did_load=456 }"), QUrl::fromLocalFile("http://127.0.0.1:14450/dummy.qml")); |
515 QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create()); |
515 QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create()); |
516 QVERIFY(loader != 0); |
516 QVERIFY(loader != 0); |