Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: chrome/browser/extensions/extension_gcm_app_handler_unittest.cc

Issue 913943002: Unregister from GCM when the only GCM app is removed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_gcm_app_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_gcm_app_handler_unittest.cc
diff --git a/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc b/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc
index c76a0c9b82f966a7657478c76a01431362be8a82..d5d8f898e15d1f0de3181021925e237e2d0ec284 100644
--- a/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc
+++ b/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc
@@ -148,6 +148,7 @@ class FakeExtensionGCMAppHandler : public ExtensionGCMAppHandler {
void OnUnregisterCompleted(const std::string& app_id,
gcm::GCMClient::Result result) override {
+ ExtensionGCMAppHandler::OnUnregisterCompleted(app_id, result);
unregistration_result_ = result;
waiter_->SignalCompleted();
}
@@ -402,7 +403,7 @@ TEST_F(ExtensionGCMAppHandlerTest, AddAndRemoveAppHandler) {
// App handler is removed when extension is uninstalled.
UninstallExtension(extension.get());
- waiter()->PumpUILoop();
+ waiter()->WaitUntilCompleted();
EXPECT_FALSE(HasAppHandlers(extension->id()));
}
@@ -417,19 +418,11 @@ TEST_F(ExtensionGCMAppHandlerTest, UnregisterOnExtensionUninstall) {
waiter()->WaitUntilCompleted();
EXPECT_EQ(gcm::GCMClient::SUCCESS, registration_result());
- // Add another app handler in order to prevent the GCM service from being
- // stopped when the extension is uninstalled. This is needed because otherwise
- // we are not able to receive the unregistration result.
- GetGCMDriver()->AddAppHandler("Foo", gcm_app_handler());
-
// Unregistration should be triggered when the extension is uninstalled.
UninstallExtension(extension.get());
waiter()->WaitUntilCompleted();
EXPECT_EQ(gcm::GCMClient::SUCCESS,
gcm_app_handler()->unregistration_result());
-
- // Clean up.
- GetGCMDriver()->RemoveAppHandler("Foo");
}
TEST_F(ExtensionGCMAppHandlerTest, UpdateExtensionWithGcmPermissionKept) {
« no previous file with comments | « chrome/browser/extensions/extension_gcm_app_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698