OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <video id="testVideo" controls></video> | 4 <video id="testVideo"></video> |
5 <div id="log"></div> | |
6 <p>Test that pausing the media element in "playing" event handler pauses the
media element.</p> | 5 <p>Test that pausing the media element in "playing" event handler pauses the
media element.</p> |
7 <script src="./w3c-media-utils.js"></script> | 6 <script src="./w3c-media-utils.js"></script> |
8 <script src="../resources/testharness.js"></script> | 7 <script src="../resources/testharness.js"></script> |
9 <script src="../resources/testharnessreport.js"></script> | 8 <script src="../resources/testharnessreport.js"></script> |
10 <script> | 9 <script> |
11 async_test(function(test) | 10 async_test(function(test) |
12 { | 11 { |
13 var video = document.getElementById("testVideo"); | 12 var video = document.getElementById("testVideo"); |
14 video.src = getVideoURI("test"); | 13 video.src = getVideoURI("test"); |
15 waitForEventAndRunStep("timeupdate", video); | 14 waitForEventAndRunStep("timeupdate", video); |
16 waitForEventAndRunStep("playing", video, function () | 15 waitForEventAndRunStep("playing", video, function () |
17 { | 16 { |
18 video.pause(); | 17 video.pause(); |
19 }); | 18 }); |
20 // function to be run when "pause" fires. | 19 // function to be run when "pause" fires. |
21 var pauseCheck = function() | 20 var pauseCheck = function() |
22 { | 21 { |
23 assert_true(video.paused, "Video is paused."); | 22 assert_true(video.paused, "Video is paused."); |
24 test.done(); | 23 test.done(); |
25 } | 24 } |
26 waitForEventAndRunStep("pause", video, pauseCheck, test); | 25 waitForEventAndRunStep("pause", video, pauseCheck, test); |
27 video.play(); | 26 video.play(); |
28 }, "Verifies pause actually pauses."); | 27 }, "Verifies pause actually pauses."); |
29 </script> | 28 </script> |
30 </body> | 29 </body> |
31 </html> | 30 </html> |
OLD | NEW |