summaryrefslogtreecommitdiff
path: root/test/storage/http_cancel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/storage/http_cancel.cpp')
-rw-r--r--test/storage/http_cancel.cpp55
1 files changed, 0 insertions, 55 deletions
diff --git a/test/storage/http_cancel.cpp b/test/storage/http_cancel.cpp
deleted file mode 100644
index bda274c547..0000000000
--- a/test/storage/http_cancel.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-#include "storage.hpp"
-
-#include <mbgl/storage/online_file_source.hpp>
-#include <mbgl/storage/network_status.hpp>
-#include <mbgl/util/chrono.hpp>
-#include <mbgl/util/run_loop.hpp>
-
-#include <cmath>
-
-TEST_F(Storage, TEST_REQUIRES_SERVER(HTTPCancel)) {
- SCOPED_TEST(HTTPCancel)
-
- using namespace mbgl;
-
- util::RunLoop loop;
- OnlineFileSource fs;
-
- auto req =
- fs.request({ Resource::Unknown, "http://127.0.0.1:3000/test" },
- [&](Response) { ADD_FAILURE() << "Callback should not be called"; });
-
- req.reset();
- HTTPCancel.finish();
-
- loop.runOnce();
-}
-
-TEST_F(Storage, TEST_REQUIRES_SERVER(HTTPCancelMultiple)) {
- SCOPED_TEST(HTTPCancelMultiple)
-
- using namespace mbgl;
-
- util::RunLoop loop;
- OnlineFileSource fs;
-
- const Resource resource { Resource::Unknown, "http://127.0.0.1:3000/test" };
-
- std::unique_ptr<AsyncRequest> req2 = fs.request(resource, [&](Response) {
- ADD_FAILURE() << "Callback should not be called";
- });
- std::unique_ptr<AsyncRequest> req = fs.request(resource, [&](Response res) {
- req.reset();
- EXPECT_EQ(nullptr, res.error);
- ASSERT_TRUE(res.data.get());
- EXPECT_EQ("Hello World!", *res.data);
- EXPECT_FALSE(bool(res.expires));
- EXPECT_FALSE(bool(res.modified));
- EXPECT_FALSE(bool(res.etag));
- loop.stop();
- HTTPCancelMultiple.finish();
- });
- req2.reset();
-
- loop.run();
-}