Esempio n. 1
0
 virtual void OnDownloadFinish(HttpRequest & request)
 {
   auto const status = request.Status();
   m_statuses.emplace_back(status);
   TEST(status == HttpRequest::EFailed || status == HttpRequest::ECompleted, ());
   QCoreApplication::quit();
 }
Esempio n. 2
0
  void OnDownloadProgress(HttpRequest & request)
  {
    m_progressWasCalled = true;
    TEST_EQUAL(request.Status(), HttpRequest::EInProgress, ());

    // Cancel download if needed
    if (m_chunksToFail != -1)
    {
      --m_chunksToFail;
      if (m_chunksToFail == 0)
      {
        m_chunksToFail = -1;
        LOG(LINFO, ("Download canceled"));
        QCoreApplication::quit();
      }
    }
  }