video.currentTime is not being updated in iOS 13.4 Beta
[WebKit-https.git] / LayoutTests / fast / mediastream / media-element-current-time.html
1 <body>
2 <video id="video" autoplay playsInline></video>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <script>
6
7 promise_test(async() => {
8
9     let stream = await navigator.mediaDevices.getUserMedia({video : true});
10
11     video.srcObject = stream;
12     assert_equals(video.currentTime, 0);
13
14     await video.play();
15     let currentTime = video.currentTime;
16     assert_not_equals(currentTime, 0, "Playback has started, currentTime must not be zero");
17
18     await new Promise(resolve => setTimeout(resolve, 10));
19     assert_greater_than(video.currentTime, currentTime, "video is playing, time should advance");
20
21     video.pause();
22     currentTime = video.currentTime;
23     await new Promise(resolve => setTimeout(resolve, 10));
24     assert_equals(video.currentTime, currentTime, "video is paused, currentTime must not advance");
25
26     await video.play();
27     assert_greater_than(video.currentTime, currentTime, "Playback has started, currentTime should advance");
28
29 }, "Check video.currentTime behavior");
30 </script>
31 </body>