Commit 4109bb61 authored by Justin Cohen's avatar Justin Cohen Committed by Commit Bot

ios: Attempt to deflake CreateFullPagePdf_ValidURL.

Change-Id: If9d95c09c3d701a0ae344d500b592ab22acdf196
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2372806
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Ali Juma <ajuma@chromium.org>
Auto-Submit: Justin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarAli Juma <ajuma@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801065}
parent 9a3dc6a4
...@@ -226,18 +226,16 @@ TEST_F(WebStateTest, CreateFullPagePdf_ValidURL) { ...@@ -226,18 +226,16 @@ TEST_F(WebStateTest, CreateFullPagePdf_ValidURL) {
GURL url("https://www.chromium.org"); GURL url("https://www.chromium.org");
web_state()->LoadData([data_html dataUsingEncoding:NSUTF8StringEncoding], web_state()->LoadData([data_html dataUsingEncoding:NSUTF8StringEncoding],
@"text/html", url); @"text/html", url);
[[[UIApplication sharedApplication] keyWindow]
addSubview:web_state()->GetView()];
NavigationManager::WebLoadParams load_params(url); NavigationManager::WebLoadParams load_params(url);
web_state()->GetNavigationManager()->LoadURLWithParams(load_params); web_state()->GetNavigationManager()->LoadURLWithParams(load_params);
ASSERT_TRUE(base::test::ios::WaitUntilConditionOrTimeout( ASSERT_TRUE(base::test::ios::WaitUntilConditionOrTimeout(
base::test::ios::kWaitForPageLoadTimeout, ^bool { base::test::ios::kWaitForPageLoadTimeout, ^bool {
return web_state()->GetLastCommittedURL() == url; return web_state()->GetLastCommittedURL() == url &&
!web_state()->IsLoading();
})); }));
// Add the subview. Since it does not get immediately painted, adding a small
// delay is necessary.
[[[UIApplication sharedApplication] keyWindow]
addSubview:web_state()->GetView()];
base::test::ios::SpinRunLoopWithMinDelay(base::TimeDelta::FromSecondsD(0.2)); base::test::ios::SpinRunLoopWithMinDelay(base::TimeDelta::FromSecondsD(0.2));
// Create a PDF for this page and validate the data. // Create a PDF for this page and validate the data.
......
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