summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-06-24 15:28:10 -0700
committerGitHub <noreply@github.com>2016-06-24 15:28:10 -0700
commitb8326870e1f3960b169746b0473326060bb6cf54 (patch)
tree0bdbb3215df1150d959b32bae51930cdf8570c5b
parent3d16cd088ffe8f0a07f6d4f1dd38ac2082cd3f38 (diff)
downloadqtlocation-mapboxgl-b8326870e1f3960b169746b0473326060bb6cf54.tar.gz
[core] Increment completedTileCount when appropriate (#5475)
-rw-r--r--platform/default/mbgl/storage/offline_download.cpp2
-rw-r--r--test/storage/offline_download.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/platform/default/mbgl/storage/offline_download.cpp b/platform/default/mbgl/storage/offline_download.cpp
index bad23cadbe..6ff605167a 100644
--- a/platform/default/mbgl/storage/offline_download.cpp
+++ b/platform/default/mbgl/storage/offline_download.cpp
@@ -240,6 +240,7 @@ void OfflineDownload::ensureResource(const Resource& resource, std::function<voi
status.completedResourceCount++;
status.completedResourceSize += offlineResponse->second;
if (resource.kind == Resource::Kind::Tile) {
+ status.completedTileCount += 1;
status.completedTileSize += offlineResponse->second;
}
@@ -273,6 +274,7 @@ void OfflineDownload::ensureResource(const Resource& resource, std::function<voi
uint64_t resourceSize = offlineDatabase.putRegionResource(id, resource, onlineResponse);
status.completedResourceSize += resourceSize;
if (resource.kind == Resource::Kind::Tile) {
+ status.completedTileCount += 1;
status.completedTileSize += resourceSize;
}
diff --git a/test/storage/offline_download.cpp b/test/storage/offline_download.cpp
index 07218edaff..eb676e3b8d 100644
--- a/test/storage/offline_download.cpp
+++ b/test/storage/offline_download.cpp
@@ -226,6 +226,8 @@ TEST(OfflineDownload, Activate) {
EXPECT_EQ(status.requiredResourceCount, computedStatus.requiredResourceCount);
EXPECT_EQ(status.completedResourceCount, computedStatus.completedResourceCount);
EXPECT_EQ(status.completedResourceSize, computedStatus.completedResourceSize);
+ EXPECT_EQ(status.completedTileCount, computedStatus.completedTileCount);
+ EXPECT_EQ(status.completedTileSize, computedStatus.completedTileSize);
EXPECT_TRUE(status.requiredResourceCountIsPrecise);
test.loop.stop();