| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "blimp/net/blimp_connection.h" | 5 #include "blimp/net/blimp_connection.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 EXPECT_CALL(*writer_, | 143 EXPECT_CALL(*writer_, |
| 144 WritePacket(BufferEqualsProto(*CreateInputMessage()), _)) | 144 WritePacket(BufferEqualsProto(*CreateInputMessage()), _)) |
| 145 .WillOnce(SaveArg<1>(&write_packet_cb)) | 145 .WillOnce(SaveArg<1>(&write_packet_cb)) |
| 146 .RetiresOnSaturation(); | 146 .RetiresOnSaturation(); |
| 147 EXPECT_CALL(error_observer1_, OnConnectionError(net::ERR_FAILED)) | 147 EXPECT_CALL(error_observer1_, OnConnectionError(net::ERR_FAILED)) |
| 148 .WillOnce(testing::InvokeWithoutArgs( | 148 .WillOnce(testing::InvokeWithoutArgs( |
| 149 this, &BlimpConnectionTest::DropConnection)); | 149 this, &BlimpConnectionTest::DropConnection)); |
| 150 | 150 |
| 151 BlimpMessageProcessor* sender = connection_->GetOutgoingMessageProcessor(); | 151 BlimpMessageProcessor* sender = connection_->GetOutgoingMessageProcessor(); |
| 152 net::TestCompletionCallback complete_cb_1; | 152 net::TestCompletionCallback complete_cb_1; |
| 153 sender->ProcessMessage(CreateInputMessage(), | 153 sender->ProcessMessage(CreateInputMessage(), complete_cb_1.callback()); |
| 154 complete_cb_1.callback()); | |
| 155 base::ResetAndReturn(&write_packet_cb).Run(net::ERR_FAILED); | 154 base::ResetAndReturn(&write_packet_cb).Run(net::ERR_FAILED); |
| 156 EXPECT_EQ(net::ERR_FAILED, complete_cb_1.WaitForResult()); | 155 EXPECT_EQ(net::ERR_FAILED, complete_cb_1.WaitForResult()); |
| 157 } | 156 } |
| 158 | 157 |
| 159 } // namespace | 158 } // namespace |
| 160 } // namespace blimp | 159 } // namespace blimp |
| OLD | NEW |