| Index: extensions/test/extension_test_notification_observer.cc
|
| diff --git a/extensions/test/extension_test_notification_observer.cc b/extensions/test/extension_test_notification_observer.cc
|
| index 0e4d75d0ccdcbfa8cfe6e07dfb27c4b3ab52ef06..5639f56d7360917784265e750917609f10b5aee5 100644
|
| --- a/extensions/test/extension_test_notification_observer.cc
|
| +++ b/extensions/test/extension_test_notification_observer.cc
|
| @@ -74,7 +74,11 @@ ExtensionTestNotificationObserver::ExtensionTestNotificationObserver(
|
| : context_(context),
|
| extension_installs_observed_(0),
|
| extension_load_errors_observed_(0),
|
| - crx_installers_done_observed_(0) {}
|
| + crx_installers_done_observed_(0),
|
| + registry_observer_(this) {
|
| + if (context_)
|
| + registry_observer_.Add(ExtensionRegistry::Get(context_));
|
| +}
|
|
|
| ExtensionTestNotificationObserver::~ExtensionTestNotificationObserver() {}
|
|
|
| @@ -100,10 +104,6 @@ bool ExtensionTestNotificationObserver::WaitForExtensionInstallError() {
|
| return extension_installs_observed_ == before;
|
| }
|
|
|
| -void ExtensionTestNotificationObserver::WaitForExtensionLoad() {
|
| - WaitForNotification(NOTIFICATION_EXTENSION_LOADED_DEPRECATED);
|
| -}
|
| -
|
| bool ExtensionTestNotificationObserver::WaitForExtensionLoadError() {
|
| int before = extension_load_errors_observed_;
|
| WaitForNotification(NOTIFICATION_EXTENSION_LOAD_ERROR);
|
| @@ -150,12 +150,6 @@ void ExtensionTestNotificationObserver::Observe(
|
| const content::NotificationSource& source,
|
| const content::NotificationDetails& details) {
|
| switch (type) {
|
| - case NOTIFICATION_EXTENSION_LOADED_DEPRECATED:
|
| - last_loaded_extension_id_ =
|
| - content::Details<const Extension>(details).ptr()->id();
|
| - VLOG(1) << "Got EXTENSION_LOADED notification.";
|
| - break;
|
| -
|
| case NOTIFICATION_CRX_INSTALLER_DONE:
|
| VLOG(1) << "Got CRX_INSTALLER_DONE notification.";
|
| {
|
| @@ -180,6 +174,18 @@ void ExtensionTestNotificationObserver::Observe(
|
| }
|
| }
|
|
|
| +void ExtensionTestNotificationObserver::OnExtensionLoaded(
|
| + content::BrowserContext* browser_context,
|
| + const Extension* extension) {
|
| + last_loaded_extension_id_ = extension->id();
|
| + VLOG(1) << "Got EXTENSION_LOADED notification.";
|
| +}
|
| +
|
| +void ExtensionTestNotificationObserver::OnShutdown(
|
| + ExtensionRegistry* registry) {
|
| + registry_observer_.RemoveAll();
|
| +}
|
| +
|
| void ExtensionTestNotificationObserver::WaitForCondition(
|
| const ConditionCallback& condition,
|
| NotificationSet* notification_set) {
|
|
|