| Index: net/spdy/spdy_session_spdy2_unittest.cc
|
| diff --git a/net/spdy/spdy_session_spdy2_unittest.cc b/net/spdy/spdy_session_spdy2_unittest.cc
|
| index 636defe86b2e44e1a359173b27797322e5eb5b38..17c9c535948bc151e689d55be75d7dc6f3d13a35 100644
|
| --- a/net/spdy/spdy_session_spdy2_unittest.cc
|
| +++ b/net/spdy/spdy_session_spdy2_unittest.cc
|
| @@ -19,9 +19,9 @@ namespace net {
|
|
|
| namespace {
|
|
|
| -base::TimeTicks the_near_future() {
|
| - return base::TimeTicks::Now() +
|
| - base::TimeDelta::FromSeconds(301);
|
| +static int g_delta_seconds = 0;
|
| +base::TimeTicks TheNearFuture() {
|
| + return base::TimeTicks::Now() + base::TimeDelta::FromSeconds(g_delta_seconds);
|
| }
|
|
|
| class ClosingDelegate : public SpdyStream::Delegate {
|
| @@ -57,16 +57,11 @@ class ClosingDelegate : public SpdyStream::Delegate {
|
|
|
| } // namespace
|
|
|
| -// TODO(cbentzel): Expose compression setter/getter in public SpdySession
|
| -// interface rather than going through all these contortions.
|
| class SpdySessionSpdy2Test : public PlatformTest {
|
| protected:
|
| - virtual void SetUp() {
|
| - SpdySession::set_default_protocol(kProtoSPDY2);
|
| + void SetUp() {
|
| + g_delta_seconds = 0;
|
| }
|
| -
|
| - private:
|
| - SpdyTestStateHelper spdy_state_;
|
| };
|
|
|
| class TestSpdyStreamDelegate : public net::SpdyStream::Delegate {
|
| @@ -271,8 +266,6 @@ TEST_F(SpdySessionSpdy2Test, ClientPing) {
|
|
|
| base::TimeTicks before_ping_time = base::TimeTicks::Now();
|
|
|
| - // Enable sending of PING.
|
| - SpdySession::set_enable_ping_based_connection_checking(true);
|
| session->set_connection_at_risk_of_loss_time(base::TimeDelta::FromSeconds(0));
|
| session->set_hung_interval(base::TimeDelta::FromMilliseconds(50));
|
|
|
| @@ -372,6 +365,7 @@ TEST_F(SpdySessionSpdy2Test, DeleteExpiredPushStreams) {
|
|
|
| SSLSocketDataProvider ssl(SYNCHRONOUS, OK);
|
| session_deps.socket_factory->AddSSLSocketDataProvider(&ssl);
|
| + session_deps.time_func = TheNearFuture;
|
|
|
| scoped_refptr<HttpNetworkSession> http_session(
|
| SpdySessionDependencies::SpdyCreateSession(&session_deps));
|
| @@ -388,7 +382,7 @@ TEST_F(SpdySessionSpdy2Test, DeleteExpiredPushStreams) {
|
| EXPECT_TRUE(spdy_session_pool->HasSession(pair));
|
|
|
| // Give the session a SPDY2 framer.
|
| - session->buffered_spdy_framer_.reset(new BufferedSpdyFramer(2));
|
| + session->buffered_spdy_framer_.reset(new BufferedSpdyFramer(2, false));
|
|
|
| // Create the associated stream and add to active streams.
|
| scoped_ptr<SpdyHeaderBlock> request_headers(new SpdyHeaderBlock);
|
| @@ -412,7 +406,7 @@ TEST_F(SpdySessionSpdy2Test, DeleteExpiredPushStreams) {
|
| EXPECT_TRUE(session->unclaimed_pushed_streams_.end() != iter);
|
|
|
| // Shift time.
|
| - SpdySession::set_time_func(the_near_future);
|
| + g_delta_seconds = 301;
|
|
|
| headers["url"] = "http://www.google.com/b.dat";
|
| session->OnSynStream(4, 1, 0, 0, true, false, headers);
|
| @@ -490,8 +484,6 @@ TEST_F(SpdySessionSpdy2Test, FailedPing) {
|
| new TestSpdyStreamDelegate(callback1.callback()));
|
| spdy_stream1->SetDelegate(delegate.get());
|
|
|
| - // Enable sending of PING.
|
| - SpdySession::set_enable_ping_based_connection_checking(true);
|
| session->set_connection_at_risk_of_loss_time(base::TimeDelta::FromSeconds(0));
|
| session->set_hung_interval(base::TimeDelta::FromSeconds(0));
|
|
|
|
|