| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 std::move(client_input_message), net::CompletionCallback()); | 202 std::move(client_input_message), net::CompletionCallback()); |
| 203 } | 203 } |
| 204 | 204 |
| 205 TEST_F(BrowserConnectionHandlerTest, ReconnectionAfterError) { | 205 TEST_F(BrowserConnectionHandlerTest, ReconnectionAfterError) { |
| 206 scoped_ptr<BlimpMessage> client_input_message = CreateInputMessage(1); | 206 scoped_ptr<BlimpMessage> client_input_message = CreateInputMessage(1); |
| 207 EXPECT_CALL( | 207 EXPECT_CALL( |
| 208 *(engine_input_feature_->incoming_message_processor()), | 208 *(engine_input_feature_->incoming_message_processor()), |
| 209 MockableProcessMessage(EqualsMessageIgnoringId(*client_input_message), _)) | 209 MockableProcessMessage(EqualsMessageIgnoringId(*client_input_message), _)) |
| 210 .RetiresOnSaturation(); | 210 .RetiresOnSaturation(); |
| 211 | 211 |
| 212 // Simulate a connection failure. |
| 212 client_connection_->error_observer()->OnConnectionError(net::ERR_FAILED); | 213 client_connection_->error_observer()->OnConnectionError(net::ERR_FAILED); |
| 214 engine_connection_->error_observer()->OnConnectionError(net::ERR_FAILED); |
| 215 |
| 213 // Message will be queued to be transmitted when the connection is | 216 // Message will be queued to be transmitted when the connection is |
| 214 // re-established. | 217 // re-established. |
| 215 client_input_feature_->outgoing_message_processor()->ProcessMessage( | 218 client_input_feature_->outgoing_message_processor()->ProcessMessage( |
| 216 std::move(client_input_message), net::CompletionCallback()); | 219 std::move(client_input_message), net::CompletionCallback()); |
| 217 | 220 |
| 218 // Simulates reconnection. | 221 // Simulates reconnection. |
| 219 SetupConnections(); | 222 SetupConnections(); |
| 220 } | 223 } |
| 221 | 224 |
| 222 } // namespace | 225 } // namespace |
| 223 } // namespace blimp | 226 } // namespace blimp |
| OLD | NEW |