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

Unified Diff: third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-on.html

Issue 2046403002: Autoplay: disable muted video autoplay if data saver is on. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@video-as-images-flag
Patch Set: review comments Created 4 years, 6 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
Index: third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-on.html
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-on.html b/third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-on.html
new file mode 100644
index 0000000000000000000000000000000000000000..d34c6acc82449b56a3fe782c282a9dda8364fb47
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-on.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Test muted autoplay videos interaction with data saver off</title>
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ <script src="media-file.js"></script>
+</head>
+<body>
+<script>
+ window.internals.settings.setMediaPlaybackRequiresUserGesture(true);
+ window.internals.runtimeFlags.autoplayMutedVideosEnabled = true;
+ window.internals.settings.setDataSaverEnabled(true);
+
+ promise_test(function(t)
+ {
+ var video = document.createElement('video');
+ video.src = findMediaFile('video', 'content/test');
+ video.muted = true;
+ return promise_rejects(t,
+ new DOMException('play() can only be initiated by a user gesture.',
+ 'NotAllowedError'),
+ video.play());
+ });
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698