Merge remote-tracking branch 'origin/5.5' into dev
authorSimon Hausmann <simon.hausmann@theqtcompany.com>
Tue, 28 Apr 2015 08:57:34 +0000 (10:57 +0200)
committerSimon Hausmann <simon.hausmann@theqtcompany.com>
Tue, 28 Apr 2015 12:29:59 +0000 (14:29 +0200)
Conflicts:
tests/auto/quick/qquicktext/tst_qquicktext.cpp

Change-Id: I075e742da8396a268d97d3ab34bcd9e0c0cf001f

1  2 
src/qml/jsruntime/qv4engine.cpp
src/qml/qml/qqmlvaluetypewrapper.cpp
src/quick/scenegraph/qsgrenderloop.cpp
src/quick/scenegraph/qsgthreadedrenderloop.cpp
tests/auto/qml/qqmlxmlhttprequest/data/receive_json_data.expect
tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp
tests/auto/quick/qquickimage/tst_qquickimage.cpp
tests/auto/quick/qquicktext/tst_qquicktext.cpp
tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp

Simple merge
Simple merge
index 59a7806,0000000..97b016f
mode 100644,000000..100644
--- /dev/null
@@@ -1,7 -1,0 +1,7 @@@
- Host: 127.0.0.1:14445
 +GET /json.data HTTP/1.1
 +Accept-Language: en-US,*
 +Content-Type: application/jsonrequest
 +Connection: Keep-Alive
 +Accept-Encoding: gzip, deflate
 +User-Agent: Mozilla/5.0
++Host: {{ServerHostUrl}}
@@@ -836,23 -848,6 +849,23 @@@ void tst_qqmlxmlhttprequest::getBinaryD
      QTRY_VERIFY(object->property("readSize").toInt() == fileInfo.size());
  }
  
