Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(718)

Unified Diff: third_party/WebKit/LayoutTests/media/video-autoplay-experiment-just-once.html

Issue 1949633002: Don't remove the gesture requirement in the autoplay experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed test expectations. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-autoplay-experiment-modes-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/media/video-autoplay-experiment-just-once.html
diff --git a/third_party/WebKit/LayoutTests/media/video-autoplay-experiment-just-once.html b/third_party/WebKit/LayoutTests/media/video-autoplay-experiment-just-once.html
index 13fbbc4549f8ddcea601b2010aa650510a482b4a..78715ce7c33313c063be73cfdb529a38263043ba 100644
--- a/third_party/WebKit/LayoutTests/media/video-autoplay-experiment-just-once.html
+++ b/third_party/WebKit/LayoutTests/media/video-autoplay-experiment-just-once.html
@@ -20,9 +20,11 @@ function runTest()
// gesture override experiment from autoplaying.
videoShouldNotPlay.pause();
- // Mute them both, and see if only one starts.
- videoShouldPlay.muted = true;
- videoShouldNotPlay.muted = true;
+ // Scroll them into view, and see if they start playing.
+ parent.scrollIntoView(true);
+ // TODO(liberato): remove once autoplay gesture override experiment concludes.
+ window.internals.triggerAutoplayViewportCheck(videoShouldPlay);
+ window.internals.triggerAutoplayViewportCheck(videoShouldNotPlay);
logResult(didPlaybackStart(videoShouldPlay), "First video should play");
logResult(!didPlaybackStart(videoShouldNotPlay), "Second video should not play");
testRunner.notifyDone();
@@ -45,12 +47,20 @@ function runTest()
return !element.paused || element.ended;
}
+ // Start the videos off-screen.
+ var spacer = document.createElement("div");
+ spacer.style.height="1000px";
+ spacer.style.bgcolor="blue";
+ spacer.innerHTML="<p></p>";
+ document.body.appendChild(spacer);
+
+ // Create a container for the videos.
var parent = document.createElement("div");
document.body.appendChild(parent);
- // Require a user gesture, but override it for muted videos.
+ // Require a user gesture, but override it for visible videos.
internals.settings.setMediaPlaybackRequiresUserGesture(true);
- internals.settings.setAutoplayExperimentMode("enabled-forvideo-ifmuted");
+ internals.settings.setAutoplayExperimentMode("enabled-forvideo-ifviewport");
videoShouldPlay = prepareVideo(parent);
videoShouldNotPlay = prepareVideo(parent);
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-autoplay-experiment-modes-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698