summaryrefslogtreecommitdiff
path: root/test/storage/http_environment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/storage/http_environment.cpp')
-rw-r--r--test/storage/http_environment.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/storage/http_environment.cpp b/test/storage/http_environment.cpp
index efd7b78ad4..b08a8071c4 100644
--- a/test/storage/http_environment.cpp
+++ b/test/storage/http_environment.cpp
@@ -4,6 +4,7 @@
#include <mbgl/storage/default_file_source.hpp>
#include <mbgl/storage/network_status.hpp>
+#include <mbgl/util/thread.hpp>
#include <cmath>
@@ -13,7 +14,7 @@ TEST_F(Storage, HTTPCancelEnvironment) {
using namespace mbgl;
- DefaultFileSource fs(nullptr, uv_default_loop());
+ util::Thread<DefaultFileSource> fs(nullptr);
// Create two fake environment pointers. The FileSource implementation treats these as opaque
// pointers and doesn't reach into them.
@@ -23,7 +24,7 @@ TEST_F(Storage, HTTPCancelEnvironment) {
const Resource resource { Resource::Unknown, "http://127.0.0.1:3000/delayed" };
// Environment 1
- fs.request(resource, uv_default_loop(), env1, [&](const Response &res) {
+ fs->request(resource, uv_default_loop(), env1, [&](const Response &res) {
// This environment gets aborted below. This means the request is marked as failing and
// will return an error here.
EXPECT_EQ(Response::Error, res.status);
@@ -36,7 +37,7 @@ TEST_F(Storage, HTTPCancelEnvironment) {
});
// Environment 2
- fs.request(resource, uv_default_loop(), env2, [&](const Response &res) {
+ fs->request(resource, uv_default_loop(), env2, [&](const Response &res) {
// The same request as above, but in a different environment which doesn't get aborted. This
// means the request should succeed.
EXPECT_EQ(Response::Successful, res.status);
@@ -48,7 +49,7 @@ TEST_F(Storage, HTTPCancelEnvironment) {
HTTPRetainedEnvironment.finish();
});
- fs.abort(env1);
+ fs->abort(env1);
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
}