summaryrefslogtreecommitdiff
path: root/test/fixtures
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2015-11-13 17:47:22 +0200
committerThiago Marcos P. Santos <thiago@mapbox.com>2015-12-01 11:49:02 +0200
commitcb06526b10d9ef44b3606c36aec498822884251e (patch)
tree822be48cb08a3cb51074689fbef4f92578a556ed /test/fixtures
parentae3f1c79faa34337628d671d071a82ac97a66081 (diff)
downloadqtlocation-mapboxgl-cb06526b10d9ef44b3606c36aec498822884251e.tar.gz
[tests] Remove libuv dependency from the tests
Diffstat (limited to 'test/fixtures')
-rw-r--r--test/fixtures/mock_file_source.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/test/fixtures/mock_file_source.cpp b/test/fixtures/mock_file_source.cpp
index ea580276d6..021ddfa8df 100644
--- a/test/fixtures/mock_file_source.cpp
+++ b/test/fixtures/mock_file_source.cpp
@@ -3,16 +3,11 @@
#include <mbgl/util/io.hpp>
#include <mbgl/util/thread.hpp>
+#include <mbgl/util/timer.hpp>
#include <algorithm>
#include <unordered_map>
-namespace {
-
-const uint64_t timeout = 1000000;
-
-}
-
namespace mbgl {
class MockFileRequest : public FileRequest {
@@ -36,8 +31,8 @@ public:
class MockFileSource::Impl {
public:
Impl(Type type, const std::string& match)
- : type_(type), match_(match), timer_(util::RunLoop::getLoop()) {
- timer_.start(timeout, timeout, [this] { dispatchPendingRequests(); });
+ : type_(type), match_(match) {
+ timer_.start(std::chrono::milliseconds(1000), std::chrono::milliseconds(1000), [this] { dispatchPendingRequests(); });
timer_.unref();
}
@@ -63,7 +58,7 @@ private:
Type type_;
std::string match_;
std::unordered_map<FileRequest*, std::pair<Resource, Callback>> pendingRequests_;
- uv::timer timer_;
+ util::Timer timer_;
std::function<void(void)> requestEnqueuedCallback_;
};