Example #1
0
TEST_F(TestDownloadQueue, RequestContent)
{
  IDownloadQueueObserver observer;
  CDownloadQueue queue;
  CTestDownloadQueueThread thread;
  unsigned int count;

  std::vector<CStdString> urls =
    CXBMCTestUtils::Instance().getTestDownloadQueueUrls();

  std::vector<CStdString>::iterator it;
  count = 0;
  for (it = urls.begin(); it < urls.end(); it++)
  {
    std::cout << "Testing URL: " << *it << "\n";
    TICKET t = queue.RequestContent(*it, &observer);
    EXPECT_EQ(count, t.dwItemId);
    count++;
  }

  thread.Sleep(1000);
  queue.Flush();
  EXPECT_EQ(0, queue.Size());
}