Commit ffceec4a authored by Alexander Semashko's avatar Alexander Semashko Committed by Commit Bot

Fix/deflake tests in /chrome/browser/printing.

This is a prerequisite for switching WindowedNotificationObserver to use
base::RunLoop instead of deprecated MessageLoopRunner.

This CL is split out from https://crrev.com/c/982612.

This CL was uploaded by git cl split.

R=dpapad@chromium.org

Bug: 668707
Change-Id: I723a927eadbb422cff9165e159bfcb72412f6c5a
Reviewed-on: https://chromium-review.googlesource.com/1120499Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Alexander Semashko <ahest@yandex-team.ru>
Cr-Commit-Position: refs/heads/master@{#571620}
parent 1748d4dd
......@@ -272,6 +272,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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment