Commit 10081a8c authored by Dave Tapuska's avatar Dave Tapuska Committed by Commit Bot

Fix flaky WebClipboardImplTest.PasteRTF

The test was not waiting for the frame to have focus before sending the
paste event. If there is no focused frame the Paste event gets discarded
and the test times out.

BUG=789428

Change-Id: I3fb39eb4f38d3156b3844cdb0d708d595d7eb74d
Reviewed-on: https://chromium-review.googlesource.com/797432
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520182}
parent 7f7beb7d
......@@ -22,8 +22,7 @@ class WebClipboardImplTest : public ContentBrowserTest {
~WebClipboardImplTest() override = default;
};
// crbug.com/789428: started to be super flaky on all bots.
IN_PROC_BROWSER_TEST_F(WebClipboardImplTest, DISABLED_PasteRTF) {
IN_PROC_BROWSER_TEST_F(WebClipboardImplTest, PasteRTF) {
BrowserTestClipboardScope clipboard;
const std::string rtf_content = "{\\rtf1\\ansi Hello, {\\b world.}}";
......@@ -31,7 +30,8 @@ IN_PROC_BROWSER_TEST_F(WebClipboardImplTest, DISABLED_PasteRTF) {
// paste_listener.html takes RTF from the clipboard and sets the title.
NavigateToURL(shell(), GetTestUrl(".", "paste_listener.html"));
base::RunLoop().RunUntilIdle();
FrameFocusedObserver focus_observer(shell()->web_contents()->GetMainFrame());
focus_observer.Wait();
const base::string16 expected_title = base::UTF8ToUTF16(rtf_content);
content::TitleWatcher title_watcher(shell()->web_contents(), expected_title);
......
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