Ejemplo 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();
 }
Ejemplo 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();
      }
    }
  }