-     QVERIFY2(server.listen(SERVER_PORT), qPrintable(server.errorString()));
 +void tst_qqmlxmlhttprequest::getJsonData()
 +{
 +    TestHTTPServer server;
-     object->setProperty("url", "http://127.0.0.1:14445/json.data");
++    QVERIFY2(server.listen(), qPrintable(server.errorString()));
 +    QVERIFY(server.wait(testFileUrl("receive_json_data.expect"),
 +                        testFileUrl("receive_binary_data.reply"),
 +                        testFileUrl("json.data")));
 +
 +    QQmlComponent component(&engine, testFileUrl("receiveJsonData.qml"));
 +    QScopedPointer<QObject> object(component.beginCreate(engine.rootContext()));
 +    QVERIFY(!object.isNull());
++    object->setProperty("url", server.urlString("/json.data"));
 +    component.completeCreate();
 +
 +    QTRY_VERIFY(object->property("result").toBool());
 +}
 +
  void tst_qqmlxmlhttprequest::status()
  {
      QFETCH(QUrl, replyUrl);
@@@ -135,17 -132,12 +132,19 @@@ void tst_qquickborderimage::imageSource
      QFETCH(bool, remote);
      QFETCH(QString, error);
  
 +#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
 +    if (qstrcmp(QTest::currentDataTag(), "remote") == 0
 +        || qstrcmp(QTest::currentDataTag(), "remote not found") == 0) {
 +        QSKIP("Remote tests cause occasional hangs in the CI system -- QTBUG-45655");
 +    }
 +#endif
 +
      TestHTTPServer server;
      if (remote) {
-         QVERIFY2(server.listen(SERVER_PORT), qPrintable(server.errorString()));
+         QVERIFY2(server.listen(), qPrintable(server.errorString()));
          server.serveDirectory(dataDirectory());
+         source = server.urlString(source);
+         error.replace(QStringLiteral("{{ServerBaseUrl}}"), server.baseUrl().toString());
      }
  
      if (!error.isEmpty())
@@@ -171,23 -168,13 +168,25 @@@ void tst_qquickimage::imageSource(
      QFETCH(bool, cache);
      QFETCH(QString, error);
  
 +
 +#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
 +    if (qstrcmp(QTest::currentDataTag(), "remote") == 0
 +        || qstrcmp(QTest::currentDataTag(), "remote redirected") == 0
 +        || qstrcmp(QTest::currentDataTag(), "remote svg") == 0
 +        || qstrcmp(QTest::currentDataTag(), "remote svgz") == 0
 +        || qstrcmp(QTest::currentDataTag(), "remote not found") == 0
 +       ) {
 +        QSKIP("Remote tests cause occasional hangs in the CI system -- QTBUG-45655");
 +    }
 +#endif
 +
      TestHTTPServer server;
      if (remote) {
-         QVERIFY2(server.listen(SERVER_PORT), qPrintable(server.errorString()));
+         QVERIFY2(server.listen(), qPrintable(server.errorString()));
          server.serveDirectory(dataDirectory());
-         server.addRedirect("oldcolors.png", SERVER_ADDR "/colors.png");
+         server.addRedirect("oldcolors.png", server.urlString("/colors.png"));
+         source = server.urlString(source);
+         error.replace(QStringLiteral("{{ServerBaseUrl}}"), server.baseUrl().toString());
      }
  
      if (!error.isEmpty())
@@@ -571,9 -558,8 +570,9 @@@ void tst_qquickimage::noLoading(
      QTRY_COMPARE(statusSpy.count(), 3);
  
      // Loading remote file again - should not go through 'Loading' state.
 +    progressSpy.clear();
      ctxt->setContextProperty("srcImage", testFileUrl("green.png"));
-     ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/rect.png");
+     ctxt->setContextProperty("srcImage", server.url("/rect.png"));
      QTRY_VERIFY(obj->status() == QQuickImage::Ready);
      QTRY_VERIFY(obj->progress() == 1.0);
      QTRY_COMPARE(sourceSpy.count(), 4);
@@@ -2051,8 -2046,8 +2048,8 @@@ void tst_qquicktext::embeddedImages_dat
      QTest::newRow("local") << testFileUrl("embeddedImagesLocalRelative.qml") << "";
      QTest::newRow("remote") << testFileUrl("embeddedImagesRemote.qml") << "";
      QTest::newRow("remote-error") << testFileUrl("embeddedImagesRemoteError.qml")
-                                   << testFileUrl("embeddedImagesRemoteError.qml").toString()+":3:1: QML Text: Error downloading " SERVER_ADDR "/notexists.png - server replied: Not found";
+                                   << testFileUrl("embeddedImagesRemoteError.qml").toString()+":3:1: QML Text: Error downloading {{ServerBaseUrl}}/notexists.png - server replied: Not found";
 -    QTest::newRow("remote") << testFileUrl("embeddedImagesRemoteRelative.qml") << "";
 +    QTest::newRow("remote-relative") << testFileUrl("embeddedImagesRemoteRelative.qml") << "";
  }
  
  void tst_qquicktext::embeddedImages()
      QFETCH(QUrl, qmlfile);
      QFETCH(QString, error);
  
 +#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
 +    if (qstrcmp(QTest::currentDataTag(), "remote") == 0
 +        || qstrcmp(QTest::currentDataTag(), "remote-error") == 0
 +        || qstrcmp(QTest::currentDataTag(), "remote-relative") == 0) {
 +        QSKIP("Remote tests cause occasional hangs in the CI system -- QTBUG-45655");
 +    }
 +#endif
 +
      TestHTTPServer server;
-     QVERIFY2(server.listen(SERVER_PORT), qPrintable(server.errorString()));
+     QVERIFY2(server.listen(), qPrintable(server.errorString()));
      server.serveDirectory(testFile("http"));
+     error.replace(QStringLiteral("{{ServerBaseUrl}}"), server.baseUrl().toString());
  
      if (!error.isEmpty())
          QTest::ignoreMessage(QtWarningMsg, error.toLatin1());