summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2019-05-24 17:47:27 +0300
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2019-05-28 16:30:49 +0300
commitcc26ef17d52367a768a134140c6c95cb2b880733 (patch)
treee61b3b464273b7950ee0d74b8a7e39bcc845ed93 /test
parent2f97a2660ada44cd18f2e02b4de4eb42cfcb07b1 (diff)
downloadqtlocation-mapboxgl-cc26ef17d52367a768a134140c6c95cb2b880733.tar.gz
[core] Introduce usage tag for resources
Make the distinction if a resource is being requested for offline usage or if it will be used immediately. Fixes #14746
Diffstat (limited to 'test')
-rw-r--r--test/storage/offline_download.test.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/storage/offline_download.test.cpp b/test/storage/offline_download.test.cpp
index 68f8ea2484..9cdafaaf1e 100644
--- a/test/storage/offline_download.test.cpp
+++ b/test/storage/offline_download.test.cpp
@@ -740,7 +740,7 @@ TEST(OfflineDownload, Deactivate) {
}
-TEST(OfflineDownload, AllOfflineRequestsHaveLowPriority) {
+TEST(OfflineDownload, AllOfflineRequestsHaveLowPriorityAndOfflineUsage) {
OfflineTest test;
auto region = test.createRegion();
ASSERT_TRUE(region);
@@ -751,36 +751,43 @@ TEST(OfflineDownload, AllOfflineRequestsHaveLowPriority) {
test.fileSource.styleResponse = [&] (const Resource& resource) {
EXPECT_TRUE(resource.priority == Resource::Priority::Low);
+ EXPECT_TRUE(resource.usage == Resource::Usage::Offline);
return test.response("style.json");
};
test.fileSource.spriteImageResponse = [&] (const Resource& resource) {
EXPECT_TRUE(resource.priority == Resource::Priority::Low);
+ EXPECT_TRUE(resource.usage == Resource::Usage::Offline);
return test.response("sprite.png");
};
test.fileSource.imageResponse = [&] (const Resource& resource) {
EXPECT_TRUE(resource.priority == Resource::Priority::Low);
+ EXPECT_TRUE(resource.usage == Resource::Usage::Offline);
return test.response("radar.gif");
};
test.fileSource.spriteJSONResponse = [&] (const Resource& resource) {
EXPECT_TRUE(resource.priority == Resource::Priority::Low);
+ EXPECT_TRUE(resource.usage == Resource::Usage::Offline);
return test.response("sprite.json");
};
test.fileSource.glyphsResponse = [&] (const Resource& resource) {
EXPECT_TRUE(resource.priority == Resource::Priority::Low);
+ EXPECT_TRUE(resource.usage == Resource::Usage::Offline);
return test.response("glyph.pbf");
};
test.fileSource.sourceResponse = [&] (const Resource& resource) {
EXPECT_TRUE(resource.priority == Resource::Priority::Low);
+ EXPECT_TRUE(resource.usage == Resource::Usage::Offline);
return test.response("streets.json");
};
test.fileSource.tileResponse = [&] (const Resource& resource) {
EXPECT_TRUE(resource.priority == Resource::Priority::Low);
+ EXPECT_TRUE(resource.usage == Resource::Usage::Offline);
return test.response("0-0-0.vector.pbf");
};