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

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

Issue 289283013: Revert of Unload all apps / extensions when deleting a profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 58933ef1f4e0c4bdbca6e7224b13f23969064c36..bbbff27cd49548bf7c9fbfc000b7342a6c604ee7 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -165,7 +165,6 @@
using extensions::Manifest;
using extensions::PermissionSet;
using extensions::TestExtensionSystem;
-using extensions::UnloadedExtensionInfo;
using extensions::URLPatternSet;
namespace keys = extensions::manifest_keys;
@@ -667,12 +666,10 @@
: public ExtensionServiceTestBase, public content::NotificationObserver {
public:
ExtensionServiceTest()
- : unloaded_reason_(UnloadedExtensionInfo::REASON_UNDEFINED),
- installed_(NULL),
+ : installed_(NULL),
was_update_(false),
override_external_install_prompt_(
- FeatureSwitch::prompt_for_external_extensions(),
- false) {
+ FeatureSwitch::prompt_for_external_extensions(), false) {
registrar_.Add(this,
chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
content::NotificationService::AllSources());
@@ -697,11 +694,10 @@
}
case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
- UnloadedExtensionInfo* unloaded_info =
- content::Details<UnloadedExtensionInfo>(details).ptr();
- const Extension* e = unloaded_info->extension;
+ const Extension* e =
+ content::Details<extensions::UnloadedExtensionInfo>(
+ details)->extension;
unloaded_id_ = e->id();
- unloaded_reason_ = unloaded_info->reason;
extensions::ExtensionList::iterator i =
std::find(loaded_.begin(), loaded_.end(), e);
// TODO(erikkay) fix so this can be an assert. Right now the tests
@@ -1254,7 +1250,6 @@
protected:
extensions::ExtensionList loaded_;
std::string unloaded_id_;
- UnloadedExtensionInfo::Reason unloaded_reason_;
const Extension* installed_;
bool was_update_;
std::string old_name_;
@@ -4172,7 +4167,6 @@
EXPECT_EQ(1u, registry_->enabled_extensions().size());
UninstallExtension(good_crx, false);
EXPECT_EQ(0u, registry_->enabled_extensions().size());
- EXPECT_EQ(UnloadedExtensionInfo::REASON_UNINSTALL, unloaded_reason_);
}
TEST_F(ExtensionServiceTest, UninstallTerminatedExtension) {
@@ -4180,7 +4174,6 @@
InstallCRX(data_dir_.AppendASCII("good.crx"), INSTALL_NEW);
TerminateExtension(good_crx);
UninstallExtension(good_crx, false);
- EXPECT_EQ(UnloadedExtensionInfo::REASON_TERMINATE, unloaded_reason_);
}
// Tests the uninstaller helper.
@@ -4188,7 +4181,6 @@
InitializeEmptyExtensionService();
InstallCRX(data_dir_.AppendASCII("good.crx"), INSTALL_NEW);
UninstallExtension(good_crx, true);
- EXPECT_EQ(UnloadedExtensionInfo::REASON_UNINSTALL, unloaded_reason_);
}
TEST_F(ExtensionServiceTest, UninstallExtensionHelperTerminated) {
@@ -4196,7 +4188,6 @@
InstallCRX(data_dir_.AppendASCII("good.crx"), INSTALL_NEW);
TerminateExtension(good_crx);
UninstallExtension(good_crx, true);
- EXPECT_EQ(UnloadedExtensionInfo::REASON_TERMINATE, unloaded_reason_);
}
// An extension disabled because of unsupported requirements should re-enabled
@@ -6926,24 +6917,3 @@
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_NE(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_);
- 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(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_);
- 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());
-}
« 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