Index: third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-while-hovering-shows-controls.html |
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-while-hovering-shows-controls.html b/third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-while-hovering-shows-controls.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..23a53fd5d07ceb64e787c0ee069abf010249e49e |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-while-hovering-shows-controls.html |
@@ -0,0 +1,89 @@ |
+<!DOCTYPE html> |
+<title>Tests that video controls are shown when entering/exiting fullscreen |
+whilst hovering over the controls. Opposite of |
+video-enter-exit-fullscreen-without-hovering-doesnt-show-controls.html</title> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script src="../media-file.js"></script> |
+<script src="../media-controls.js"></script> |
+ |
+<video controls></video> |
+ |
+<script> |
+async_test(function(t) { |
+ var video = document.querySelector("video"); |
+ |
+ video.oncanplaythrough = t.step_func(function() { |
+ video.oncanplaythrough = null; |
+ |
+ var panel = mediaControlsButton(video, "panel"); |
+ |
+ // Move mouse to the play button and start playing the video. |
+ clickAtCoordinates(...mediaControlsButtonCoordinates(video, "play-button")); |
mlamouri (slow - plz ping)
2017/05/15 14:42:15
What's the "..."
johnme
2017/05/15 14:56:02
It's https://developer.mozilla.org/en/docs/Web/Jav
mlamouri (slow - plz ping)
2017/05/15 15:17:51
TIL :)
|
+ |
+ assert_equals(getComputedStyle(panel).opacity, "1", |
+ "Inline controls should initially show since controls " + |
+ "attribute is present"); |
+ |
+ // Get fullscreen button coordinates whilst it is visible. |
+ var inlineFullscreenButtonCoordinates = |
+ mediaControlsButtonCoordinates(video, "fullscreen-button"); |
+ |
+ // Move mouse away so it no longer hovers over controls/video. |
+ chrome.gpuBenchmarking.pointerActionSequence([{ |
mlamouri (slow - plz ping)
2017/05/15 14:42:15
Did you consider using "eventSender.mouseMoveTo"?
johnme
2017/05/15 14:56:02
That's deprecated and fails presubmit (though I re
|
+ source: 'mouse', actions: [{name: 'pointerMove', x: 0, y: 0}] |
+ }]); |
+ |
+ runAfterHideMediaControlsTimerFired(t.step_func(function() { |
+ assert_equals(getComputedStyle(panel).opacity, "0", |
+ "Inline controls should be hidden by timer"); |
+ |
+ // Move mouse to the fullscreen button and enter fullscreen. Leave the |
+ // mouse hovering over the controls. |
+ clickAtCoordinates(...inlineFullscreenButtonCoordinates); |
+ }), video); |
+ |
+ video.onwebkitfullscreenchange = t.step_func(function() { |
+ video.onwebkitfullscreenchange = null; |
+ |
+ assert_equals(document.webkitFullscreenElement, video, |
+ "Should have entered fullscreen"); |
+ |
+ assert_equals(getComputedStyle(panel).opacity, "1", |
+ "Fullscreen controls should show after entering " + |
+ "fullscreen since mouse is hovering over controls"); |
+ |
+ // Get fullscreen button coordinates whilst it is visible. |
+ var fullscreenFullscreenButtonCoordinates = |
+ mediaControlsButtonCoordinates(video, "fullscreen-button"); |
+ |
+ // Move mouse away so it no longer hovers over controls/video. |
+ chrome.gpuBenchmarking.pointerActionSequence([{ |
+ source: 'mouse', actions: [{name: 'pointerMove', x: 0, y: 0}] |
+ }]); |
+ |
+ runAfterHideMediaControlsTimerFired(t.step_func(function() { |
+ assert_equals(getComputedStyle(panel).opacity, "0", |
+ "Fullscreen controls should be hidden by timer"); |
+ |
+ // Move mouse to the fullscreen button and exit fullscreen. Leave the |
+ // mouse hovering over the controls. |
+ clickAtCoordinates(...fullscreenFullscreenButtonCoordinates); |
+ }), video); |
+ |
+ video.onwebkitfullscreenchange = t.step_func(function() { |
+ assert_equals(document.webkitFullscreenElement, null, |
+ "Should have exited fullscreen"); |
+ |
+ assert_equals(getComputedStyle(panel).opacity, "1", |
+ "Inline controls should show again after exiting " + |
+ "fullscreen since mouse is hovering over controls"); |
+ |
+ t.done(); |
+ }); |
+ }); |
+ }); |
+ |
+ video.src = findMediaFile("video", "../content/test-25fps"); |
mlamouri (slow - plz ping)
2017/05/15 14:42:15
Maybe you should use "../content/test"? The 25fps
johnme
2017/05/15 14:56:02
With ../content/test the video ends before the tes
mlamouri (slow - plz ping)
2017/05/15 15:17:51
Would content/counting work?
|
+}); |
+</script> |