summaryrefslogtreecommitdiff
path: root/render-test
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2020-01-04 02:10:21 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2020-01-08 13:07:12 +0200
commitd08bb49c345839ca6e3986eea7d954b51719c7e9 (patch)
tree01e1b4b2762ab16df046a78437a3af755ade2c04 /render-test
parentf306957a6de5e89dad0a5053f809e1ef93664179 (diff)
downloadqtlocation-mapboxgl-d08bb49c345839ca6e3986eea7d954b51719c7e9.tar.gz
[core] Make it possible to reopen the database read-only for testing
Needed for Android, because the database is in readonly filesystem and also because it is annoying to see files modified every time we run the tests.
Diffstat (limited to 'render-test')
-rw-r--r--render-test/file_source.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/render-test/file_source.cpp b/render-test/file_source.cpp
index 04ebf43b1b..4d6a800d1c 100644
--- a/render-test/file_source.cpp
+++ b/render-test/file_source.cpp
@@ -66,8 +66,14 @@ std::unique_ptr<AsyncRequest> ProxyFileSource::request(const Resource& resource,
std::shared_ptr<FileSource> FileSource::createPlatformFileSource(const ResourceOptions& options) {
auto fileSource = std::make_shared<ProxyFileSource>(options.cachePath(), options.assetPath());
+
fileSource->setAccessToken(options.accessToken());
fileSource->setAPIBaseURL(options.baseURL());
+
+ if (offline) {
+ fileSource->reopenDatabaseReadOnlyForTesting();
+ }
+
return fileSource;
}