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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_service_unittest.h" 5 #include "chrome/browser/extensions/extension_service_unittest.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 6899 matching lines...) Expand 10 before | Expand all | Expand 10 after
6910 // ReconcileKnownDisabled(). 6910 // ReconcileKnownDisabled().
6911 service_->EnableExtension(good2); 6911 service_->EnableExtension(good2);
6912 service_->ReconcileKnownDisabled(); 6912 service_->ReconcileKnownDisabled();
6913 expected_extensions.insert(good2); 6913 expected_extensions.insert(good2);
6914 expected_disabled_extensions.erase(good2); 6914 expected_disabled_extensions.erase(good2);
6915 6915
6916 EXPECT_EQ(expected_extensions, registry_->enabled_extensions().GetIDs()); 6916 EXPECT_EQ(expected_extensions, registry_->enabled_extensions().GetIDs());
6917 EXPECT_EQ(expected_disabled_extensions, 6917 EXPECT_EQ(expected_disabled_extensions,
6918 registry_->disabled_extensions().GetIDs()); 6918 registry_->disabled_extensions().GetIDs());
6919 } 6919 }
6920
6921 // Tests a profile being destroyed correctly disables extensions.
6922 TEST_F(ExtensionServiceTest, DestroyingProfileClearsExtensions) {
6923 InitializeEmptyExtensionService();
6924
6925 InstallCRX(data_dir_.AppendASCII("good.crx"), INSTALL_NEW);
6926 EXPECT_EQ(1u, registry_->enabled_extensions().size());
6927 EXPECT_EQ(0u, registry_->disabled_extensions().size());
6928 EXPECT_EQ(0u, registry_->terminated_extensions().size());
6929 EXPECT_EQ(0u, registry_->blacklisted_extensions().size());
6930
6931 service_->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED,
6932 content::Source<Profile>(profile_.get()),
6933 content::NotificationService::NoDetails());
6934
6935 EXPECT_EQ(0u, registry_->enabled_extensions().size());
6936 EXPECT_EQ(0u, registry_->disabled_extensions().size());
6937 EXPECT_EQ(0u, registry_->terminated_extensions().size());
6938 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.
6939 }
OLDNEW
« 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