OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/gcm_driver/gcm_client_impl.h" | 5 #include "components/gcm_driver/gcm_client_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 } | 464 } |
465 | 465 |
466 void GCMClientImplTest::StartGCMClient() { | 466 void GCMClientImplTest::StartGCMClient() { |
467 // Start loading and check-in. | 467 // Start loading and check-in. |
468 gcm_client_->Start(); | 468 gcm_client_->Start(); |
469 | 469 |
470 PumpLoopUntilIdle(); | 470 PumpLoopUntilIdle(); |
471 } | 471 } |
472 | 472 |
473 void GCMClientImplTest::ReceiveMessageFromMCS(const MCSMessage& message) { | 473 void GCMClientImplTest::ReceiveMessageFromMCS(const MCSMessage& message) { |
| 474 gcm_client_->recorder_.RecordConnectionInitiated(std::string()); |
| 475 gcm_client_->recorder_.RecordConnectionSuccess(); |
474 gcm_client_->OnMessageReceivedFromMCS(message); | 476 gcm_client_->OnMessageReceivedFromMCS(message); |
475 } | 477 } |
476 | 478 |
477 void GCMClientImplTest::OnGCMReady() { | 479 void GCMClientImplTest::OnGCMReady() { |
478 last_event_ = LOADING_COMPLETED; | 480 last_event_ = LOADING_COMPLETED; |
479 QuitLoop(); | 481 QuitLoop(); |
480 } | 482 } |
481 | 483 |
482 void GCMClientImplTest::OnMessageReceived( | 484 void GCMClientImplTest::OnMessageReceived( |
483 const std::string& registration_id, | 485 const std::string& registration_id, |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 TEST_F(GCMClientImplStartAndStopTest, StartStopAndRestartImmediately) { | 973 TEST_F(GCMClientImplStartAndStopTest, StartStopAndRestartImmediately) { |
972 // Start the GCM and then stop and restart it immediately. | 974 // Start the GCM and then stop and restart it immediately. |
973 gcm_client()->Start(); | 975 gcm_client()->Start(); |
974 gcm_client()->Stop(); | 976 gcm_client()->Stop(); |
975 gcm_client()->Start(); | 977 gcm_client()->Start(); |
976 | 978 |
977 PumpLoopUntilIdle(); | 979 PumpLoopUntilIdle(); |
978 } | 980 } |
979 | 981 |
980 } // namespace gcm | 982 } // namespace gcm |
OLD | NEW |