| 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_driver.h" | 5 #include "chrome/browser/services/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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 void GCMDriverTest::CreateDriver( | 281 void GCMDriverTest::CreateDriver( |
| 282 FakeGCMClient::StartMode gcm_client_start_mode) { | 282 FakeGCMClient::StartMode gcm_client_start_mode) { |
| 283 scoped_refptr<net::URLRequestContextGetter> request_context = | 283 scoped_refptr<net::URLRequestContextGetter> request_context = |
| 284 new net::TestURLRequestContextGetter(io_thread_.message_loop_proxy()); | 284 new net::TestURLRequestContextGetter(io_thread_.message_loop_proxy()); |
| 285 driver_.reset(new GCMDriver( | 285 driver_.reset(new GCMDriver( |
| 286 scoped_ptr<GCMClientFactory>(new FakeGCMClientFactory( | 286 scoped_ptr<GCMClientFactory>(new FakeGCMClientFactory( |
| 287 gcm_client_start_mode, | 287 gcm_client_start_mode, |
| 288 base::MessageLoopProxy::current(), | 288 base::MessageLoopProxy::current(), |
| 289 io_thread_.message_loop_proxy())).Pass(), | 289 io_thread_.message_loop_proxy())).Pass(), |
| 290 identity_provider_owner_.PassAs<IdentityProvider>(), | 290 identity_provider_owner_.PassAs<IdentityProvider>(), |
| 291 GCMClient::ChromeBuildInfo(), |
| 291 temp_dir_.path(), | 292 temp_dir_.path(), |
| 292 request_context, | 293 request_context, |
| 293 base::MessageLoopProxy::current(), | 294 base::MessageLoopProxy::current(), |
| 294 io_thread_.message_loop_proxy(), | 295 io_thread_.message_loop_proxy(), |
| 295 task_runner_)); | 296 task_runner_)); |
| 296 | 297 |
| 297 gcm_app_handler_.reset(new FakeGCMAppHandler); | 298 gcm_app_handler_.reset(new FakeGCMAppHandler); |
| 298 driver_->AddAppHandler(kTestAppID1, gcm_app_handler_.get()); | 299 driver_->AddAppHandler(kTestAppID1, gcm_app_handler_.get()); |
| 299 driver_->AddAppHandler(kTestAppID2, gcm_app_handler_.get()); | 300 driver_->AddAppHandler(kTestAppID2, gcm_app_handler_.get()); |
| 300 } | 301 } |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 | 867 |
| 867 TEST_F(GCMDriverFunctionalTest, MessagesDeleted) { | 868 TEST_F(GCMDriverFunctionalTest, MessagesDeleted) { |
| 868 GetGCMClient()->DeleteMessages(kTestAppID1); | 869 GetGCMClient()->DeleteMessages(kTestAppID1); |
| 869 gcm_app_handler()->WaitForNotification(); | 870 gcm_app_handler()->WaitForNotification(); |
| 870 EXPECT_EQ(FakeGCMAppHandler::MESSAGES_DELETED_EVENT, | 871 EXPECT_EQ(FakeGCMAppHandler::MESSAGES_DELETED_EVENT, |
| 871 gcm_app_handler()->received_event()); | 872 gcm_app_handler()->received_event()); |
| 872 EXPECT_EQ(kTestAppID1, gcm_app_handler()->app_id()); | 873 EXPECT_EQ(kTestAppID1, gcm_app_handler()->app_id()); |
| 873 } | 874 } |
| 874 | 875 |
| 875 } // namespace gcm | 876 } // namespace gcm |
| OLD | NEW |