forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_protocol_handler.h
35 lines (25 loc) · 1 KB
/
test_protocol_handler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef HEADLESS_TEST_TEST_PROTOCOL_HANDLER_H_
#define HEADLESS_TEST_TEST_PROTOCOL_HANDLER_H_
#include "net/http/http_request_headers.h"
#include "net/url_request/url_request_job_factory.h"
namespace headless {
class TestProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler {
public:
TestProtocolHandler(const std::string& body);
~TestProtocolHandler() override {}
net::URLRequestJob* MaybeCreateJob(
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const override;
const net::HttpRequestHeaders& last_http_request_headers() const {
return last_http_request_headers_;
}
private:
mutable net::HttpRequestHeaders last_http_request_headers_;
std::string body_;
DISALLOW_COPY_AND_ASSIGN(TestProtocolHandler);
};
} // namespace headless
#endif // HEADLESS_TEST_TEST_PROTOCOL_HANDLER_H_