| 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 {
|
|
|