Commit Graph

18 Commits

Author SHA1 Message Date
Thiago Marcos P. Santos
f854368f29 [tests] Mark some tests as requiring server
Otherwise they will fail on iOS with connection error.

Fixex #4434
2016-03-23 09:53:08 -07:00
Konstantin Käfer
c587eefbb1 [ios] make unit tests work on iOS and iOS Simulator 2016-03-22 11:56:01 -07:00
Thiago Marcos P. Santos
aaf9e8256f [tests] Add utest for NetworkStatus::Online/Offline 2016-03-08 10:31:01 -03:00
Thiago Marcos P. Santos
c51c0d5db2 [tests] Timer is not needed to keep the main loop alive
The loop will be alive until `.stop()` is called.
2016-02-22 09:21:51 +02:00
John Firebaugh
dbb8e58aea [core] Moving caching logic to DefaultFileSource
This results in OnlineFileSource containing precisely the logic we want for reuse by OfflineFileSource, and no more.
2016-02-10 15:40:20 -08:00
Bruno de Oliveira Abinader
2f86467586 Cleanup std::chrono usage
Use mbgl::Duration and mbgl::{,Milli}Seconds whenever possible.
2016-01-25 15:11:18 +02:00
John Firebaugh
1c21d0fd4c [core] Use better types for modified / expires / etag 2016-01-21 11:22:11 -08:00
John Firebaugh
c33ed50c98 [core] Eliminate Response::stale and inline Response::isExpired()
Response::isExpired() had subtle and potentially confusing behavior around Seconds::zero(). It's best to inline it and comment why.
2016-01-21 11:22:11 -08:00
John Firebaugh
7a6076ea9d [tests] Test with OnlineFileSource
When we introduce OfflineFileSource, the behavior of existing tests should
not change.
2015-12-23 14:55:12 -08:00
Thiago Marcos P. Santos
cb06526b10 [tests] Remove libuv dependency from the tests 2015-12-01 11:49:02 +02:00
Bruno de Oliveira Abinader
31fd2822f5 [core] Replace time_t with std::chrono::seconds
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.
2015-11-27 17:47:02 +02:00
John Firebaugh
7137239cbd [core] Use std::unique_ptr for FileSource request 2015-11-16 12:25:47 -08:00
John Firebaugh
1caf89c32b [core] Pass a value to response callback, not a reference 2015-11-16 12:25:47 -08:00
Thiago Marcos P. Santos
36581f3d30 [core] Do not pass uv_loop_t around
This should be abstracted by util::RunLoop
2015-11-16 12:25:47 -08:00
Konstantin Käfer
04273fbb1c [core] Make DefaultFileSource react to all NetworkStatus changes 2015-11-02 17:25:08 +01:00
Konstantin Käfer
4d5c6333be [core] move retry logic to DefaultFileSource 2015-11-02 17:24:40 +01:00
John Firebaugh
4ef2bcc01a Don't create libuv objects on the stack 2015-10-27 17:49:10 -07:00
Konstantin Käfer
32c0fb468f [http] don't retry when there's already a request in progress 2015-10-27 12:11:16 +01:00