| OLD | NEW |
| 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/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 3523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3534 MockWrite writes[] = { CreateMockWrite(*req) }; | 3534 MockWrite writes[] = { CreateMockWrite(*req) }; |
| 3535 | 3535 |
| 3536 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); | 3536 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); |
| 3537 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); | 3537 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); |
| 3538 MockRead reads[] = { | 3538 MockRead reads[] = { |
| 3539 CreateMockRead(*resp), | 3539 CreateMockRead(*resp), |
| 3540 CreateMockRead(*body), | 3540 CreateMockRead(*body), |
| 3541 MockRead(ASYNC, 0, 0) // EOF | 3541 MockRead(ASYNC, 0, 0) // EOF |
| 3542 }; | 3542 }; |
| 3543 | 3543 |
| 3544 net::CapturingBoundNetLog log(net::CapturingNetLog::kUnbounded); | 3544 CapturingBoundNetLog log; |
| 3545 | 3545 |
| 3546 scoped_ptr<DelayedSocketData> data( | 3546 scoped_ptr<DelayedSocketData> data( |
| 3547 new DelayedSocketData(1, reads, arraysize(reads), | 3547 new DelayedSocketData(1, reads, arraysize(reads), |
| 3548 writes, arraysize(writes))); | 3548 writes, arraysize(writes))); |
| 3549 NormalSpdyTransactionHelper helper(CreateGetRequestWithUserAgent(), | 3549 NormalSpdyTransactionHelper helper(CreateGetRequestWithUserAgent(), |
| 3550 log.bound(), GetParam(), NULL); | 3550 log.bound(), GetParam(), NULL); |
| 3551 helper.RunToCompletion(data.get()); | 3551 helper.RunToCompletion(data.get()); |
| 3552 TransactionHelperResult out = helper.output(); | 3552 TransactionHelperResult out = helper.output(); |
| 3553 EXPECT_EQ(OK, out.rv); | 3553 EXPECT_EQ(OK, out.rv); |
| 3554 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); | 3554 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); |
| (...skipping 2086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5641 // And now we can allow everything else to run to completion. | 5641 // And now we can allow everything else to run to completion. |
| 5642 data->SetStop(10); | 5642 data->SetStop(10); |
| 5643 data->Run(); | 5643 data->Run(); |
| 5644 EXPECT_EQ(OK, callback2.WaitForResult()); | 5644 EXPECT_EQ(OK, callback2.WaitForResult()); |
| 5645 EXPECT_EQ(OK, callback3.WaitForResult()); | 5645 EXPECT_EQ(OK, callback3.WaitForResult()); |
| 5646 | 5646 |
| 5647 helper.VerifyDataConsumed(); | 5647 helper.VerifyDataConsumed(); |
| 5648 } | 5648 } |
| 5649 | 5649 |
| 5650 } // namespace net | 5650 } // namespace net |
| OLD | NEW |