| 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 "chrome/browser/services/gcm/gcm_profile_service.h" | 5 #include "chrome/browser/services/gcm/gcm_profile_service.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 14 #include "chrome/browser/services/gcm/fake_gcm_client_factory.h" | 14 #include "chrome/browser/services/gcm/fake_gcm_client_factory.h" |
| 15 #include "chrome/browser/services/gcm/fake_signin_manager.h" | 15 #include "chrome/browser/services/gcm/fake_signin_manager.h" |
| 16 #include "chrome/browser/services/gcm/gcm_client_factory.h" | |
| 17 #include "chrome/browser/services/gcm/gcm_client_mock.h" | 16 #include "chrome/browser/services/gcm/gcm_client_mock.h" |
| 18 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" | 17 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" |
| 19 #include "chrome/browser/signin/signin_manager_factory.h" | 18 #include "chrome/browser/signin/signin_manager_factory.h" |
| 20 #include "chrome/test/base/testing_profile.h" | 19 #include "chrome/test/base/testing_profile.h" |
| 20 #include "components/gcm_driver/gcm_client_factory.h" |
| 21 #include "components/user_prefs/pref_registry_syncable.h" | 21 #include "components/user_prefs/pref_registry_syncable.h" |
| 22 #include "content/public/browser/browser_context.h" | 22 #include "content/public/browser/browser_context.h" |
| 23 #include "content/public/test/test_browser_thread_bundle.h" | 23 #include "content/public/test/test_browser_thread_bundle.h" |
| 24 #include "google_apis/gcm/gcm_client.h" | 24 #include "google_apis/gcm/gcm_client.h" |
| 25 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
| 26 | 26 |
| 27 namespace gcm { | 27 namespace gcm { |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 // GCMClient should be checked in. | 181 // GCMClient should be checked in. |
| 182 EXPECT_TRUE(gcm_profile_service_->IsGCMClientReady()); | 182 EXPECT_TRUE(gcm_profile_service_->IsGCMClientReady()); |
| 183 EXPECT_EQ(GCMClientMock::STARTED, GetGCMClient()->status()); | 183 EXPECT_EQ(GCMClientMock::STARTED, GetGCMClient()->status()); |
| 184 | 184 |
| 185 // Sending should succeed. | 185 // Sending should succeed. |
| 186 EXPECT_EQ(message.id, send_message_id_); | 186 EXPECT_EQ(message.id, send_message_id_); |
| 187 EXPECT_EQ(GCMClient::SUCCESS, send_result_); | 187 EXPECT_EQ(GCMClient::SUCCESS, send_result_); |
| 188 } | 188 } |
| 189 | 189 |
| 190 } // namespace gcm | 190 } // namespace gcm |
| OLD | NEW |