Commit 46b14df6 authored by Kevin Marshall's avatar Kevin Marshall Committed by Chromium LUCI CQ

[fuchsia] Fix AutoPlayTest.*UserActivatedViaSimulatedInteraction

Fixes a test flake that was caused by incomplete precondition
criteria. Now the test case will wait until the document is parsed
before executing the test case.

Bug: 1162433
Test: Executed test case with --gtest_repeat=500, no issues found.
Change-Id: I0c5f58965906ec4e83b6212287a529d5b0190034
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2638333
Commit-Queue: Kevin Marshall <kmarshall@chromium.org>
Reviewed-by: default avatarWez <wez@chromium.org>
Reviewed-by: default avatarDavid Dorwin <ddorwin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845274}
parent 22c27291
......@@ -49,12 +49,11 @@ class AutoplayTest : public cr_fuchsia::WebEngineBrowserTest {
fuchsia::web::NavigationControllerPtr controller_;
};
// TODO(1162433): Flakily times-out, probably because URL will change as soon
// as navigation is "committed", which happens before document load.
IN_PROC_BROWSER_TEST_F(
AutoplayTest,
DISABLED_UserActivationPolicy_UserActivatedViaSimulatedInteraction) {
UserActivationPolicy_UserActivatedViaSimulatedInteraction) {
const GURL kUrl(embedded_test_server()->GetURL("/play_vp8.html?autoplay=1"));
constexpr const char kPageLoadedTitle[] = "initial title";
fuchsia::web::FramePtr frame =
CreateFrame(fuchsia::web::AutoplayPolicy::REQUIRE_USER_ACTIVATION);
......@@ -62,7 +61,7 @@ IN_PROC_BROWSER_TEST_F(
fuchsia::web::LoadUrlParams params;
EXPECT_TRUE(
cr_fuchsia::LoadUrlAndExpectResponse(controller_.get(), {}, kUrl.spec()));
navigation_listener_.RunUntilUrlEquals(kUrl);
navigation_listener_.RunUntilUrlAndTitleEquals(kUrl, kPageLoadedTitle);
context_impl()
->GetFrameImplForTest(&frame)
......
<html>
<head><title>initial title</title></head>
<head><title>document loading</title></head>
<body>
<script>
var bear = document.createElement('video');
......@@ -32,6 +32,10 @@
}
bear.onstalled = function() { document.title = 'stalled'; }
bear.src = 'bear-vp8a.webm';
// Programatically set the title, to provide an externally-visible
// indication that the page's scripts have executed.
document.title = 'initial title';
</script>
</body>
</html>
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