Index: chrome/browser/extensions/extension_browsertest.cc |
diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc |
index f8358fa173e148a59a0eeb3c9c1b298914e8e316..0bab1eabf2b929e2451db63e8ec097dea9d2ac6f 100644 |
--- a/chrome/browser/extensions/extension_browsertest.cc |
+++ b/chrome/browser/extensions/extension_browsertest.cc |
@@ -31,6 +31,7 @@ |
#include "chrome/test/base/ui_test_utils.h" |
#include "content/public/browser/notification_registrar.h" |
#include "content/public/browser/notification_service.h" |
+#include "content/public/browser/web_contents.h" |
ExtensionBrowserTest::ExtensionBrowserTest() |
: loaded_(false), |
@@ -395,9 +396,11 @@ bool ExtensionBrowserTest::WaitForExtensionHostsToLoad() { |
ExtensionProcessManager* manager = |
browser()->profile()->GetExtensionProcessManager(); |
- for (ExtensionProcessManager::const_iterator iter = manager->begin(); |
- iter != manager->end();) { |
- if ((*iter)->did_stop_loading()) { |
+ ExtensionProcessManager::ContentsSet all_contents = manager->GetAllContents(); |
+ for (ExtensionProcessManager::ContentsSet::const_iterator iter = |
+ all_contents.begin(); |
+ iter != all_contents.end();) { |
+ if (!(*iter)->IsLoading()) { |
++iter; |
} else { |
ui_test_utils::RunMessageLoop(); |
@@ -405,7 +408,7 @@ bool ExtensionBrowserTest::WaitForExtensionHostsToLoad() { |
// Test activity may have modified the set of extension processes during |
// message processing, so re-start the iteration to catch added/removed |
// processes. |
- iter = manager->begin(); |
+ iter = all_contents.begin(); |
} |
} |
return true; |