* [core] Introduce FileSourceManager and use it for default platform impl
- Add `FileSourceManager` interface that provides access to `FileSource`
instances and means of registering / unregistering `FileSource` factories
- Split `DefaultFileSource` into smaller parts
- Add `DatabaseFileSource` interface and it's default implementation
- Remove inter-dependencies between concrete `FileSource` classes
* [build] Add files to next build system
* [core] Add generic property setters / getters
* [core] Remove setOnlineStatus from OnlineFileSource interface
* [core] Hide threading implementation details from DatabaseFileSource interface
* [core] Make DB file source methods virtual
* [core] Add documentation for DatabaseFileSource and rename one method
* [core] Use simple callback instead of ActorRef
* [core] Remove ActorRef from OnlineFileSource public header
* [core] Add callback to FileSource::forward async API
* [core] Pass OfflineRegionDefinition by value
* [core] Update tests to use modular file sources
* [core] Update unit tests
* [core] Update unit tests after rebase
* [core] Backport low prio fix for cached requests
* [core] Backport pack database
* [core] Return removed factory from unRegisterFileSourceFactory
* [core] Rename shadowed args in onlinefilesource
* [core] Remove simple std::function callback aliases
* [core] Expose online file source property keys in public header file
* [test-runner] Add proxy file source test runner
* [cache] Update mbgl-cache utility to use new file source
* [metrics] Rebaseline binary size metrics
* [offline] Update offline utility
* [core] Update changelog
71 lines
2.0 KiB
C++
71 lines
2.0 KiB
C++
#pragma once
|
|
|
|
#include <mbgl/gfx/headless_frontend.hpp>
|
|
#include <mbgl/map/map.hpp>
|
|
#include <mbgl/storage/file_source.hpp>
|
|
|
|
#include "manifest_parser.hpp"
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
class TestRunnerMapObserver;
|
|
struct TestMetadata;
|
|
|
|
class TestRunnerMapObserver : public mbgl::MapObserver {
|
|
public:
|
|
TestRunnerMapObserver() = default;
|
|
void onDidFailLoadingMap(mbgl::MapLoadError, const std::string&) override { mapLoadFailure = true; }
|
|
|
|
void onDidFinishRenderingMap(RenderMode mode) override final {
|
|
if (!finishRenderingMap) finishRenderingMap = mode == RenderMode::Full;
|
|
}
|
|
|
|
void onDidBecomeIdle() override final { idle = true; }
|
|
|
|
void reset() {
|
|
mapLoadFailure = false;
|
|
finishRenderingMap = false;
|
|
idle = false;
|
|
}
|
|
|
|
bool mapLoadFailure;
|
|
bool finishRenderingMap;
|
|
bool idle;
|
|
};
|
|
|
|
class TestRunner {
|
|
public:
|
|
enum class UpdateResults { NO, DEFAULT, PLATFORM, METRICS, REBASELINE };
|
|
|
|
TestRunner(Manifest, UpdateResults);
|
|
void run(TestMetadata&);
|
|
void reset();
|
|
|
|
// Manifest
|
|
const Manifest& getManifest() const;
|
|
void doShuffle(uint32_t seed);
|
|
|
|
private:
|
|
mbgl::HeadlessFrontend::RenderResult runTest(TestMetadata& metadata, TestContext& ctx);
|
|
void checkQueryTestResults(mbgl::PremultipliedImage&& actualImage,
|
|
std::vector<mbgl::Feature>&& features,
|
|
TestMetadata&);
|
|
void checkRenderTestResults(mbgl::PremultipliedImage&& image, TestMetadata&);
|
|
void checkProbingResults(TestMetadata&);
|
|
void registerProxyFileSource();
|
|
|
|
struct Impl {
|
|
Impl(const TestMetadata&, const mbgl::ResourceOptions&);
|
|
~Impl();
|
|
|
|
std::unique_ptr<TestRunnerMapObserver> observer;
|
|
mbgl::HeadlessFrontend frontend;
|
|
std::shared_ptr<mbgl::FileSource> fileSource;
|
|
mbgl::Map map;
|
|
};
|
|
std::unordered_map<std::string, std::unique_ptr<Impl>> maps;
|
|
Manifest manifest;
|
|
UpdateResults updateResults;
|
|
};
|