[core] keep tiles renderable even if a subsequent error occurs
Since 9a9408e811, we marked tiles as non-renderable if an error occured. This lead to situations where a tile was loaded + parsed successfully, then a revalidation attempt occured (e.g. because the resource was stale) which failed. In this case, we used to mark the tile as non-renderable although we could've used the perfectly parsed (stale) resource.
This commit is contained in:
@@ -60,6 +60,20 @@ TEST(RasterTile, onParsed) {
|
||||
EXPECT_TRUE(tile.isRenderable());
|
||||
EXPECT_TRUE(tile.isLoaded());
|
||||
EXPECT_TRUE(tile.isComplete());
|
||||
|
||||
// Make sure that once we've had a renderable tile and then receive erroneous data, we retain
|
||||
// the previously rendered data and keep the tile renderable.
|
||||
tile.setError(std::make_exception_ptr(std::runtime_error("Connection offline")));
|
||||
EXPECT_TRUE(tile.isRenderable());
|
||||
EXPECT_TRUE(tile.isLoaded());
|
||||
EXPECT_TRUE(tile.isComplete());
|
||||
|
||||
// Then simulate a parsing failure and make sure that we keep it renderable in this situation
|
||||
// as well.
|
||||
tile.onError(std::make_exception_ptr(std::runtime_error("Parse error")), 0);
|
||||
ASSERT_TRUE(tile.isRenderable());
|
||||
EXPECT_TRUE(tile.isLoaded());
|
||||
EXPECT_TRUE(tile.isComplete());
|
||||
}
|
||||
|
||||
TEST(RasterTile, onParsedEmpty) {
|
||||
|
||||
Reference in New Issue
Block a user