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

Side by Side Diff: third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch.html

Issue 2118453002: Convert video-controls-visibility* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nits 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <title>Test video controls visibility with multimodal input. The controls should remain visible if the last input event was a mouse move over them.</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 loop></video>
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 { 13 assert_true(video.paused);
19 video = document.getElementById("no-video-media");
20 14
21 testExpected("video.paused", true); 15 // Tap (touch input) the play button.
22 if (!window.testRunner) 16 var coords = mediaControlsButtonCoordinates(video, "play-button");
23 return; 17 eventSender.gestureTapDown(coords[0], coords[1]);
18 eventSender.gestureShowPress(coords[0], coords[1]);
19 eventSender.gestureTap(coords[0], coords[1]);
20 assert_false(video.paused);
24 21
25 // Tap (touch input) the play button. 22 // And then hover the control with the mouse.
26 var coords = mediaControlsButtonCoordinates(video, "play-button"); 23 eventSender.mouseMoveTo(coords[0], coords[1]);
27 eventSender.gestureTapDown(coords[0], coords[1]);
28 eventSender.gestureShowPress(coords[0], coords[1]);
29 eventSender.gestureTap(coords[0], coords[1]);
30 testExpected("video.paused", false);
31 24
32 // And then hover the control with the mouse. 25 // And the controls should remain visible.
33 eventSender.mouseMoveTo(coords[0], coords[1]); 26 runAfterHideMediaControlsTimerFired(t.step_func_done(function() {
27 var controls = mediaControlsButton(video, "panel");
28 assert_equals(getComputedStyle(controls).opacity, "1");
29 }), video);
30 });
34 31
35 // And the controls should remain visible. 32 video.src = findMediaFile("video", "content/test");
36 runAfterHideMediaControlsTimerFired(function() 33 });
37 { 34 </script>
38 controls = mediaControlsButton(video, "panel");
39 testExpected("getComputedStyle(controls).opacity", 1);
40 endTest();
41 }, video);
42 }
43 </script>
44 <body>
45 <p>Test video element control visibility with multimodal input. The controls
46 should remain visible if the last input event was a mouse move over them. </p>
47 <p>This test only runs in DRT!</p>
48
49 <video id="no-video-media" controls loop oncanplaythrough="runTest()"></vide o>
50 <script>
51 setSrcById("no-video-media", findMediaFile("video", "content/test"));
52 </script>
53 </body>
54 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698