Commit fbee9bee authored by W. James MacLean's avatar W. James MacLean Committed by Commit Bot

Force child iframe to be focused.

This test sometimes fails because the child iframe containing the
text area isn't focused when we check at the start of the test. This
CL forces it to be focused.

Bug: 1024672
Change-Id: I14c04823bee5d6e04be9cd4c5d0848bf31247dba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1919325Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: James MacLean <wjmaclean@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715781}
parent 71ff8c1d
...@@ -449,7 +449,11 @@ IN_PROC_BROWSER_TEST_F(PDFExtensionTestWithTestGuestViewManager, ...@@ -449,7 +449,11 @@ IN_PROC_BROWSER_TEST_F(PDFExtensionTestWithTestGuestViewManager,
"});") "});")
.ExtractBool()); .ExtractBool());
// Make sure the text area is focused. // Make sure the text area is focused. First, we must explicitly focus the
// child iframe containing the text area.
content::RenderFrameHost* main_frame = embedder_web_contents->GetMainFrame();
content::RenderFrameHost* child_text_area = ChildFrameAt(main_frame, 0);
ASSERT_TRUE(content::ExecJs(child_text_area, "window.focus();"));
ASSERT_TRUE(content::EvalJs( ASSERT_TRUE(content::EvalJs(
embedder_web_contents, embedder_web_contents,
"new Promise((resolve) => {" "new Promise((resolve) => {"
......
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