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

Unified Diff: net/spdy/spdy_session_unittest.cc

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/quic/chromium/quic_chromium_client_session_test.cc ('k') | net/spdy/spdy_test_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session_unittest.cc
diff --git a/net/spdy/spdy_session_unittest.cc b/net/spdy/spdy_session_unittest.cc
index cf9058d60610a226c3f180e9d1f37f331a1a65ad..c51e0c2ff0c15e6a7e0b94f4fc416fd6fb0701f7 100644
--- a/net/spdy/spdy_session_unittest.cc
+++ b/net/spdy/spdy_session_unittest.cc
@@ -43,6 +43,7 @@
using net::test::IsError;
using net::test::IsOk;
+using net::test::TestServerPushDelegate;
namespace net {
@@ -78,28 +79,6 @@ class MockRequireCTDelegate : public TransportSecurityState::RequireCTDelegate {
CTRequirementLevel(const std::string& host));
};
-class TestServerPushDelegate : public ServerPushDelegate {
- public:
- explicit TestServerPushDelegate() {}
-
- void OnPush(std::unique_ptr<ServerPushHelper> push_helper) override {
- push_helpers[push_helper->GetURL()] = std::move(push_helper);
- }
-
- bool CancelPush(GURL url) {
- auto itr = push_helpers.find(url);
- if (itr == push_helpers.end())
- return false;
-
- itr->second->Cancel();
- push_helpers.erase(itr);
- return true;
- }
-
- private:
- std::map<GURL, std::unique_ptr<ServerPushHelper>> push_helpers;
-};
-
} // namespace
class SpdySessionTest : public PlatformTest {
« no previous file with comments | « net/quic/chromium/quic_chromium_client_session_test.cc ('k') | net/spdy/spdy_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698