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..62c6a0aefde666402e9410fc1de3940caf44b182 100644 |
--- a/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc |
+++ b/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc |
@@ -266,6 +266,9 @@ IN_PROC_BROWSER_TEST_F(PrintPreviewDialogControllerBrowserTest, |
chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB); |
content::WaitForLoadStop( |
browser()->tab_strip_model()->GetActiveWebContents()); |
+ // Load stop may occure right after the reload commits, and the dialog is |
+ // destroyed in a task posted during commit. Make sure that task is executed. |
+ base::RunLoop().RunUntilIdle(); |
ASSERT_TRUE(dialog_destroyed_observer.dialog_destroyed()); |
// Try printing again. |