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

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

Issue 266343002: Unload all apps / extensions when deleting a profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address sky comments Created 6 years, 7 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_service.cc ('k') | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service_unittest.cc
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index bbbff27cd49548bf7c9fbfc000b7342a6c604ee7..e0cf44331713307c33a8a9694cc0e0a43e441c7a 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -6917,3 +6917,23 @@ TEST_F(ExtensionServiceTest, ReconcileKnownDisabledWithSideEnable) {
EXPECT_EQ(expected_disabled_extensions,
registry_->disabled_extensions().GetIDs());
}
+
+// Tests a profile being destroyed correctly disables extensions.
+TEST_F(ExtensionServiceTest, DestroyingProfileClearsExtensions) {
+ InitializeEmptyExtensionService();
+
+ InstallCRX(data_dir_.AppendASCII("good.crx"), INSTALL_NEW);
+ EXPECT_EQ(1u, registry_->enabled_extensions().size());
+ EXPECT_EQ(0u, registry_->disabled_extensions().size());
+ EXPECT_EQ(0u, registry_->terminated_extensions().size());
+ EXPECT_EQ(0u, registry_->blacklisted_extensions().size());
+
+ service_->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED,
+ content::Source<Profile>(profile_.get()),
+ content::NotificationService::NoDetails());
+
+ EXPECT_EQ(0u, registry_->enabled_extensions().size());
+ EXPECT_EQ(0u, registry_->disabled_extensions().size());
+ EXPECT_EQ(0u, registry_->terminated_extensions().size());
+ EXPECT_EQ(0u, registry_->blacklisted_extensions().size());
not at google - send to devlin 2014/05/08 15:57:33 is there any chance you can test that the disable
scheib 2014/05/08 16:42:16 Done.
+}
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698