OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/logging.h" | 5 #include "base/logging.h" |
6 #include "base/macros.h" | 6 #include "base/macros.h" |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/test/fuzzed_data_provider.h" | 9 #include "base/test/fuzzed_data_provider.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
11 #include "net/base/request_priority.h" | 11 #include "net/base/request_priority.h" |
12 #include "net/log/net_log_source.h" | 12 #include "net/log/net_log_source.h" |
13 #include "net/log/test_net_log.h" | 13 #include "net/log/test_net_log.h" |
14 #include "net/socket/fuzzed_socket_factory.h" | 14 #include "net/socket/fuzzed_socket_factory.h" |
15 #include "net/spdy/spdy_test_util_common.h" | 15 #include "net/spdy/chromium/spdy_test_util_common.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 class FuzzerDelegate : public net::SpdyStream::Delegate { | 19 class FuzzerDelegate : public net::SpdyStream::Delegate { |
20 public: | 20 public: |
21 explicit FuzzerDelegate(const base::Closure& done_closure) | 21 explicit FuzzerDelegate(const base::Closure& done_closure) |
22 : done_closure_(done_closure) {} | 22 : done_closure_(done_closure) {} |
23 | 23 |
24 void OnHeadersSent() override {} | 24 void OnHeadersSent() override {} |
25 void OnHeadersReceived( | 25 void OnHeadersReceived( |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 base::RunLoop run_loop; | 87 base::RunLoop run_loop; |
88 FuzzerDelegate delegate(run_loop.QuitClosure()); | 88 FuzzerDelegate delegate(run_loop.QuitClosure()); |
89 stream->SetDelegate(&delegate); | 89 stream->SetDelegate(&delegate); |
90 run_loop.Run(); | 90 run_loop.Run(); |
91 | 91 |
92 // Give a chance for GOING_AWAY sessions to wrap up. | 92 // Give a chance for GOING_AWAY sessions to wrap up. |
93 base::RunLoop().RunUntilIdle(); | 93 base::RunLoop().RunUntilIdle(); |
94 | 94 |
95 return 0; | 95 return 0; |
96 } | 96 } |
OLD | NEW |