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

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

Issue 2052623002: [Android, Media] Enable autoplay settings for muted autoplay, wired them up to the media element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-settings-npe
Patch Set: Rebased, added a test 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.html
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-muted.html b/third_party/WebKit/LayoutTests/media/autoplay-muted.html
index bd83ef15f90ecaae5e2f62d522701319693ebc67..e0b5926b5d75ddd2587fc0b5ba9caa570f8af721 100644
--- a/third_party/WebKit/LayoutTests/media/autoplay-muted.html
+++ b/third_party/WebKit/LayoutTests/media/autoplay-muted.html
@@ -15,6 +15,7 @@
window.internals.settings.setMediaPlaybackRequiresUserGesture(true);
window.internals.runtimeFlags.autoplayMutedVideosEnabled = true;
+ testRunner.setAutoplayAllowed(true);
function createMutedVideoElement() {
var e = document.createElement('video');
@@ -60,4 +61,14 @@
assert_false(e.paused, "The video should not be paused.");
});
}, "Test that unmuting autoplayed video with gesture doesn't pause it.");
+
+ promise_test(function(t) {
+ testRunner.setAutoplayAllowed(false);
+ return promise_rejects(
+ t,
+ new DOMException(
+ 'play() can only be initiated by a user gesture.',
+ 'NotAllowedError'),
+ createMutedVideoElement().play());
+ }, "Test that muted videos don't autoplay when the setting is disabled");
</script>

Powered by Google App Engine
This is Rietveld 408576698