summaryrefslogtreecommitdiff
path: root/test/storage
Commit message (Collapse)AuthorAgeFilesLines
* [tests] Fix compilation error in test/storage/headers.cppBruno de Oliveira Abinader2016-02-161-13/+13
| | | | | | error: converting ‘false’ to pointer type for argument 1 of ‘char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Werror=conversion-null]
* [tests] Fix buildJohn Firebaugh2016-02-111-1/+1
|
* [core] Always store tiles without ratio support with ratio = 1John Firebaugh2016-02-101-8/+18
|
* [core] Optimize offline database schemaJohn Firebaugh2016-02-101-5/+6
| | | | | * Under the hood, SQLite creates surrogate keys (ROWID) anyway. We may as well take advantage of this and use the surrogates for foreign keys as well, since they are simpler and more efficient than compound foreign keys. * Create indexes for efficient eviction queries
* [core] Retry errors encountered during offline downloadsJohn Firebaugh2016-02-101-0/+32
|
* [core] Eliminate maximumCacheEntrySizeJohn Firebaugh2016-02-101-26/+44
| | | | Instead, the eviction policy accounts for the actual size needed for an incoming put.
* [core] Implement an eviction policy for OfflineDatabaseJohn Firebaugh2016-02-101-0/+72
| | | | | | | | | | | | | When inserting an cached resource, or removing a region, remove least-recently used resources and tiles, not used by offline regions, until the used database size, as calculated by multiplying the number of in-use pages by the page size, is less than the maximum cache size minus 5 times the page size. In addition, OfflineDatabase may be configured to ignore cache puts of individual resources larger than a certain size. This policy is similar but not identical to the former SQLiteCache policy: * It accounts for offline, by exempting resources required by offline regions from eviction. * It must delete from two tables (resources and tiles), rather than one. Currently the strategy is naive: evict 50 rows at a time from each table. * It makes maximumCacheSize and maximumCacheEntrySize completely independent. The SQLiteCache implementation evicted when `usedSize > maximumCacheSize - 2 * maximumCacheEntrySize`. This evicts when `usedSize > maximumCacheSize - 5 * pageSize`. * It uses a non-unlimited default value for maximumCacheSize: 50 MB. We should have always had a limit in place; "a cache without an eviction policy is a resource leak".
* [core] Reset SQLite statements after use in order to release locksJohn Firebaugh2016-02-101-0/+32
|
* Add binary for smoke-testing offline downloadsJohn Firebaugh2016-02-101-17/+0
|
* [core] Interface and implementation for offlineJohn Firebaugh2016-02-103-0/+451
|
* [all] Don't interpret 404s on non-tile resources as "no content"John Firebaugh2016-02-103-7/+61
|
* [all] Do not set Response data for 404sJohn Firebaugh2016-02-102-6/+3
| | | | For AssetFileSource and the node FileSource this was already the case; this makes the other implementations consistent.
* [core] Reimplement existing caching within an offline-capable database schemaJohn Firebaugh2016-02-108-975/+422
|
* [core] Moving caching logic to DefaultFileSourceJohn Firebaugh2016-02-1011-43/+32
| | | | This results in OnlineFileSource containing precisely the logic we want for reuse by OfflineFileSource, and no more.
* [tests] Add test for AssetFileSource URL encodingJohn Firebaugh2016-02-081-0/+21
|
* [core] Remove Response::Error::Reason::CanceledJohn Firebaugh2016-02-041-1/+0
| | | | There is no such thing as a cancelled response, only cancelled requests. A request that is cancelled does not have its callback called with a Response.
* [core] Rationalize Resource initializationJohn Firebaugh2016-01-291-0/+50
|
* Cleanup std::chrono usageBruno de Oliveira Abinader2016-01-252-4/+5
| | | | Use mbgl::Duration and mbgl::{,Milli}Seconds whenever possible.
* [core] Include prior values of caching headers in ResourceJohn Firebaugh2016-01-221-4/+2
| | | | This allows the FileSource interface itself to support revalidation. We could (and probably should) now rewrite HTTPContextBase implementations as FileSource implementations.
* [core] Polyfill std::chrono::absJohn Firebaugh2016-01-221-3/+1
|
* [core] Merge rfc1123, iso8601, and parse_date into chrono.hpp and fix their APIJohn Firebaugh2016-01-221-1/+0
|
* [core] Use better types for modified / expires / etagJohn Firebaugh2016-01-2114-81/+81
|
* [core] Eliminate Response::stale and inline Response::isExpired()John Firebaugh2016-01-2112-116/+64
| | | | Response::isExpired() had subtle and potentially confusing behavior around Seconds::zero(). It's best to inline it and comment why.
* [core] use stale glyphsKonstantin Käfer2016-01-151-2/+31
| | | | Updating glyphs is still unsupported, and there's no good use case for doing so. When we're using a stale glyph PBF, and the fresh answer contains changed to that glyph, we will continue to use the old glyph.
* [core] use stale sprite dataKonstantin Käfer2016-01-151-0/+28
| | | | This is a naïve implementation that essentially merges updated data into existing data. It will *not* remove icons from the stale sprite if they aren't present in the fresh sprite (we aren't tracking the source of a sprite, and the user could have changed it as well). Similarly, it will not update icons that have changed in dimension. This is a rare edge case and probably not worth implementing.
* [core] use stale and refreshing TileJSON/GeoJSON dataKonstantin Käfer2016-01-151-0/+23
| | | | We're now supporting using stale TileJSON and GeoJSON data. When we receive a new answer with an updated TileJSON file, we're replacing the Source's metadata with the new one and trigger updates to make sure we're loading the correct tiles. Similarly, GeoJSON data will be reparsed.
* [core] use stale stylesKonstantin Käfer2016-01-152-0/+54
| | | | This adds support for using cached styles that are stale. They're treated like changing styles; when the refreshed style changed compared to the one we've already had, we're swapping out the entire style, which might cause a slight flicker.
* [core] Support multiple paths in SQLiteCache::getShared()Konstantin Käfer2016-01-151-0/+34
| | | | If you use many different caches, expired weak_ptrs will pile up in the unordered_map, but that is an edge case, and you probably shouldn't do that anyway.
* [core] Restore existing response bodyJohn Firebaugh2016-01-141-0/+4
| | | | Until #2721 lands we still need this.
* [core] Let SQLiteCache decide when store or refresh responsesJohn Firebaugh2016-01-142-5/+6
|
* [core] Add an explicit "not modified" indicator to ResponseJohn Firebaugh2016-01-141-6/+2
|
* [core] std::shared_ptr<const Response> ⇢ const Response&John Firebaugh2016-01-143-32/+27
|
* [core] Eliminate FileCache interfaceJohn Firebaugh2016-01-141-3/+3
| | | | There is only one implementation and we're unlikely to add more.
* [core] Remove request coalescing in OnlineFileSourceJohn Firebaugh2016-01-132-160/+0
|
* [core] Eliminate platform::assetRoot()John Firebaugh2016-01-131-6/+7
| | | | I regenerated assets.zip so that all file paths have an `assets/` prefix, as the Android AssetFileSource implementation asserts, and removed `TEST_DATA` from the paths.
* [core] Simplify asset:// implementationJohn Firebaugh2016-01-132-92/+19
| | | | | | | | * Move asset:// URL handling to DefaultFileSource. * AssetFileSource implements FileSource interface and follows familiar implementation patterns. * Move default implementation to platform/default, zip implementation to platform/android. * Don't bother with modified / expires / etag -- assets are not cached so it doesn't matter. * Don't bother with interleaving individual IO calls on the implementation thread. That adds a lot of complexity for very little benefit.
* [test] Fix test case commentsKonstantin Käfer2016-01-111-2/+2
| | | | Follow up to a06f28ddb70cd1963076d6df2ef3716d45b7a13e
* [core] only cache successful or NotFound responsesKonstantin Käfer2016-01-082-0/+176
| | | | We don't want other types of error end up in our cache, since it'll likely evict perfectly good content.
* [core] don't consult cache for asset resourcesKonstantin Käfer2016-01-081-0/+42
|
* [tests] Sleep more than 1s before refreshing accessed timeThiago Marcos P. Santos2016-01-071-3/+11
| | | | | | | The cache `accessed` field resolution is 1s, so we need to sleep a little bit more in order to make sure that the cache entries we are refreshing will have a different `accessed` time than the other entries.
* [tests] Added utests for cache versioningThiago Marcos P. Santos2016-01-051-4/+38
|
* [test] terminate test server when stdin closesKonstantin Käfer2016-01-053-14/+15
|
* [test] Remove terminate-when-inactive behavior from the test serverJohn Firebaugh2016-01-041-13/+0
| | | | | | | It caused #3163. Attempts at having the child exit automatically when the parent exits were stymied by the fact that unix sucks: http://stackoverflow.com/q/284325/52207.
* [tests] Add unit tests for SQLiteCache size limitThiago Marcos P. Santos2015-12-281-0/+232
|
* [tests] Test with OnlineFileSourceJohn Firebaugh2015-12-2314-45/+45
| | | | | When we introduce OfflineFileSource, the behavior of existing tests should not change.
* [core] add namespace comment to closing braceKonstantin Käfer2015-12-031-1/+1
|
* [tests] Fix/improve Asset utestsThiago Marcos P. Santos2015-12-012-17/+90
| | | | | | ASSET=zip make test-* was broken and now works. Also added a test stressing concurrent file access.
* [core] Removed libuv dependency from AssetFSContextThiago Marcos P. Santos2015-12-012-2/+2
|
* [tests] Remove libuv dependency from the testsThiago Marcos P. Santos2015-12-0116-109/+76
|
* [core] Replace time_t with std::chrono::secondsBruno de Oliveira Abinader2015-11-2714-66/+76
| | | | | | | Added aliases for std::chrono typedefs (eg. 'Seconds' for std::chrono::seconds). These aliases are used together with templated helper functions to replace time_t with std::chrono::seconds for most cases, in particular for 'modified' and 'expires' values in Response.