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

Unified Diff: LayoutTests/media/no-autoplay-with-user-gesture-requirement.html

Issue 428263004: Revert of Delete mediaPlaybackRequiresUserGesture (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | « LayoutTests/FlakyTests ('k') | LayoutTests/media/no-autoplay-with-user-gesture-requirement-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/media/no-autoplay-with-user-gesture-requirement.html
diff --git a/LayoutTests/media/no-autoplay-with-user-gesture-requirement.html b/LayoutTests/media/no-autoplay-with-user-gesture-requirement.html
new file mode 100644
index 0000000000000000000000000000000000000000..ad279ac9d44967d9f53a8045559563502108d607
--- /dev/null
+++ b/LayoutTests/media/no-autoplay-with-user-gesture-requirement.html
@@ -0,0 +1,41 @@
+<html>
+ <head>
+ <title>Test that media autoplay should not work if user gesture is required for playback</title>
+ <script src=media-file.js></script>
+ <script src=video-test.js></script>
+ <script>
+ if (window.internals)
+ window.internals.settings.setMediaPlaybackRequiresUserGesture(true);
+
+ function testPlay()
+ {
+ failTest("play event should not fire without user gesture.");
+ }
+
+ function testPaused()
+ {
+ testExpected("video.paused", true);
+ endTest();
+ }
+
+ function canplaythrough()
+ {
+ setTimeout(testPaused, 100);
+ }
+
+ function start()
+ {
+ findMediaElement();
+ video.src = findMediaFile("video", "content/test");
+ testExpected("video.paused", true);
+ waitForEvent('canplaythrough', canplaythrough);
+ waitForEvent('play', testPlay);
+ }
+ </script>
+ </head>
+
+ <body onload="start()">
+ <p>Test that media autoplay should not work if user gesture is required for playback.</p>
+ <video controls autoplay></video>
+ </body>
+</html>
« no previous file with comments | « LayoutTests/FlakyTests ('k') | LayoutTests/media/no-autoplay-with-user-gesture-requirement-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698