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/gcm_driver.h" | 5 #include "components/gcm/gcm_driver.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 FakeGCMClient* GCMDriverTest::GetGCMClient() { | 185 FakeGCMClient* GCMDriverTest::GetGCMClient() { |
186 return static_cast<FakeGCMClient*>(driver_->GetGCMClientForTesting()); | 186 return static_cast<FakeGCMClient*>(driver_->GetGCMClientForTesting()); |
187 } | 187 } |
188 | 188 |
189 void GCMDriverTest::CreateDriver( | 189 void GCMDriverTest::CreateDriver( |
190 FakeGCMClient::LoadingDelay gcm_client_loading_delay) { | 190 FakeGCMClient::LoadingDelay gcm_client_loading_delay) { |
191 checkin_proto::ChromeBuildProto chrome_build_proto; | 191 checkin_proto::ChromeBuildProto chrome_build_proto; |
192 | 192 |
193 scoped_refptr<net::URLRequestContextGetter> request_context = | 193 scoped_refptr<net::URLRequestContextGetter> request_context = |
194 new net::TestURLRequestContextGetter(io_thread_.message_loop_proxy()); | 194 new net::TestURLRequestContextGetter(io_thread_.message_loop_proxy()); |
195 driver_.reset(new GCMDriver( | 195 driver_.reset(new GCMDriverDesktop( |
196 chrome_build_proto, | 196 chrome_build_proto, |
197 scoped_ptr<GCMClientFactory>(new FakeGCMClientFactory( | 197 scoped_ptr<GCMClientFactory>(new FakeGCMClientFactory( |
198 gcm_client_loading_delay, | 198 gcm_client_loading_delay, |
199 base::MessageLoopProxy::current(), | 199 base::MessageLoopProxy::current(), |
200 io_thread_.message_loop_proxy())).Pass(), | 200 io_thread_.message_loop_proxy())).Pass(), |
201 identity_provider_owner_.PassAs<IdentityProvider>(), | 201 identity_provider_owner_.PassAs<IdentityProvider>(), |
202 temp_dir_.path(), | 202 temp_dir_.path(), |
203 request_context, | 203 request_context, |
204 task_runner_, | 204 task_runner_, |
205 base::MessageLoopProxy::current(), | 205 base::MessageLoopProxy::current(), |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 | 886 |
887 TEST_F(GCMDriverFunctionalTest, MessagesDeleted) { | 887 TEST_F(GCMDriverFunctionalTest, MessagesDeleted) { |
888 GetGCMClient()->DeleteMessages(kTestAppID1); | 888 GetGCMClient()->DeleteMessages(kTestAppID1); |
889 gcm_app_handler()->WaitForNotification(); | 889 gcm_app_handler()->WaitForNotification(); |
890 EXPECT_EQ(FakeGCMAppHandler::MESSAGES_DELETED_EVENT, | 890 EXPECT_EQ(FakeGCMAppHandler::MESSAGES_DELETED_EVENT, |
891 gcm_app_handler()->received_event()); | 891 gcm_app_handler()->received_event()); |
892 EXPECT_EQ(kTestAppID1, gcm_app_handler()->app_id()); | 892 EXPECT_EQ(kTestAppID1, gcm_app_handler()->app_id()); |
893 } | 893 } |
894 | 894 |
895 } // namespace gcm | 895 } // namespace gcm |
OLD | NEW |