| 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 <memory> | 5 #include <memory> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 worker_pool->GetSequenceToken(), | 52 worker_pool->GetSequenceToken(), |
| 53 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); | 53 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); |
| 54 return base::WrapUnique(new gcm::GCMProfileService( | 54 return base::WrapUnique(new gcm::GCMProfileService( |
| 55 profile->GetPrefs(), profile->GetPath(), profile->GetRequestContext(), | 55 profile->GetPrefs(), profile->GetPath(), profile->GetRequestContext(), |
| 56 chrome::GetChannel(), | 56 chrome::GetChannel(), |
| 57 std::unique_ptr<ProfileIdentityProvider>(new ProfileIdentityProvider( | 57 std::unique_ptr<ProfileIdentityProvider>(new ProfileIdentityProvider( |
| 58 SigninManagerFactory::GetForProfile(profile), | 58 SigninManagerFactory::GetForProfile(profile), |
| 59 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), | 59 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), |
| 60 LoginUIServiceFactory::GetShowLoginPopupCallbackForProfile(profile))), | 60 LoginUIServiceFactory::GetShowLoginPopupCallbackForProfile(profile))), |
| 61 std::unique_ptr<gcm::GCMClientFactory>(new gcm::FakeGCMClientFactory( | 61 std::unique_ptr<gcm::GCMClientFactory>(new gcm::FakeGCMClientFactory( |
| 62 content::BrowserThread::GetMessageLoopProxyForThread( | 62 content::BrowserThread::GetTaskRunnerForThread( |
| 63 content::BrowserThread::UI), | 63 content::BrowserThread::UI), |
| 64 content::BrowserThread::GetMessageLoopProxyForThread( | 64 content::BrowserThread::GetTaskRunnerForThread( |
| 65 content::BrowserThread::IO))), | 65 content::BrowserThread::IO))), |
| 66 content::BrowserThread::GetMessageLoopProxyForThread( | 66 content::BrowserThread::GetTaskRunnerForThread( |
| 67 content::BrowserThread::UI), | 67 content::BrowserThread::UI), |
| 68 content::BrowserThread::GetMessageLoopProxyForThread( | 68 content::BrowserThread::GetTaskRunnerForThread( |
| 69 content::BrowserThread::IO), | 69 content::BrowserThread::IO), |
| 70 blocking_task_runner)); | 70 blocking_task_runner)); |
| 71 } | 71 } |
| 72 | 72 |
| 73 } // namespace | 73 } // namespace |
| 74 | 74 |
| 75 class GCMProfileServiceTest : public testing::Test { | 75 class GCMProfileServiceTest : public testing::Test { |
| 76 protected: | 76 protected: |
| 77 GCMProfileServiceTest(); | 77 GCMProfileServiceTest(); |
| 78 ~GCMProfileServiceTest() override; | 78 ~GCMProfileServiceTest() override; |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 OutgoingMessage message; | 242 OutgoingMessage message; |
| 243 message.id = "1"; | 243 message.id = "1"; |
| 244 message.data["key1"] = "value1"; | 244 message.data["key1"] = "value1"; |
| 245 SendAndWaitForCompletion(message); | 245 SendAndWaitForCompletion(message); |
| 246 | 246 |
| 247 EXPECT_EQ(message.id, send_message_id()); | 247 EXPECT_EQ(message.id, send_message_id()); |
| 248 EXPECT_EQ(GCMClient::SUCCESS, send_result()); | 248 EXPECT_EQ(GCMClient::SUCCESS, send_result()); |
| 249 } | 249 } |
| 250 | 250 |
| 251 } // namespace gcm | 251 } // namespace gcm |
| OLD | NEW |