Commit a2fe90f0 authored by arthursonzogni's avatar arthursonzogni Committed by Commit Bot

RenderDocument: Update tests KeyboardLockBrowserTest

With RenderDocument:
https://docs.google.com/document/d/1C2VKkFRSc0kdmqjKan1G4NlNlxWZqE4Wam41FNMgnmA/edit#
a new RenderFrameHost is used after every navigations, not only the
cross-process ones, but also the same-process ones.

This CL updates tests so that they don't assume the RenderFrameHost to
be preserved.

Bug: 936696
Change-Id: I222e6a76cb9d16b68cb4802a09bc41ebd9d1bd9c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1538295
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#645280}
parent 028d85ff
......@@ -816,15 +816,15 @@ IN_PROC_BROWSER_TEST_F(KeyboardLockBrowserTest,
ASSERT_TRUE(web_contents()->GetKeyboardLockWidget());
ASSERT_FALSE(web_contents()->GetRenderWidgetHostView()->IsKeyboardLocked());
RenderFrameHost* main_frame = web_contents()->GetMainFrame();
RenderFrameHost* child = ChildFrameAt(main_frame, 2);
ASSERT_TRUE(child);
// The third child is cross-domain and has the allowfullscreen attribute set.
ASSERT_TRUE(
NavigateIframeToURL(web_contents(), kChildIframeName_2,
https_test_server()->GetURL(kCrossSiteChildDomain2,
kFullscreenFramePath)));
RenderFrameHost* main_frame = web_contents()->GetMainFrame();
RenderFrameHost* child = ChildFrameAt(main_frame, 2);
ASSERT_TRUE(child);
ASSERT_TRUE(ExecuteScript(child, "activateFullscreen()"));
ASSERT_EQ(main_frame->GetView()->GetRenderWidgetHost(),
......@@ -839,15 +839,15 @@ IN_PROC_BROWSER_TEST_F(KeyboardLockBrowserTest,
// frame activates fullscreen.
NavigateToTestURL(https_cross_site_frame());
RenderFrameHost* main_frame = web_contents()->GetMainFrame();
RenderFrameHost* child = ChildFrameAt(main_frame, 2);
ASSERT_TRUE(child);
// The third child is cross-domain and has the allowfullscreen attribute set.
ASSERT_TRUE(
NavigateIframeToURL(web_contents(), kChildIframeName_2,
https_test_server()->GetURL(kCrossSiteChildDomain2,
kFullscreenFramePath)));
RenderFrameHost* main_frame = web_contents()->GetMainFrame();
RenderFrameHost* child = ChildFrameAt(main_frame, 2);
ASSERT_TRUE(child);
ASSERT_TRUE(ExecuteScript(child, "activateFullscreen()"));
RequestKeyboardLock(FROM_HERE);
......
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