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

Side by Side Diff: third_party/WebKit/LayoutTests/media/video-controls-always-visible-when-control-hovered.html

Issue 2108993003: Convert video-controls* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <title>Verify that media controls are always visible when hovered.</title>
3 <style> 3 <script src="../resources/testharness.js"></script>
4 #no-video-media { 4 <script src="../resources/testharnessreport.js"></script>
5 width: 320px; 5 <script src="media-file.js"></script>
6 height: 240px; 6 <script src="media-controls.js"></script>
7 } 7 <video controls></video>
fs 2016/06/29 21:15:01 I think the reason this had 'loop', was to avoid e
Srirama 2016/06/30 09:34:27 Done. The video duration is 6sec and controls time
8 </style>
9 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
10 (Please avoid writing new tests using video-test.js) -->
11 <script src=video-test.js></script>
12 <script src=media-file.js></script>
13 <script src=media-controls.js></script>
14 <script> 8 <script>
15 var controls; 9 async_test(function(t) {
10 var video = document.querySelector("video");
16 11
17 function runTest() 12 video.oncanplaythrough = t.step_func(function() {
18 {
19 video = document.getElementById("no-video-media");
20 13
21 testExpected("video.paused", true); 14 assert_true(video.paused);
22 if (!window.testRunner)
23 return;
24 15
25 // Click the play button. 16 // Click the play button.
26 var playCoords = mediaControlsButtonCoordinates(video, "play-button"); 17 var playCoords = mediaControlsButtonCoordinates(video, "play-button");
27 var clickX = playCoords[0]; 18 eventSender.mouseMoveTo(playCoords[0], playCoords[1]);
28 var clickY = playCoords[1]; 19 eventSender.mouseDown();
29 eventSender.mouseMoveTo(clickX, clickY); 20 eventSender.mouseUp();
30 eventSender.mouseDown(); 21 assert_false(video.paused);
31 eventSender.mouseUp();
32 testExpected("video.paused", false);
33 22
34 runAfterHideMediaControlsTimerFired(function() 23 runAfterHideMediaControlsTimerFired(t.step_func_done(function() {
35 { 24 var controls = mediaControlsButton(video, "panel");
36 controls = mediaControlsButton(video, "panel"); 25 assert_equals(getComputedStyle(controls).opacity, "1");
37 testExpected("getComputedStyle(controls).opacity", 1); 26 }), video);
27 });
38 28
39 consoleWrite(""); 29 video.src = findMediaFile("video", "content/test");
40 endTest(); 30 });
41 }, video); 31 </script>
42 }
43 </script>
44 <body>
45 <p>Test video element control visibility after click on control. After the c lick
46 the mouse does not move, so the control is still hovered and it should
47 remain visible.</p>
48 <p>This test only runs in DRT!</p>
49
50 <video id="no-video-media" controls loop oncanplaythrough="runTest()"></vide o>
51 <script>
52 setSrcById("no-video-media", findMediaFile("video", "content/test"));
53 </script>
54 </body>
55 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698