[ios] [android] Use Response::NotFound in other HTTP implementations too
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user