| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "google_apis/gcm/engine/connection_handler_impl.h" | 5 #include "google_apis/gcm/engine/connection_handler_impl.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 const WriteList& write_list) { | 202 const WriteList& write_list) { |
| 203 mock_reads_ = read_list; | 203 mock_reads_ = read_list; |
| 204 mock_writes_ = write_list; | 204 mock_writes_ = write_list; |
| 205 data_provider_.reset( | 205 data_provider_.reset( |
| 206 new net::StaticSocketDataProvider( | 206 new net::StaticSocketDataProvider( |
| 207 &(mock_reads_[0]), mock_reads_.size(), | 207 &(mock_reads_[0]), mock_reads_.size(), |
| 208 &(mock_writes_[0]), mock_writes_.size())); | 208 &(mock_writes_[0]), mock_writes_.size())); |
| 209 socket_factory_.AddSocketDataProvider(data_provider_.get()); | 209 socket_factory_.AddSocketDataProvider(data_provider_.get()); |
| 210 | 210 |
| 211 socket_ = socket_factory_.CreateTransportClientSocket( | 211 socket_ = socket_factory_.CreateTransportClientSocket( |
| 212 address_list_, NULL, net::NetLog::Source()); | 212 address_list_, NULL, NULL, net::NetLog::Source()); |
| 213 socket_->Connect(net::CompletionCallback()); | 213 socket_->Connect(net::CompletionCallback()); |
| 214 | 214 |
| 215 run_loop_.reset(new base::RunLoop()); | 215 run_loop_.reset(new base::RunLoop()); |
| 216 PumpLoop(); | 216 PumpLoop(); |
| 217 | 217 |
| 218 DCHECK(socket_->IsConnected()); | 218 DCHECK(socket_->IsConnected()); |
| 219 return socket_.get(); | 219 return socket_.get(); |
| 220 } | 220 } |
| 221 | 221 |
| 222 void GCMConnectionHandlerImplTest::PumpLoop() { | 222 void GCMConnectionHandlerImplTest::PumpLoop() { |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 WaitForMessage(); // The login send. | 902 WaitForMessage(); // The login send. |
| 903 WaitForMessage(); // The login response. | 903 WaitForMessage(); // The login response. |
| 904 received_message.reset(); | 904 received_message.reset(); |
| 905 WaitForMessage(); // The invalid message. | 905 WaitForMessage(); // The invalid message. |
| 906 EXPECT_FALSE(received_message.get()); | 906 EXPECT_FALSE(received_message.get()); |
| 907 EXPECT_EQ(net::ERR_FAILED, last_error()); | 907 EXPECT_EQ(net::ERR_FAILED, last_error()); |
| 908 } | 908 } |
| 909 | 909 |
| 910 } // namespace | 910 } // namespace |
| 911 } // namespace gcm | 911 } // namespace gcm |
| OLD | NEW |