diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-02-18 13:52:53 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-04-15 09:56:18 -0700 |
commit | ce4270b01c692bcb1af64a774e2d595438057375 (patch) | |
tree | 88fd6d1bee21058f366bc96e14d48364c163ef37 /test/map | |
parent | 6e78eabfff75579286ab23cbde8a36fba061ca1d (diff) | |
download | qtlocation-mapboxgl-ce4270b01c692bcb1af64a774e2d595438057375.tar.gz |
[core] Convert MapContext to Map::Impl; eliminate indirection
Diffstat (limited to 'test/map')
-rw-r--r-- | test/map/map.cpp | 13 | ||||
-rw-r--r-- | test/map/map_context.cpp | 26 |
2 files changed, 13 insertions, 26 deletions
diff --git a/test/map/map.cpp b/test/map/map.cpp index 2bc00b4334..2fdf63a79a 100644 --- a/test/map/map.cpp +++ b/test/map/map.cpp @@ -1,4 +1,5 @@ #include <mbgl/test/util.hpp> +#include <mbgl/test/stub_file_source.hpp> #include <mbgl/map/map.hpp> #include <mbgl/platform/default/headless_view.hpp> @@ -44,3 +45,15 @@ TEST(Map, Offline) { NetworkStatus::Set(NetworkStatus::Status::Online); } + +TEST(Map, DoubleStyleLoad) { + util::RunLoop runLoop; + + std::shared_ptr<HeadlessDisplay> display = std::make_shared<HeadlessDisplay>(); + HeadlessView view(display, 1, 512, 512); + StubFileSource fileSource; + + Map map(view, fileSource); + map.setStyleJSON("", ""); + map.setStyleJSON("", ""); +} diff --git a/test/map/map_context.cpp b/test/map/map_context.cpp deleted file mode 100644 index be7e2abb8a..0000000000 --- a/test/map/map_context.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include <mbgl/test/util.hpp> -#include <mbgl/test/stub_file_source.hpp> - -#include <mbgl/map/map_data.hpp> -#include <mbgl/map/map_context.hpp> -#include <mbgl/platform/default/headless_view.hpp> -#include <mbgl/platform/default/headless_display.hpp> -#include <mbgl/util/thread.hpp> -#include <mbgl/util/run_loop.hpp> - -using namespace mbgl; - -TEST(MapContext, DoubleStyleLoad) { - util::RunLoop loop; - - std::shared_ptr<HeadlessDisplay> display = std::make_shared<HeadlessDisplay>(); - HeadlessView view(display, 1, 512, 512); - StubFileSource fileSource; - - util::Thread<MapContext> context({"Map"}, - view, fileSource, MapMode::Continuous, GLContextMode::Unique, view.getPixelRatio()); - - context.invokeSync(&MapContext::setStyleJSON, "", ""); - context.invokeSync(&MapContext::setStyleJSON, "", ""); - context.invokeSync(&MapContext::cleanup); -} |