OLD | NEW |
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 <algorithm> | 5 #include <algorithm> |
6 #include <map> | 6 #include <map> |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 | 942 |
943 // TODO(erikkay): add more tests for many of the failure cases. | 943 // TODO(erikkay): add more tests for many of the failure cases. |
944 // TODO(erikkay): add tests for upgrade cases. | 944 // TODO(erikkay): add tests for upgrade cases. |
945 } | 945 } |
946 | 946 |
947 struct MockExtensionRegistryObserver | 947 struct MockExtensionRegistryObserver |
948 : public extensions::ExtensionRegistryObserver { | 948 : public extensions::ExtensionRegistryObserver { |
949 void OnExtensionWillBeInstalled(content::BrowserContext* browser_context, | 949 void OnExtensionWillBeInstalled(content::BrowserContext* browser_context, |
950 const Extension* extension, | 950 const Extension* extension, |
951 bool is_update, | 951 bool is_update, |
952 bool from_ephemeral, | |
953 const std::string& old_name) override { | 952 const std::string& old_name) override { |
954 last_extension_installed = extension->id(); | 953 last_extension_installed = extension->id(); |
955 } | 954 } |
956 | 955 |
957 void OnExtensionUninstalled(content::BrowserContext* browser_context, | 956 void OnExtensionUninstalled(content::BrowserContext* browser_context, |
958 const Extension* extension, | 957 const Extension* extension, |
959 extensions::UninstallReason reason) override { | 958 extensions::UninstallReason reason) override { |
960 last_extension_uninstalled = extension->id(); | 959 last_extension_uninstalled = extension->id(); |
961 } | 960 } |
962 | 961 |
(...skipping 5207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6170 | 6169 |
6171 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED, | 6170 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED, |
6172 content::Source<Profile>(profile()), | 6171 content::Source<Profile>(profile()), |
6173 content::NotificationService::NoDetails()); | 6172 content::NotificationService::NoDetails()); |
6174 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_); | 6173 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_); |
6175 EXPECT_EQ(0u, registry()->enabled_extensions().size()); | 6174 EXPECT_EQ(0u, registry()->enabled_extensions().size()); |
6176 EXPECT_EQ(0u, registry()->disabled_extensions().size()); | 6175 EXPECT_EQ(0u, registry()->disabled_extensions().size()); |
6177 EXPECT_EQ(0u, registry()->terminated_extensions().size()); | 6176 EXPECT_EQ(0u, registry()->terminated_extensions().size()); |
6178 EXPECT_EQ(0u, registry()->blacklisted_extensions().size()); | 6177 EXPECT_EQ(0u, registry()->blacklisted_extensions().size()); |
6179 } | 6178 } |
OLD | NEW |