Commit cbfeebea authored by Dmitry Gozman's avatar Dmitry Gozman Committed by Commit Bot

Wait for load event in BookmarkAppNavigationBrowserTest

We are currently waiting for navigation commit, which is
too early to immediately access document.body. We should instead
wait for load event.

This happens to work today because the first data chunk we process
when committing navigation is big enough to construct document.body
in these tests. This may not always be the case though.

Bug: none
Change-Id: I0025f9419e700b9eb6f472f051dc92888b4be19e
Reviewed-on: https://chromium-review.googlesource.com/c/1483362Reviewed-by: default avatarcalamity <calamity@chromium.org>
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635107}
parent 956a2f21
...@@ -177,7 +177,7 @@ void BookmarkAppNavigationBrowserTest::ClickLinkWithModifiersAndWaitForURL( ...@@ -177,7 +177,7 @@ void BookmarkAppNavigationBrowserTest::ClickLinkWithModifiersAndWaitForURL(
content::SimulateMouseClick(web_contents, modifiers, content::SimulateMouseClick(web_contents, modifiers,
blink::WebMouseEvent::Button::kLeft); blink::WebMouseEvent::Button::kLeft);
observer->WaitForNavigationFinished(); observer->Wait();
} }
// static // static
...@@ -306,7 +306,7 @@ Browser* BookmarkAppNavigationBrowserTest::OpenTestBookmarkApp() { ...@@ -306,7 +306,7 @@ Browser* BookmarkAppNavigationBrowserTest::OpenTestBookmarkApp() {
GURL app_url = https_server_.GetURL(GetAppUrlHost(), GetAppUrlPath()); GURL app_url = https_server_.GetURL(GetAppUrlHost(), GetAppUrlPath());
auto observer = GetTestNavigationObserver(app_url); auto observer = GetTestNavigationObserver(app_url);
Browser* app_browser = LaunchAppBrowser(test_bookmark_app_); Browser* app_browser = LaunchAppBrowser(test_bookmark_app_);
observer->WaitForNavigationFinished(); observer->Wait();
return app_browser; return app_browser;
} }
......
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