diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2018-02-27 17:27:36 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2018-02-28 11:54:37 +0200 |
commit | 48744d51d8f460de3dc32ad4ef3e0ee12f80a149 (patch) | |
tree | b2cdc099803590a698e4f0aafccd07eceef681fa /test/src | |
parent | 98470e242d2b030789125bdc84ac63a1de423ae2 (diff) | |
download | qtlocation-mapboxgl-48744d51d8f460de3dc32ad4ef3e0ee12f80a149.tar.gz |
[test] Update Map.PrefetchTiles
Diffstat (limited to 'test/src')
-rw-r--r-- | test/src/mbgl/test/stub_map_observer.hpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/test/src/mbgl/test/stub_map_observer.hpp b/test/src/mbgl/test/stub_map_observer.hpp new file mode 100644 index 0000000000..1371577473 --- /dev/null +++ b/test/src/mbgl/test/stub_map_observer.hpp @@ -0,0 +1,49 @@ +#pragma once + +#include <mbgl/map/map_observer.hpp> + +#include <functional> + +namespace mbgl { + +class StubMapObserver : public MapObserver { +public: + void onWillStartLoadingMap() final { + if (willStartLoadingMapCallback) { + willStartLoadingMapCallback(); + } + } + + void onDidFinishLoadingMap() final { + if (didFinishLoadingMapCallback) { + didFinishLoadingMapCallback(); + } + } + + void onDidFailLoadingMap(std::exception_ptr) final { + if (didFailLoadingMapCallback) { + didFailLoadingMapCallback(); + } + } + + void onDidFinishLoadingStyle() final { + if (didFinishLoadingStyleCallback) { + didFinishLoadingStyleCallback(); + } + } + + void onDidFinishRenderingFrame(RenderMode mode) final { + if (didFinishRenderingFrameCallback) { + didFinishRenderingFrameCallback(mode); + } + } + + std::function<void()> willStartLoadingMapCallback; + std::function<void()> didFinishLoadingMapCallback; + std::function<void()> didFailLoadingMapCallback; + std::function<void()> didFinishLoadingStyleCallback; + std::function<void(RenderMode)> didFinishRenderingFrameCallback; +}; + + +} // namespace mbgl |