Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <title>Moving media element to other document to bypass autoplay</title> | |
| 3 <script src="../../resources/testharness.js"></script> | |
| 4 <script src="../../resources/testharnessreport.js"></script> | |
| 5 <script src="../media-file.js"></script> | |
| 6 <body> | |
| 7 <script> | |
| 8 console.warn("dummy log entry to avoid an empty -expected.txt in virtual/"); | |
| 9 | |
| 10 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.
| |
| 11 var v = document.implementation.createHTMLDocument().createElement('video'); | |
| 12 v.src = findMediaFile('video', '../content/test'); | |
| 13 document.body.appendChild(v); | |
| 14 assert_true(document.querySelector('video') != null, 'video was not moved to document'); | |
| 15 assert_true(v.paused, 'video should be paused in initial state'); | |
| 16 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.
| |
| 17 function(e) { | |
| 18 console.warn("video starts playing"); | |
| 19 }, | |
| 20 function(e) { | |
| 21 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.
| |
| 22 }); | |
| 23 }, 'Test that video should not play without user gesture after moving to anoth er document'); | |
| 24 </script> | |
| 25 </body> | |
| OLD | NEW |