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