summaryrefslogtreecommitdiff
path: root/test/storage/http_error.cpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-10-15 21:30:21 +0200
committerKonstantin Käfer <mail@kkaefer.com>2015-10-26 15:54:27 +0100
commit6a7334b882a47ca193209f2012843e42aa3ed4e2 (patch)
treef74bf484c4c53efaa657f524f8c8b01211e15b20 /test/storage/http_error.cpp
parent096a3edf39d23fbd4baa134938c16fed4f2e199c (diff)
downloadqtlocation-mapboxgl-6a7334b882a47ca193209f2012843e42aa3ed4e2.tar.gz
[core] add support for stale responses
We're now returning stale responses from cache. Those responses will have the `stale` flag set to true. Currently, all requesters in the core code discard stale responses, and cancel the request immediately after they got a non-stale response.
Diffstat (limited to 'test/storage/http_error.cpp')
-rw-r--r--test/storage/http_error.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/storage/http_error.cpp b/test/storage/http_error.cpp
index aebc75405d..50b46a41b8 100644
--- a/test/storage/http_error.cpp
+++ b/test/storage/http_error.cpp
@@ -37,6 +37,7 @@ TEST_F(Storage, HTTPError) {
EXPECT_LT(1, duration) << "Backoff timer didn't wait 1 second";
EXPECT_GT(1.2, duration) << "Backoff timer fired too late";
EXPECT_EQ(Response::Successful, res.status);
+ EXPECT_EQ(false, res.stale);
EXPECT_EQ("Hello World!", res.data);
EXPECT_EQ(0, res.expires);
EXPECT_EQ(0, res.modified);
@@ -54,6 +55,7 @@ TEST_F(Storage, HTTPError) {
EXPECT_LT(1.5, duration) << "Resource wasn't retried the correct number of times";
EXPECT_GT(1.7, duration) << "Resource wasn't retried the correct number of times";
EXPECT_EQ(Response::Error, res.status);
+ EXPECT_EQ(false, res.stale);
#ifdef MBGL_HTTP_NSURL
EXPECT_TRUE(res.message ==
"The operation couldn’t be completed. (NSURLErrorDomain error -1004.)" ||