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 |