| 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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 gcm_client_->registrations_[app_id] = registration; | 442 gcm_client_->registrations_[app_id] = registration; |
| 443 } | 443 } |
| 444 | 444 |
| 445 void GCMClientImplTest::InitializeGCMClient() { | 445 void GCMClientImplTest::InitializeGCMClient() { |
| 446 clock()->Advance(base::TimeDelta::FromMilliseconds(1)); | 446 clock()->Advance(base::TimeDelta::FromMilliseconds(1)); |
| 447 | 447 |
| 448 // Actual initialization. | 448 // Actual initialization. |
| 449 GCMClient::ChromeBuildInfo chrome_build_info; | 449 GCMClient::ChromeBuildInfo chrome_build_info; |
| 450 gcm_client_->Initialize(chrome_build_info, | 450 gcm_client_->Initialize(chrome_build_info, |
| 451 temp_directory_.path(), | 451 temp_directory_.path(), |
| 452 std::vector<std::string>(), | |
| 453 message_loop_.message_loop_proxy(), | 452 message_loop_.message_loop_proxy(), |
| 454 url_request_context_getter_, | 453 url_request_context_getter_, |
| 455 make_scoped_ptr<Encryptor>(new FakeEncryptor), | 454 make_scoped_ptr<Encryptor>(new FakeEncryptor), |
| 456 this); | 455 this); |
| 457 } | 456 } |
| 458 | 457 |
| 459 void GCMClientImplTest::StartGCMClient() { | 458 void GCMClientImplTest::StartGCMClient() { |
| 460 // Start loading and check-in. | 459 // Start loading and check-in. |
| 461 gcm_client_->Start(); | 460 gcm_client_->Start(); |
| 462 | 461 |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 TEST_F(GCMClientImplStartAndStopTest, StartStopAndRestartImmediately) { | 830 TEST_F(GCMClientImplStartAndStopTest, StartStopAndRestartImmediately) { |
| 832 // Start the GCM and then stop and restart it immediately. | 831 // Start the GCM and then stop and restart it immediately. |
| 833 gcm_client()->Start(); | 832 gcm_client()->Start(); |
| 834 gcm_client()->Stop(); | 833 gcm_client()->Stop(); |
| 835 gcm_client()->Start(); | 834 gcm_client()->Start(); |
| 836 | 835 |
| 837 PumpLoopUntilIdle(); | 836 PumpLoopUntilIdle(); |
| 838 } | 837 } |
| 839 | 838 |
| 840 } // namespace gcm | 839 } // namespace gcm |
| OLD | NEW |