[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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user