Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3530)

Unified Diff: chrome/browser/extensions/extension_browsertest.cc

Issue 346044: Fix for flaky ExtensionBrowserTest.Popup test (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_popup_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_browsertest.cc
===================================================================
--- chrome/browser/extensions/extension_browsertest.cc (revision 30873)
+++ chrome/browser/extensions/extension_browsertest.cc (working copy)
@@ -185,9 +185,6 @@
bool ExtensionBrowserTest::WaitForExtensionHostsToLoad() {
// Wait for all the extension hosts that exist to finish loading.
- // NOTE: This assumes that the extension host list is not changing while
- // this method is running.
-
NotificationRegistrar registrar;
registrar.Add(this, NotificationType::EXTENSION_HOST_DID_STOP_LOADING,
NotificationService::AllSources());
@@ -196,10 +193,16 @@
browser()->profile()->GetExtensionProcessManager();
for (ExtensionProcessManager::const_iterator iter = manager->begin();
iter != manager->end();) {
- if ((*iter)->did_stop_loading())
+ if ((*iter)->did_stop_loading()) {
++iter;
- else
+ } else {
ui_test_utils::RunMessageLoop();
+
+ // 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();
+ }
}
LOG(INFO) << "All ExtensionHosts loaded";
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_popup_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698