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

Unified Diff: net/spdy/spdy_session_spdy2_unittest.cc

Issue 11415219: Move a number of static variables SPDY to HttpNetworkSession::Params. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix flip_in_mem_edsm_server Created 8 years 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_pool.cc ('k') | net/spdy/spdy_session_spdy3_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
« no previous file with comments | « net/spdy/spdy_session_pool.cc ('k') | net/spdy/spdy_session_spdy3_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698