Index: extensions/test/extension_test_notification_observer.h |
diff --git a/extensions/test/extension_test_notification_observer.h b/extensions/test/extension_test_notification_observer.h |
index 418d567a65f5aeae82c66ec09ba5f2e9a3fb9634..fe2aa8ec1e7f566f3fbc9dc630bb67ab4ac4a8ba 100644 |
--- a/extensions/test/extension_test_notification_observer.h |
+++ b/extensions/test/extension_test_notification_observer.h |
@@ -14,6 +14,7 @@ |
#include "base/scoped_observer.h" |
#include "content/public/browser/notification_observer.h" |
#include "content/public/browser/notification_registrar.h" |
+#include "extensions/browser/extension_registry_observer.h" |
#include "extensions/browser/process_manager_observer.h" |
namespace content { |
@@ -23,10 +24,12 @@ class WindowedNotificationObserver; |
} |
namespace extensions { |
+class ExtensionRegistry; |
class ProcessManager; |
// Test helper class for observing extension-related events. |
-class ExtensionTestNotificationObserver : public content::NotificationObserver { |
+class ExtensionTestNotificationObserver : public content::NotificationObserver, |
+ ExtensionRegistryObserver { |
public: |
explicit ExtensionTestNotificationObserver(content::BrowserContext* context); |
~ExtensionTestNotificationObserver() override; |
@@ -35,9 +38,6 @@ class ExtensionTestNotificationObserver : public content::NotificationObserver { |
// error was raised. |
bool WaitForExtensionInstallError(); |
- // Waits until an extension is loaded. |
- void WaitForExtensionLoad(); |
- |
// Waits for an extension load error. Returns true if the error really |
// happened. |
bool WaitForExtensionLoadError(); |
@@ -67,11 +67,16 @@ class ExtensionTestNotificationObserver : public content::NotificationObserver { |
last_loaded_extension_id_ = last_loaded_extension_id; |
} |
- // content::NotificationObserver |
+ // content::NotificationObserver: |
void Observe(int type, |
const content::NotificationSource& source, |
const content::NotificationDetails& details) override; |
+ // ExtensionRegistryObserver: |
+ void OnExtensionLoaded(content::BrowserContext* browser_context, |
+ const Extension* extension) override; |
+ void OnShutdown(ExtensionRegistry* registry) override; |
+ |
protected: |
class NotificationSet : public content::NotificationObserver, |
public extensions::ProcessManagerObserver { |
@@ -136,6 +141,10 @@ class ExtensionTestNotificationObserver : public content::NotificationObserver { |
// The closure to quit the currently-running message loop. |
base::Closure quit_closure_; |
+ // Listens to extension loaded notifications. |
+ ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
+ registry_observer_; |
+ |
DISALLOW_COPY_AND_ASSIGN(ExtensionTestNotificationObserver); |
}; |