Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3419)

Unified Diff: chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc

Issue 2190463008: Add an error page for HTTP 404 error pages without bodies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moar... fixes... Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc
diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc
index 6654a0e00d6d8e5df8c2df47e88a12b296546ca7..0ebeb692eb59b5c3529f0fb9de61128a81265b5d 100644
--- a/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc
+++ b/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc
@@ -330,11 +330,26 @@ class TestResourceDispatcherHostDelegate
DISALLOW_COPY_AND_ASSIGN(TestResourceDispatcherHostDelegate);
};
+// Handles requests for URLs with paths of "/test*" sent to the test server, so
+// tests request a URL that receives a non-error response.
+std::unqiue_ptr<net::test_server::HttpResponse> HandleTestRequest(
+ const net::test_server::HttpRequest& request) {
+ if (!base::StartsWithASCII(request.relative_url, "/test"))
+ return nullptr;
+ std::unique_ptr<net::test_server::BasicHttpResponse> response(
+ new net::test_server::BasicHttpResponse());
+ response->set_content("This space intentionally left blank.");
+ return std::move(response);
+}
+
} // namespace
class WebNavigationApiTest : public ExtensionApiTest {
public:
- WebNavigationApiTest() {}
+ WebNavigationApiTest() {
+ embedded_test_server()->RegisterRequestHandler(
+ base::Bind(&HandleTestRequest));
+ }
~WebNavigationApiTest() override {}
void SetUpInProcessBrowserTestFixture() override {

Powered by Google App Engine
This is Rietveld 408576698