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

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

Issue 2047433003: Update autoplay settings when moving media elements between documents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments, added layout tests 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/autoplay-document-move.html
diff --git a/third_party/WebKit/LayoutTests/media/autoplay/autoplay-document-move.html b/third_party/WebKit/LayoutTests/media/autoplay/autoplay-document-move.html
new file mode 100644
index 0000000000000000000000000000000000000000..5a6291454f486fbf0642a0c2343f0884a0c2f7cc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/autoplay/autoplay-document-move.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<title>Moving media element to other document to bypass autoplay</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
+<body>
+<script>
+ console.warn("dummy log entry to avoid an empty -expected.txt in virtual/");
+
+ test(function() {
mlamouri (slow - plz ping) 2016/06/07 19:59:01 You should use a async_test here.
Zhiqiang Zhang (Slow) 2016/06/08 16:11:56 Done.
+ var v = document.implementation.createHTMLDocument().createElement('video');
+ v.src = findMediaFile('video', '../content/test');
+ document.body.appendChild(v);
+ assert_true(document.querySelector('video') != null, 'video was not moved to document');
+ assert_true(v.paused, 'video should be paused in initial state');
+ v.play().then(
mlamouri (slow - plz ping) 2016/06/07 19:59:01 You will have to use t.test_func_done() to wrap th
Zhiqiang Zhang (Slow) 2016/06/08 16:11:56 Done.
+ function(e) {
+ console.warn("video starts playing");
+ },
+ function(e) {
+ console.warn("caught expected exception");
mlamouri (slow - plz ping) 2016/06/07 19:59:02 I think it's wrong to do console.warn() on testhar
Zhiqiang Zhang (Slow) 2016/06/08 16:11:56 Done.
+ });
+ }, 'Test that video should not play without user gesture after moving to another document');
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698