OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <title>Tests that video controls are shown when entering/exiting fullscreen | |
3 whilst hovering over the controls. Opposite of | |
4 video-enter-exit-fullscreen-without-hovering-doesnt-show-controls.html</title> | |
5 <script src="../../resources/testharness.js"></script> | |
6 <script src="../../resources/testharnessreport.js"></script> | |
7 <script src="../media-file.js"></script> | |
8 <script src="../media-controls.js"></script> | |
9 | |
10 <video controls></video> | |
11 | |
12 <script> | |
13 async_test(function(t) { | |
14 var video = document.querySelector("video"); | |
15 | |
16 video.oncanplaythrough = t.step_func(function() { | |
17 video.oncanplaythrough = null; | |
18 | |
19 var panel = mediaControlsButton(video, "panel"); | |
20 | |
21 // Move mouse to the play button and start playing the video. | |
22 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 :)
| |
23 | |
24 assert_equals(getComputedStyle(panel).opacity, "1", | |
25 "Inline controls should initially show since controls " + | |
26 "attribute is present"); | |
27 | |
28 // Get fullscreen button coordinates whilst it is visible. | |
29 var inlineFullscreenButtonCoordinates = | |
30 mediaControlsButtonCoordinates(video, "fullscreen-button"); | |
31 | |
32 // Move mouse away so it no longer hovers over controls/video. | |
33 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
| |
34 source: 'mouse', actions: [{name: 'pointerMove', x: 0, y: 0}] | |
35 }]); | |
36 | |
37 runAfterHideMediaControlsTimerFired(t.step_func(function() { | |
38 assert_equals(getComputedStyle(panel).opacity, "0", | |
39 "Inline controls should be hidden by timer"); | |
40 | |
41 // Move mouse to the fullscreen button and enter fullscreen. Leave the | |
42 // mouse hovering over the controls. | |
43 clickAtCoordinates(...inlineFullscreenButtonCoordinates); | |
44 }), video); | |
45 | |
46 video.onwebkitfullscreenchange = t.step_func(function() { | |
47 video.onwebkitfullscreenchange = null; | |
48 | |
49 assert_equals(document.webkitFullscreenElement, video, | |
50 "Should have entered fullscreen"); | |
51 | |
52 assert_equals(getComputedStyle(panel).opacity, "1", | |
53 "Fullscreen controls should show after entering " + | |
54 "fullscreen since mouse is hovering over controls"); | |
55 | |
56 // Get fullscreen button coordinates whilst it is visible. | |
57 var fullscreenFullscreenButtonCoordinates = | |
58 mediaControlsButtonCoordinates(video, "fullscreen-button"); | |
59 | |
60 // Move mouse away so it no longer hovers over controls/video. | |
61 chrome.gpuBenchmarking.pointerActionSequence([{ | |
62 source: 'mouse', actions: [{name: 'pointerMove', x: 0, y: 0}] | |
63 }]); | |
64 | |
65 runAfterHideMediaControlsTimerFired(t.step_func(function() { | |
66 assert_equals(getComputedStyle(panel).opacity, "0", | |
67 "Fullscreen controls should be hidden by timer"); | |
68 | |
69 // Move mouse to the fullscreen button and exit fullscreen. Leave the | |
70 // mouse hovering over the controls. | |
71 clickAtCoordinates(...fullscreenFullscreenButtonCoordinates); | |
72 }), video); | |
73 | |
74 video.onwebkitfullscreenchange = t.step_func(function() { | |
75 assert_equals(document.webkitFullscreenElement, null, | |
76 "Should have exited fullscreen"); | |
77 | |
78 assert_equals(getComputedStyle(panel).opacity, "1", | |
79 "Inline controls should show again after exiting " + | |
80 "fullscreen since mouse is hovering over controls"); | |
81 | |
82 t.done(); | |
83 }); | |
84 }); | |
85 }); | |
86 | |
87 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?
| |
88 }); | |
89 </script> | |
OLD | NEW |