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_driver_desktop.h" | 5 #include "components/gcm_driver/gcm_driver_desktop.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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 driver_->RemoveAppHandler(kTestAppID2); | 251 driver_->RemoveAppHandler(kTestAppID2); |
252 } | 252 } |
253 | 253 |
254 void GCMDriverTest::SignIn(const std::string& account_id) { | 254 void GCMDriverTest::SignIn(const std::string& account_id) { |
255 driver_->OnSignedIn(); | 255 driver_->OnSignedIn(); |
256 PumpIOLoop(); | 256 PumpIOLoop(); |
257 PumpUILoop(); | 257 PumpUILoop(); |
258 } | 258 } |
259 | 259 |
260 void GCMDriverTest::SignOut() { | 260 void GCMDriverTest::SignOut() { |
261 driver_->Purge(); | 261 driver_->OnSignedOut(); |
262 PumpIOLoop(); | 262 PumpIOLoop(); |
263 PumpUILoop(); | 263 PumpUILoop(); |
264 } | 264 } |
265 | 265 |
266 void GCMDriverTest::Register(const std::string& app_id, | 266 void GCMDriverTest::Register(const std::string& app_id, |
267 const std::vector<std::string>& sender_ids, | 267 const std::vector<std::string>& sender_ids, |
268 WaitToFinish wait_to_finish) { | 268 WaitToFinish wait_to_finish) { |
269 base::RunLoop run_loop; | 269 base::RunLoop run_loop; |
270 async_operation_completed_callback_ = run_loop.QuitClosure(); | 270 async_operation_completed_callback_ = run_loop.QuitClosure(); |
271 driver_->Register(app_id, | 271 driver_->Register(app_id, |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 | 922 |
923 TEST_F(GCMDriverFunctionalTest, MessagesDeleted) { | 923 TEST_F(GCMDriverFunctionalTest, MessagesDeleted) { |
924 GetGCMClient()->DeleteMessages(kTestAppID1); | 924 GetGCMClient()->DeleteMessages(kTestAppID1); |
925 gcm_app_handler()->WaitForNotification(); | 925 gcm_app_handler()->WaitForNotification(); |
926 EXPECT_EQ(FakeGCMAppHandler::MESSAGES_DELETED_EVENT, | 926 EXPECT_EQ(FakeGCMAppHandler::MESSAGES_DELETED_EVENT, |
927 gcm_app_handler()->received_event()); | 927 gcm_app_handler()->received_event()); |
928 EXPECT_EQ(kTestAppID1, gcm_app_handler()->app_id()); | 928 EXPECT_EQ(kTestAppID1, gcm_app_handler()->app_id()); |
929 } | 929 } |
930 | 930 |
931 } // namespace gcm | 931 } // namespace gcm |
OLD | NEW |