| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>Test video controls visibility with multimodal input. The controls should
remain visible if the last input event was a mouse move over them.</title> | 2 <title>Test video controls visibility with multimodal input. The controls should
remain visible if the last input event was a mouse move over them.</title> |
| 3 <script src="../resources/testharness.js"></script> | 3 <script src="../resources/testharness.js"></script> |
| 4 <script src="../resources/testharnessreport.js"></script> | 4 <script src="../resources/testharnessreport.js"></script> |
| 5 <script src="media-file.js"></script> | 5 <script src="media-file.js"></script> |
| 6 <script src="media-controls.js"></script> | 6 <script src="media-controls.js"></script> |
| 7 <video controls loop></video> | 7 <video controls loop></video> |
| 8 <script> | 8 <script> |
| 9 async_test(function(t) { | 9 async_test(function(t) { |
| 10 var video = document.querySelector("video"); | 10 var video = document.querySelector("video"); |
| 11 | 11 |
| 12 video.oncanplaythrough = t.step_func(function() { | 12 video.oncanplaythrough = t.step_func(function() { |
| 13 assert_true(video.paused); | 13 assert_true(video.paused); |
| 14 | 14 |
| 15 // Tap (touch input) the play button. | 15 // Tap (touch input) the play button. |
| 16 var coords = mediaControlsButtonCoordinates(video, "play-button"); | 16 var coords = mediaControlsButtonCoordinates(video, "play-button"); |
| 17 eventSender.gestureTapDown(coords[0], coords[1]); | 17 eventSender.gestureTapDown(coords[0], coords[1]); |
| 18 eventSender.gestureShowPress(coords[0], coords[1]); | 18 eventSender.gestureShowPress(coords[0], coords[1]); |
| 19 eventSender.gestureTap(coords[0], coords[1]); | 19 eventSender.gestureTap(coords[0], coords[1]); |
| 20 assert_false(video.paused); | 20 assert_false(video.paused); |
| 21 | 21 |
| 22 // And then hover the control with the mouse. | 22 // And then hover the control with the mouse. |
| 23 eventSender.mouseMoveTo(0, 0); |
| 23 eventSender.mouseMoveTo(coords[0], coords[1]); | 24 eventSender.mouseMoveTo(coords[0], coords[1]); |
| 24 | 25 |
| 25 // And the controls should remain visible. | 26 // And the controls should remain visible. |
| 26 runAfterHideMediaControlsTimerFired(t.step_func_done(function() { | 27 runAfterHideMediaControlsTimerFired(t.step_func_done(function() { |
| 27 var controls = mediaControlsButton(video, "panel"); | 28 assert_true(isControlsPanelVisible(video)); |
| 28 assert_equals(getComputedStyle(controls).opacity, "1"); | |
| 29 }), video); | 29 }), video); |
| 30 }); | 30 }); |
| 31 | 31 |
| 32 video.src = findMediaFile("video", "content/test"); | 32 video.src = findMediaFile("video", "content/test"); |
| 33 }); | 33 }); |
| 34 </script> | 34 </script> |
| OLD | NEW |