Chromium Code Reviews| 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> |