summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2015-09-29 17:27:38 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-09-29 18:20:23 -0700
commit686c967c8ece2e3f09a06c2466096317e8fd649c (patch)
tree59954ae782f2bac3b87aa3d6ec86d2988ea3e49b /test
parent7112d436093d651ac0bdba4f9eaaf63e682b22a3 (diff)
downloadqtlocation-mapboxgl-686c967c8ece2e3f09a06c2466096317e8fd649c.tar.gz
[ios] [android] Use Response::NotFound in other HTTP implementations too
Diffstat (limited to 'test')
-rw-r--r--test/storage/http_reading.cpp16
-rwxr-xr-xtest/storage/server.js3
2 files changed, 17 insertions, 2 deletions
diff --git a/test/storage/http_reading.cpp b/test/storage/http_reading.cpp
index b322bbf2a7..78f69cae30 100644
--- a/test/storage/http_reading.cpp
+++ b/test/storage/http_reading.cpp
@@ -9,6 +9,7 @@
TEST_F(Storage, HTTPReading) {
SCOPED_TEST(HTTPTest)
SCOPED_TEST(HTTP404)
+ SCOPED_TEST(HTTP500)
using namespace mbgl;
@@ -31,14 +32,25 @@ TEST_F(Storage, HTTPReading) {
fs.request({ Resource::Unknown, "http://127.0.0.1:3000/doesnotexist" }, uv_default_loop(),
[&](const Response &res) {
EXPECT_EQ(uv_thread_self(), mainThread);
- EXPECT_EQ(Response::Error, res.status);
- EXPECT_EQ("HTTP status code 404", res.message);
+ EXPECT_EQ(Response::NotFound, res.status);
+ EXPECT_EQ("", res.message);
EXPECT_EQ(0, res.expires);
EXPECT_EQ(0, res.modified);
EXPECT_EQ("", res.etag);
HTTP404.finish();
});
+ fs.request({ Resource::Unknown, "http://127.0.0.1:3000/permanent-error" }, uv_default_loop(),
+ [&](const Response &res) {
+ EXPECT_EQ(uv_thread_self(), mainThread);
+ EXPECT_EQ(Response::Error, res.status);
+ EXPECT_EQ("HTTP status code 500", res.message);
+ EXPECT_EQ(0, res.expires);
+ EXPECT_EQ(0, res.modified);
+ EXPECT_EQ("", res.etag);
+ HTTP500.finish();
+ });
+
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
}
diff --git a/test/storage/server.js b/test/storage/server.js
index 9f6def9c0b..342a61cdc1 100755
--- a/test/storage/server.js
+++ b/test/storage/server.js
@@ -73,6 +73,9 @@ app.get('/revalidate-etag', function(req, res) {
revalidateEtagCounter++;
});
+app.get('/permanent-error', function(req, res) {
+ res.status(500).end();
+});
var temporaryErrorCounter = 0;
app.get('/temporary-error', function(req, res) {