Index: chrome/browser/extensions/chrome_extension_test_notification_observer.cc |
diff --git a/chrome/browser/extensions/chrome_extension_test_notification_observer.cc b/chrome/browser/extensions/chrome_extension_test_notification_observer.cc |
index 7a34f44879910aad22c8a6e5cea6878e09da2dbe..cf28829595ad10711b0fe7db184fd3163cc7cbfa 100644 |
--- a/chrome/browser/extensions/chrome_extension_test_notification_observer.cc |
+++ b/chrome/browser/extensions/chrome_extension_test_notification_observer.cc |
@@ -11,6 +11,7 @@ |
#include "chrome/browser/ui/tabs/tab_strip_model.h" |
#include "content/public/browser/browser_context.h" |
#include "content/public/browser/web_contents.h" |
+#include "content/public/test/test_utils.h" |
#include "extensions/browser/notification_types.h" |
#include "extensions/browser/process_manager.h" |
#include "extensions/common/extension.h" |
@@ -80,6 +81,10 @@ bool ChromeExtensionTestNotificationObserver:: |
} |
bool ChromeExtensionTestNotificationObserver::WaitForExtensionViewsToLoad() { |
+ // Some views might be not created yet. This call may become insufficient if |
+ // e.g. implementation of ExtensionHostQueue changes. |
+ content::RunAllPendingInMessageLoop(); |
+ |
ProcessManager* manager = ProcessManager::Get(GetBrowserContext()); |
NotificationSet notification_set; |
notification_set.Add(content::NOTIFICATION_WEB_CONTENTS_DESTROYED); |