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

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: Add virtual/new-remote-playback-pipeline variants to SlowTests 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 eventSender.mouseMoveTo(0, 0);
31
32 runAfterHideMediaControlsTimerFired(t.step_func(function() {
33 assert_equals(getComputedStyle(panel).opacity, "0",
34 "Inline controls should be hidden by timer");
35
36 // Enter fullscreen (without moving the mouse over the controls).
37 runWithKeyDown(function() { video.webkitRequestFullscreen(); });
38 }), video);
39
40 video.onwebkitfullscreenchange = t.step_func(function() {
41 video.onwebkitfullscreenchange = null;
42
43 assert_equals(document.webkitFullscreenElement, video,
44 "Should have entered fullscreen");
45
46 assert_equals(getComputedStyle(panel).opacity, "0",
47 "Fullscreen controls should not show after entering " +
48 "fullscreen since mouse is not hovering over controls");
49
50 setTimeout(t.step_func(function() {
51 // Exit fullscreen (without moving the mouse over the controls).
52 document.webkitExitFullscreen();
53 }), 0);
54
55 video.onwebkitfullscreenchange = t.step_func(function() {
56 assert_equals(document.webkitFullscreenElement, null,
57 "Should have exited fullscreen");
58
59 assert_equals(getComputedStyle(panel).opacity, "0",
60 "Inline controls should not show after exiting " +
61 "fullscreen since mouse is not hovering over controls");
62
63 t.done();
64 });
65 });
66 });
67
68 video.src = findMediaFile("video", "../content/test-25fps");
69 });
70 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698