diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-12-12 20:11:51 +0200 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-12-13 15:34:06 +0200 |
commit | b2d06b8a17cd012d0c3accc95645780e6de6732a (patch) | |
tree | 9471f77f3707f775eccdb8c1879cefa689b7eaed /render-test/runner.hpp | |
parent | 9901167936fa8fe13fa0f93a0604e86fc15b71cd (diff) | |
download | qtlocation-mapboxgl-b2d06b8a17cd012d0c3accc95645780e6de6732a.tar.gz |
[test runner] Split operations parsing and execution
Diffstat (limited to 'render-test/runner.hpp')
-rw-r--r-- | render-test/runner.hpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/render-test/runner.hpp b/render-test/runner.hpp index 7076cdfd78..8a1d00bc97 100644 --- a/render-test/runner.hpp +++ b/render-test/runner.hpp @@ -11,22 +11,27 @@ class TestRunnerMapObserver; struct TestMetadata; -class TestContext { +class TestRunnerMapObserver : public mbgl::MapObserver { public: - virtual mbgl::HeadlessFrontend& getFrontend() = 0; - virtual mbgl::Map& getMap() = 0; - virtual TestRunnerMapObserver& getObserver() = 0; - virtual TestMetadata& getMetadata() = 0; + TestRunnerMapObserver() = default; + void onDidFailLoadingMap(mbgl::MapLoadError, const std::string&) override { mapLoadFailure = true; } - GfxProbe activeGfxProbe; - GfxProbe baselineGfxProbe; - bool gfxProbeActive = false; + void onDidFinishRenderingMap(RenderMode mode) override final { + if (!finishRenderingMap) finishRenderingMap = mode == RenderMode::Full; + } -protected: - virtual ~TestContext() = default; -}; + void onDidBecomeIdle() override final { idle = true; } + + void reset() { + mapLoadFailure = false; + finishRenderingMap = false; + idle = false; + } -using TestOperation = std::function<bool(TestContext&)>; + bool mapLoadFailure; + bool finishRenderingMap; + bool idle; +}; class TestRunner { public: @@ -40,7 +45,6 @@ public: void doShuffle(uint32_t seed); private: - bool runOperations(TestContext&); bool runInjectedProbesBegin(TestContext&); bool runInjectedProbesEnd(TestContext&, mbgl::gfx::RenderingStats); |