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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_test_utils.h
diff --git a/net/spdy/spdy_test_utils.h b/net/spdy/spdy_test_utils.h
index 667169d5039629a576171d9e13e6bc54c2b0bfe7..8e68a49c43f5ebfa2f29783edcff3a21393628bb 100644
--- a/net/spdy/spdy_test_utils.h
+++ b/net/spdy/spdy_test_utils.h
@@ -11,6 +11,7 @@
#include <string>
#include "base/strings/string_piece.h"
+#include "net/spdy/server_push_delegate.h"
#include "net/spdy/spdy_bug_tracker.h"
#include "net/spdy/spdy_header_block.h"
#include "net/spdy/spdy_headers_handler_interface.h"
@@ -89,6 +90,21 @@ class TestHeadersHandler : public SpdyHeadersHandlerInterface {
DISALLOW_COPY_AND_ASSIGN(TestHeadersHandler);
};
+// A test implementation of ServerPushDelegate that caches all the pushed
+// request and provides a interface to cancel the push given url.
+class TestServerPushDelegate : public ServerPushDelegate {
+ public:
+ explicit TestServerPushDelegate();
+ ~TestServerPushDelegate() override;
+
+ void OnPush(std::unique_ptr<ServerPushHelper> push_helper) override;
+
+ bool CancelPush(GURL url);
+
+ private:
+ std::map<GURL, std::unique_ptr<ServerPushHelper>> push_helpers;
+};
+
} // namespace test
} // namespace net
« 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