| 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 extension_service_->DisableExtension( | 328 extension_service_->DisableExtension( |
| 329 extension->id(), Extension::DISABLE_USER_ACTION); | 329 extension->id(), Extension::DISABLE_USER_ACTION); |
| 330 } | 330 } |
| 331 | 331 |
| 332 void EnableExtension(const Extension* extension) { | 332 void EnableExtension(const Extension* extension) { |
| 333 extension_service_->EnableExtension(extension->id()); | 333 extension_service_->EnableExtension(extension->id()); |
| 334 } | 334 } |
| 335 | 335 |
| 336 void UninstallExtension(const Extension* extension) { | 336 void UninstallExtension(const Extension* extension) { |
| 337 extension_service_->UninstallExtension( | 337 extension_service_->UninstallExtension( |
| 338 extension->id(), extensions::UNINSTALL_REASON_FOR_TESTING, NULL); | 338 extension->id(), |
| 339 extensions::UNINSTALL_REASON_FOR_TESTING, |
| 340 base::Bind(&base::DoNothing), |
| 341 NULL); |
| 339 } | 342 } |
| 340 | 343 |
| 341 void SignIn(const std::string& username) { | 344 void SignIn(const std::string& username) { |
| 342 signin_manager_->SignIn(username); | 345 signin_manager_->SignIn(username); |
| 343 waiter_.PumpIOLoop(); | 346 waiter_.PumpIOLoop(); |
| 344 } | 347 } |
| 345 | 348 |
| 346 void SignOut() { | 349 void SignOut() { |
| 347 signin_manager_->SignOut(signin_metrics::SIGNOUT_TEST); | 350 signin_manager_->SignOut(signin_metrics::SIGNOUT_TEST); |
| 348 waiter_.PumpIOLoop(); | 351 waiter_.PumpIOLoop(); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 | 488 |
| 486 // App handler is removed when the extension is updated to the version that | 489 // App handler is removed when the extension is updated to the version that |
| 487 // has GCM permission removed. | 490 // has GCM permission removed. |
| 488 UpdateExtension(extension, "good2.crx"); | 491 UpdateExtension(extension, "good2.crx"); |
| 489 waiter()->PumpUILoop(); | 492 waiter()->PumpUILoop(); |
| 490 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero()); | 493 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero()); |
| 491 EXPECT_FALSE(HasAppHandlers(extension->id())); | 494 EXPECT_FALSE(HasAppHandlers(extension->id())); |
| 492 } | 495 } |
| 493 | 496 |
| 494 } // namespace extensions | 497 } // namespace extensions |
| OLD | NEW |