Index: net/spdy/spdy_network_transaction_spdy2_unittest.cc |
=================================================================== |
--- net/spdy/spdy_network_transaction_spdy2_unittest.cc (revision 145640) |
+++ net/spdy/spdy_network_transaction_spdy2_unittest.cc (working copy) |
@@ -34,22 +34,29 @@ |
SPDYNOSSL, |
SPDYSSL, |
}; |
+ |
class SpdyNetworkTransactionSpdy2Test |
: public ::testing::TestWithParam<SpdyNetworkTransactionSpdy2TestTypes> { |
protected: |
virtual void SetUp() { |
SpdySession::set_default_protocol(kProtoSPDY2); |
+ merge_chunks_ = UploadDataStream::merge_chunks(); |
google_get_request_initialized_ = false; |
google_post_request_initialized_ = false; |
google_chunked_post_request_initialized_ = false; |
} |
virtual void TearDown() { |
+ UploadDataStream::set_merge_chunks(merge_chunks_); |
// Empty the current queue. |
MessageLoop::current()->RunAllPending(); |
} |
+ void set_merge_chunks(bool merge) { |
+ UploadDataStream::set_merge_chunks(merge); |
+ } |
+ |
struct TransactionHelperResult { |
int rv; |
std::string status_line; |
@@ -525,6 +532,7 @@ |
HttpRequestInfo google_chunked_post_request_; |
HttpRequestInfo google_get_push_request_; |
SpdyTestStateHelper spdy_state_; |
+ bool merge_chunks_; |
}; |
//----------------------------------------------------------------------------- |
@@ -1599,7 +1607,9 @@ |
// Test that a chunked POST works. |
TEST_P(SpdyNetworkTransactionSpdy2Test, ChunkedPost) { |
- UploadDataStream::set_merge_chunks(false); |
+ // TODO(satish): Remove this once we have a better way to unit test POST |
Ryan Hamilton
2012/07/09 17:52:02
satish?
ramant (doing other things)
2012/07/11 01:36:18
Done.
|
+ // requests with chunked uploads. |
+ set_merge_chunks(false); |
scoped_ptr<SpdyFrame> req(ConstructChunkedSpdyPost(NULL, 0)); |
scoped_ptr<SpdyFrame> chunk1(ConstructSpdyBodyFrame(1, false)); |
scoped_ptr<SpdyFrame> chunk2(ConstructSpdyBodyFrame(1, true)); |