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

Side by Side Diff: net/spdy/spdy_test_utils.h

Issue 2492993002: Server push cancellation: Use TestPushDelegate in QuicChromiumClientSessionTest to cancel push. (Closed)
Patch Set: rebase Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « net/spdy/spdy_session_unittest.cc ('k') | net/spdy/spdy_test_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef NET_SPDY_SPDY_TEST_UTILS_H_ 5 #ifndef NET_SPDY_SPDY_TEST_UTILS_H_
6 #define NET_SPDY_SPDY_TEST_UTILS_H_ 6 #define NET_SPDY_SPDY_TEST_UTILS_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <string> 11 #include <string>
12 12
13 #include "base/strings/string_piece.h" 13 #include "base/strings/string_piece.h"
14 #include "net/spdy/server_push_delegate.h"
14 #include "net/spdy/spdy_bug_tracker.h" 15 #include "net/spdy/spdy_bug_tracker.h"
15 #include "net/spdy/spdy_header_block.h" 16 #include "net/spdy/spdy_header_block.h"
16 #include "net/spdy/spdy_headers_handler_interface.h" 17 #include "net/spdy/spdy_headers_handler_interface.h"
17 #include "net/spdy/spdy_protocol.h" 18 #include "net/spdy/spdy_protocol.h"
18 #include "net/test/gtest_util.h" 19 #include "net/test/gtest_util.h"
19 20
20 #define EXPECT_SPDY_BUG EXPECT_DFATAL 21 #define EXPECT_SPDY_BUG EXPECT_DFATAL
21 22
22 namespace net { 23 namespace net {
23 24
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 const SpdyHeaderBlock& decoded_block() const { return block_; } 83 const SpdyHeaderBlock& decoded_block() const { return block_; }
83 size_t header_bytes_parsed() { return header_bytes_parsed_; } 84 size_t header_bytes_parsed() { return header_bytes_parsed_; }
84 85
85 private: 86 private:
86 SpdyHeaderBlock block_; 87 SpdyHeaderBlock block_;
87 size_t header_bytes_parsed_; 88 size_t header_bytes_parsed_;
88 89
89 DISALLOW_COPY_AND_ASSIGN(TestHeadersHandler); 90 DISALLOW_COPY_AND_ASSIGN(TestHeadersHandler);
90 }; 91 };
91 92
93 // A test implementation of ServerPushDelegate that caches all the pushed
94 // request and provides a interface to cancel the push given url.
95 class TestServerPushDelegate : public ServerPushDelegate {
96 public:
97 explicit TestServerPushDelegate();
98 ~TestServerPushDelegate() override;
99
100 void OnPush(std::unique_ptr<ServerPushHelper> push_helper) override;
101
102 bool CancelPush(GURL url);
103
104 private:
105 std::map<GURL, std::unique_ptr<ServerPushHelper>> push_helpers;
106 };
107
92 } // namespace test 108 } // namespace test
93 } // namespace net 109 } // namespace net
94 110
95 #endif // NET_SPDY_SPDY_TEST_UTILS_H_ 111 #endif // NET_SPDY_SPDY_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « net/spdy/spdy_session_unittest.cc ('k') | net/spdy/spdy_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698