Commit Graph

11 Commits

Author SHA1 Message Date
John Firebaugh
7b39ce9521 [core] Remove ThreadContext::getFileSource; instead thread FileSource through 2016-02-18 15:15:24 -08:00
John Firebaugh
19aa090bdc [tests] Don't call the callback for cancelled responses
StubFileSource gets an optional Response return type. Returning null means "cancelled; don't call the callback".

Fixes #3784
2016-02-04 13:18:14 -08:00
John Firebaugh
716997b99e [tests] Refactor and make MockFileSource more general
Now it works more like StubStyleObserver: you can assign std::functions to specific slots based on resource type.

Rewrite resource loading tests in that style, making them less like integration tests of Style and more like unit tests of Source, GlyphStore, and SpriteStore.
2016-02-01 15:29:42 -08:00
Konstantin Käfer
a88e58ef3a [core] use stale glyphs
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.
2016-01-15 17:04:08 +01:00
John Firebaugh
845699e698 [tests] Simplify MockFileSource 2015-12-24 08:17:42 -08:00
John Firebaugh
338f94e7ed [tests] Rewrite {Sprite,Glyph}Store tests in the style of ResourceLoading 2015-12-24 08:17:42 -08:00
John Firebaugh
16de579d7c [core] Rationalize error handling for resource loading
* Standardize on std::exception_ptr as the error representation
  (fixes #2854).
* Don't format textual strings at the error source; pass on the
  constituent data via observer method parameters instead.
* Use the null object pattern to simplify observer notification code.
* Further refactoring for ResourceLoading tests.
2015-12-23 12:50:42 -08:00
Konstantin Käfer
478472e501 [core] add std::move to constructors 2015-12-03 15:38:36 +01:00
Thiago Marcos P. Santos
cb06526b10 [tests] Remove libuv dependency from the tests 2015-12-01 11:49:02 +02:00
Thiago Marcos P. Santos
234a653931 Use the observer pattern for GlyphPBF loading
This will make the code a lot more clear and it will
also move how parsing is initiated to the GlyphPBF
class, to be initiated after the request, like we do
for other resources.
2015-07-17 21:00:34 +03:00
Thiago Marcos P. Santos
cd2c1200c8 Add GlyphStore unit tests 2015-07-16 19:38:39 +03:00