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

Unified Diff: chrome/browser/printing/print_preview_dialog_controller_browsertest.cc

Issue 2740783003: Revert "Revert of Reland: Switch WindowedNotificationObserver to use base::RunLoop. (patchset #3 id… (Closed)
Patch Set: Fix comment. Created 3 years, 8 months 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
Index: chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
diff --git a/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc b/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
index 335becff7f9da01598fb382e25f39bb9a385a78b..ecf843aa0b90eecfee3e37ad9bae014bc0feee0c 100644
--- a/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
+++ b/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
@@ -266,6 +266,11 @@ IN_PROC_BROWSER_TEST_F(PrintPreviewDialogControllerBrowserTest,
chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB);
content::WaitForLoadStop(
browser()->tab_strip_model()->GetActiveWebContents());
+ // When Widget::Close is called, a task is posted that will destroy the
+ // widget. Here the widget is closed when the navigation commits. Load stop
+ // may occur right after the commit, before the widget is destroyed.
+ // Execute pending tasks to account for this.
+ base::RunLoop().RunUntilIdle();
ASSERT_TRUE(dialog_destroyed_observer.dialog_destroyed());
// Try printing again.

Powered by Google App Engine
This is Rietveld 408576698