Update WPT tests for embedded content
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / html / semantics / embedded-content / media-elements / playing-the-media-resource / play-in-detached-document.html
1 <!doctype html>
2 <title>play() in detached document</title>
3 <script src="/resources/testharness.js"></script>
4 <script src="/resources/testharnessreport.js"></script>
5 <script src="/common/media.js"></script>
6 <div id="log"></div>
7 <script>
8 // Negative test for failure to play in a detached document.
9 async_test(function(t)
10 {
11   var doc = document.implementation.createHTMLDocument("");
12   var v = doc.createElement("video");
13   doc.body.appendChild(v);
14   v.src = getVideoURI("/media/movie_5");
15   v.play().catch(() => {});
16
17   v.addEventListener("timeupdate", t.step_func(function() {
18     assert_false(v.paused);
19     if (v.currentTime > 0) {
20       t.done();
21     }
22   }));
23 });
24 </script>