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

Side by Side Diff: net/spdy/spdy_http_stream_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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/spdy/spdy_http_stream.h" 5 #include "net/spdy/spdy_http_stream.h"
6 6
7 #include "crypto/ec_private_key.h" 7 #include "crypto/ec_private_key.h"
8 #include "crypto/ec_signature_creator.h" 8 #include "crypto/ec_signature_creator.h"
9 #include "crypto/signature_creator.h" 9 #include "crypto/signature_creator.h"
10 #include "net/base/asn1_util.h" 10 #include "net/base/asn1_util.h"
(...skipping 10 matching lines...) Expand all
21 using namespace net::test_spdy2; 21 using namespace net::test_spdy2;
22 22
23 namespace net { 23 namespace net {
24 24
25 class SpdyHttpStreamSpdy2Test : public testing::Test { 25 class SpdyHttpStreamSpdy2Test : public testing::Test {
26 public: 26 public:
27 OrderedSocketData* data() { return data_.get(); } 27 OrderedSocketData* data() { return data_.get(); }
28 protected: 28 protected:
29 SpdyHttpStreamSpdy2Test() {} 29 SpdyHttpStreamSpdy2Test() {}
30 30
31 virtual void SetUp() {
32 SpdySession::set_default_protocol(kProtoSPDY2);
33 }
34
35 virtual void TearDown() { 31 virtual void TearDown() {
36 crypto::ECSignatureCreator::SetFactoryForTesting(NULL); 32 crypto::ECSignatureCreator::SetFactoryForTesting(NULL);
37 UploadDataStream::ResetMergeChunks(); 33 UploadDataStream::ResetMergeChunks();
38 MessageLoop::current()->RunUntilIdle(); 34 MessageLoop::current()->RunUntilIdle();
39 } 35 }
40 36
41 void set_merge_chunks(bool merge) { 37 void set_merge_chunks(bool merge) {
42 UploadDataStream::set_merge_chunks(merge); 38 UploadDataStream::set_merge_chunks(merge);
43 } 39 }
44 40
(...skipping 21 matching lines...) Expand all
66 BoundNetLog())); 62 BoundNetLog()));
67 EXPECT_EQ(OK, callback.WaitForResult()); 63 EXPECT_EQ(OK, callback.WaitForResult());
68 return session_->InitializeWithSocket(connection.release(), false, OK); 64 return session_->InitializeWithSocket(connection.release(), false, OK);
69 } 65 }
70 66
71 SpdySessionDependencies session_deps_; 67 SpdySessionDependencies session_deps_;
72 scoped_ptr<OrderedSocketData> data_; 68 scoped_ptr<OrderedSocketData> data_;
73 scoped_refptr<HttpNetworkSession> http_session_; 69 scoped_refptr<HttpNetworkSession> http_session_;
74 scoped_refptr<SpdySession> session_; 70 scoped_refptr<SpdySession> session_;
75 scoped_refptr<TransportSocketParams> transport_params_; 71 scoped_refptr<TransportSocketParams> transport_params_;
76
77 private:
78 SpdyTestStateHelper spdy_state_;
79 }; 72 };
80 73
81 TEST_F(SpdyHttpStreamSpdy2Test, SendRequest) { 74 TEST_F(SpdyHttpStreamSpdy2Test, SendRequest) {
82 scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); 75 scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST));
83 MockWrite writes[] = { 76 MockWrite writes[] = {
84 CreateMockWrite(*req.get(), 1), 77 CreateMockWrite(*req.get(), 1),
85 }; 78 };
86 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); 79 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1));
87 MockRead reads[] = { 80 MockRead reads[] = {
88 CreateMockRead(*resp, 2), 81 CreateMockRead(*resp, 2),
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 // pool anymore. 370 // pool anymore.
378 EXPECT_FALSE(http_session_->spdy_session_pool()->HasSession(pair)); 371 EXPECT_FALSE(http_session_->spdy_session_pool()->HasSession(pair));
379 EXPECT_TRUE(data()->at_read_eof()); 372 EXPECT_TRUE(data()->at_read_eof());
380 EXPECT_TRUE(data()->at_write_eof()); 373 EXPECT_TRUE(data()->at_write_eof());
381 } 374 }
382 375
383 // TODO(willchan): Write a longer test for SpdyStream that exercises all 376 // TODO(willchan): Write a longer test for SpdyStream that exercises all
384 // methods. 377 // methods.
385 378
386 } // namespace net 379 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_credential_builder_unittest.cc ('k') | net/spdy/spdy_http_stream_spdy3_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698