Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-without-hovering-doesnt-show-controls.html

Issue 2873493004: [Media Controls] Prevent flicker when enter/exit fullscreen (Closed)
Patch Set: Use test-25fps.mp4 instead of counting.mp4 Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Tests that video controls are not shown when entering/exiting fullscreen
3 without hovering over the controls. Opposite of
4 video-enter-exit-fullscreen-while-hovering-shows-controls.html</title>
5 <script src="../../fullscreen/full-screen-test.js"></script>
6 <script src="../../resources/testharness.js"></script>
7 <script src="../../resources/testharnessreport.js"></script>
8 <script src="../media-file.js"></script>
9 <script src="../media-controls.js"></script>
10
11 <video controls></video>
12
13 <script>
14 async_test(function(t) {
15 var video = document.querySelector("video");
16
17 video.oncanplaythrough = t.step_func(function() {
18 video.oncanplaythrough = null;
19
20 var panel = mediaControlsButton(video, "panel");
21
22 // Move mouse to the play button and start playing the video.
23 clickAtCoordinates(...mediaControlsButtonCoordinates(video, "play-button"));
24
25 assert_equals(getComputedStyle(panel).opacity, "1",
26 "Inline controls should initially show since controls " +
27 "attribute is present");
28
29 // Move mouse away so it no longer hovers over controls/video.
30 chrome.gpuBenchmarking.pointerActionSequence([{
31 source: 'mouse', actions: [{name: 'pointerMove', x: 0, y: 0}]
32 }]);
33
34 runAfterHideMediaControlsTimerFired(t.step_func(function() {
35 assert_equals(getComputedStyle(panel).opacity, "0",
36 "Inline controls should be hidden by timer");
37
38 // Enter fullscreen (without moving the mouse over the controls).
39 runWithKeyDown(function() { video.webkitRequestFullscreen(); });
40 }), video);
41
42 video.onwebkitfullscreenchange = t.step_func(function() {
43 video.onwebkitfullscreenchange = null;
44
45 assert_equals(document.webkitFullscreenElement, video,
46 "Should have entered fullscreen");
47
48 assert_equals(getComputedStyle(panel).opacity, "0",
49 "Fullscreen controls should not show after entering " +
50 "fullscreen since mouse is not hovering over controls");
51
52 setTimeout(t.step_func(function() {
53 // Exit fullscreen (without moving the mouse over the controls).
54 document.webkitExitFullscreen();
55 }), 0);
56
57 video.onwebkitfullscreenchange = t.step_func(function() {
58 assert_equals(document.webkitFullscreenElement, null,
59 "Should have exited fullscreen");
60
61 assert_equals(getComputedStyle(panel).opacity, "0",
62 "Inline controls should not show after exiting " +
63 "fullscreen since mouse is not hovering over controls");
64
65 t.done();
66 });
67 });
68 });
69
70 video.src = findMediaFile("video", "../content/test-25fps");
71 });
72 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698