| 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/extensions/extension_gcm_app_handler.h" | 5 #include "chrome/browser/extensions/extension_gcm_app_handler.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" |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 void UninstallExtension(const Extension* extension) { | 335 void UninstallExtension(const Extension* extension) { |
| 336 extension_service_->UninstallExtension(extension->id(), false, NULL); | 336 extension_service_->UninstallExtension(extension->id(), false, NULL); |
| 337 } | 337 } |
| 338 | 338 |
| 339 void SignIn(const std::string& username) { | 339 void SignIn(const std::string& username) { |
| 340 signin_manager_->SignIn(username); | 340 signin_manager_->SignIn(username); |
| 341 waiter_.PumpIOLoop(); | 341 waiter_.PumpIOLoop(); |
| 342 } | 342 } |
| 343 | 343 |
| 344 void SignOut() { | 344 void SignOut() { |
| 345 signin_manager_->SignOut(); | 345 signin_manager_->SignOut(signin_metrics::SIGNOUT_TEST); |
| 346 waiter_.PumpIOLoop(); | 346 waiter_.PumpIOLoop(); |
| 347 } | 347 } |
| 348 | 348 |
| 349 void Register(const std::string& app_id, | 349 void Register(const std::string& app_id, |
| 350 const std::vector<std::string>& sender_ids) { | 350 const std::vector<std::string>& sender_ids) { |
| 351 GetGCMDriver()->Register( | 351 GetGCMDriver()->Register( |
| 352 app_id, | 352 app_id, |
| 353 sender_ids, | 353 sender_ids, |
| 354 base::Bind(&ExtensionGCMAppHandlerTest::RegisterCompleted, | 354 base::Bind(&ExtensionGCMAppHandlerTest::RegisterCompleted, |
| 355 base::Unretained(this))); | 355 base::Unretained(this))); |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 | 483 |
| 484 // App handler is removed when the extension is updated to the version that | 484 // App handler is removed when the extension is updated to the version that |
| 485 // has GCM permission removed. | 485 // has GCM permission removed. |
| 486 UpdateExtension(extension, "good2.crx"); | 486 UpdateExtension(extension, "good2.crx"); |
| 487 waiter()->PumpUILoop(); | 487 waiter()->PumpUILoop(); |
| 488 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero()); | 488 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero()); |
| 489 EXPECT_FALSE(HasAppHandlers(extension->id())); | 489 EXPECT_FALSE(HasAppHandlers(extension->id())); |
| 490 } | 490 } |
| 491 | 491 |
| 492 } // namespace extensions | 492 } // namespace extensions |
| OLD | NEW |