1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CONTENT_PUBLIC_TEST_SLOW_DOWNLOAD_HTTP_RESPONSE_H_
6 #define CONTENT_PUBLIC_TEST_SLOW_DOWNLOAD_HTTP_RESPONSE_H_
7 
8 #include "content/public/test/slow_http_response.h"
9 
10 namespace content {
11 
12 // A subclass of SlowHttpResponse that serves a download.
13 class SlowDownloadHttpResponse : public SlowHttpResponse {
14  public:
15   // Test URLs.
16   static const char kUnknownSizeUrl[];
17   static const char kKnownSizeUrl[];
18 
19   static std::unique_ptr<net::test_server::HttpResponse>
20   HandleSlowDownloadRequest(const net::test_server::HttpRequest& request);
21 
22   SlowDownloadHttpResponse(const std::string& url);
23   ~SlowDownloadHttpResponse() override;
24 
25   SlowDownloadHttpResponse(const SlowDownloadHttpResponse&) = delete;
26   SlowDownloadHttpResponse& operator=(const SlowDownloadHttpResponse&) = delete;
27 
28   // SlowHttpResponse:
29   bool IsHandledUrl() override;
30   void AddResponseHeaders(std::string* response) override;
31 };
32 
33 }  // namespace content
34 
35 #endif  // CONTENT_PUBLIC_TEST_SLOW_DOWNLOAD_HTTP_RESPONSE_H_
36