summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2016-07-04 20:23:49 +0300
committerThiago Marcos P. Santos <thiago@mapbox.com>2016-07-05 21:04:27 +0300
commit13cd75f099c92b6f0862db00eee8ff4a78a73316 (patch)
treeaa506edf786cfbca677c4760fa2da2a5698bc831 /test
parentb3b86f9be4187fc82f34188c627c1466c79ad041 (diff)
downloadqtlocation-mapboxgl-13cd75f099c92b6f0862db00eee8ff4a78a73316.tar.gz
[android] Do not create Timers on Default main loops
Not supported, because we don't have control over the Looper timeout like we do for Loopers we create. On the main thread, Android takes care of making the application sleep and sets an arbitrary timeout. This could be properly fixed by implementing timers in Java, but we don't really have the use case of timers in the main thread.
Diffstat (limited to 'test')
-rw-r--r--test/util/timer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/util/timer.cpp b/test/util/timer.cpp
index f6253ab6d3..c37440ed40 100644
--- a/test/util/timer.cpp
+++ b/test/util/timer.cpp
@@ -10,7 +10,7 @@
using namespace mbgl::util;
TEST(Timer, TEST_REQUIRES_ACCURATE_TIMING(Basic)) {
- RunLoop loop;
+ RunLoop loop(RunLoop::Type::New);
Timer timer;
@@ -34,7 +34,7 @@ TEST(Timer, TEST_REQUIRES_ACCURATE_TIMING(Basic)) {
}
TEST(Timer, TEST_REQUIRES_ACCURATE_TIMING(Repeat)) {
- RunLoop loop;
+ RunLoop loop(RunLoop::Type::New);
Timer timer;
@@ -60,7 +60,7 @@ TEST(Timer, TEST_REQUIRES_ACCURATE_TIMING(Repeat)) {
}
TEST(Timer, TEST_REQUIRES_ACCURATE_TIMING(Stop)) {
- RunLoop loop;
+ RunLoop loop(RunLoop::Type::New);
Timer timer1;
Timer timer2;
@@ -96,7 +96,7 @@ TEST(Timer, TEST_REQUIRES_ACCURATE_TIMING(Stop)) {
}
TEST(Timer, TEST_REQUIRES_ACCURATE_TIMING(DestroyShouldStop)) {
- RunLoop loop;
+ RunLoop loop(RunLoop::Type::New);
auto timer1 = std::make_unique<Timer>();
Timer timer2;
@@ -132,7 +132,7 @@ TEST(Timer, TEST_REQUIRES_ACCURATE_TIMING(DestroyShouldStop)) {
}
TEST(Timer, TEST_REQUIRES_ACCURATE_TIMING(StartOverrides)) {
- RunLoop loop;
+ RunLoop loop(RunLoop::Type::New);
Timer timer;
@@ -166,7 +166,7 @@ TEST(Timer, TEST_REQUIRES_ACCURATE_TIMING(StartOverrides)) {
}
TEST(Timer, TEST_REQUIRES_ACCURATE_TIMING(CanStopNonStartedTimer)) {
- RunLoop loop;
+ RunLoop loop(RunLoop::Type::New);
Timer timer;
timer.stop();