diff options
author | Kirill Burtsev <kirill.burtsev@qt.io> | 2020-07-31 16:02:36 +0200 |
---|---|---|
committer | Kirill Burtsev <kirill.burtsev@qt.io> | 2020-08-31 10:04:32 +0200 |
commit | cb9e6a7d90035cd50e389f000df1a3103e312af0 (patch) | |
tree | 75b5bb8b3bf79c2ec6fc9bbcc88b29d111402d33 /tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp | |
parent | e30208ed4d8c2396f0a9c3330b9aefd6c7c91157 (diff) |
Simplify testing with HttpServer
Since reply with 404 for unknown resources is a common pattern in tests,
reply with it automatically for unhandled requests
Change-Id: Ifd184cf474f1ec311c8654dfbacdd735e33d7c97
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp')
-rw-r--r-- | tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp index 836f1885e..f4c0484eb 100644 --- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp +++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp @@ -202,10 +202,8 @@ private: QString path = rr->requestPath(); path.remove(0, 1); - if (rr->requestMethod() != "GET" || !resourceDir.exists(path)) - { - rr->setResponseStatus(404); - rr->sendResponse(); + if (rr->requestMethod() != "GET" || !resourceDir.exists(path)) { + rr->sendResponse(404); return; } |