diff options
-rw-r--r-- | test/storage/online_file_source.test.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test/storage/online_file_source.test.cpp b/test/storage/online_file_source.test.cpp index 5021a513e3..39582543ef 100644 --- a/test/storage/online_file_source.test.cpp +++ b/test/storage/online_file_source.test.cpp @@ -515,4 +515,22 @@ TEST(OnlineFileSource, TEST_REQUIRES_SERVER(LowHighPriorityRequestsMany)) { NetworkStatus::Set(NetworkStatus::Status::Online); loop.run(); -}
\ No newline at end of file +} + +TEST(OnlineFileSource, TEST_REQUIRES_SERVER(RequestSameUrlMultipleTimes)) { + util::RunLoop loop; + OnlineFileSource fs; + + int count = 0; + std::vector<std::unique_ptr<AsyncRequest>> requests; + + for (int i = 0; i < 100; ++i) { + requests.emplace_back(fs.request({ Resource::Unknown, "http://127.0.0.1:3000/load" }, [&](Response) { + if (++count == 100) { + loop.stop(); + } + })); + } + + loop.run(); +} |