Commit 3b237eb6 authored by Eric Lawrence [MSFT]'s avatar Eric Lawrence [MSFT] Committed by Commit Bot

Allow ProtocolLaunchEmitsConsoleLog to fail faster

Previously, this test would filter console messages to only the success
string, leading to a 30 second delay for the timeout to be reached in
the event of a failure. Change the test to filter for any relevant
console messages to enable the test to fail more quickly.

Bug: 1111261
Change-Id: Ia2c7e4945de9344e440a0430c53dfb45624fbb74
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2550582
Commit-Queue: Eric Lawrence [MSFT] <ericlaw@microsoft.com>
Reviewed-by: default avatarMatt Giuca <mgiuca@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829659}
parent 954b3b57
......@@ -99,11 +99,15 @@ IN_PROC_BROWSER_TEST_F(ExternalProtocolHandlerBrowserTest,
browser()->tab_strip_model()->GetActiveWebContents();
content::WebContentsConsoleObserver observer(web_contents);
observer.SetPattern("Launched external handler for 'mailto:test@site.test'.");
// Wait for either "Launched external handler..." or "Failed to launch..."; the former will pass
// the test, while the latter will fail it more quickly than waiting for a timeout.
observer.SetPattern("*aunch*'mailto:test@site.test'*");
ASSERT_TRUE(
ExecJs(web_contents, "window.open('mailto:test@site.test', '_self');"));
observer.Wait();
ASSERT_EQ(1u, observer.messages().size());
EXPECT_EQ("Launched external handler for 'mailto:test@site.test'.",
observer.GetMessageAt(0u));
}
IN_PROC_BROWSER_TEST_F(ExternalProtocolHandlerBrowserTest,
......
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