Commit 6ffcedf7 authored by Mustaq Ahmed's avatar Mustaq Ahmed Committed by Commit Bot

[UAv2] Change activated frame in WebClipboardImplTest.ImageCopy

Bug: 805015
Change-Id: I9b9c8ee0071707220ec9ad1f7966816b055cf655
Reviewed-on: https://chromium-review.googlesource.com/1108438Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Commit-Queue: Mustaq Ahmed <mustaq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569257}
parent c981ac69
......@@ -55,10 +55,11 @@ IN_PROC_BROWSER_TEST_F(WebClipboardImplTest, ImageCopy) {
NavigateIframeToURL(web_contents, "copyme",
GetTestUrl(".", "media/blackwhite.png"));
// Run script to copy image contents and wait for completion.
web_contents->GetMainFrame()->ExecuteJavaScriptWithUserGestureForTests(
base::ASCIIToUTF16("frames[0].document.execCommand('copy');"
"document.title = 'copied';"));
// Run script in child frame to copy image contents and wait for completion.
RenderFrameHost* child_frame = ChildFrameAt(web_contents->GetMainFrame(), 0);
child_frame->ExecuteJavaScriptWithUserGestureForTests(
base::ASCIIToUTF16("document.execCommand('copy');"
"parent.document.title = 'copied';"));
TitleWatcher watcher1(web_contents, base::ASCIIToUTF16("copied"));
EXPECT_EQ(base::ASCIIToUTF16("copied"), watcher1.WaitAndGetTitle());
......
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