OLD | NEW |
1 <html> | 1 <!DOCTYPE html> |
2 <head> | 2 <title>Test "controls" on transformed video.</title> |
3 <title>Test controls on transformed video</title> | 3 <script src="../resources/testharness.js"></script> |
4 <style type="text/css" media="screen"> | 4 <script src="../resources/testharnessreport.js"></script> |
5 video { | 5 <script src="media-file.js"></script> |
6 margin: 50px; | 6 <script src="media-controls.js"></script> |
7 transform: rotate(20deg); | 7 <style> |
8 } | 8 video { |
9 </style> | 9 margin: 50px; |
10 </head> | 10 transform: rotate(20deg); |
11 <body> | 11 } |
12 <video controls></video> | 12 </style> |
13 <p>Test controls on transformed video.</p> | 13 <video controls></video> |
14 <p>This test only runs in DRT!</p> | 14 <script> |
15 <script src=media-file.js></script> | 15 async_test(function(t) { |
16 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 16 var video = document.querySelector("video"); |
17 (Please avoid writing new tests using video-test.js) --> | 17 assert_true(video.controls); |
18 <script src=video-test.js></script> | 18 |
19 <script src=media-controls.js></script> | 19 video.oncanplaythrough = t.step_func_done(function() { |
20 <script> | 20 // Find the play button and click the middle of its bounding box. |
21 testExpected("video.controls", null, '!='); | 21 var playCoords = mediaControlsButtonCoordinates(video, "play-button"); |
22 waitForEvent('canplaythrough', function () { | 22 eventSender.mouseMoveTo(playCoords[0], playCoords[1]); |
23 if (window.eventSender) { | 23 eventSender.mouseDown(); |
24 // Find the play button and click the middle of its bounding box
. | 24 eventSender.mouseUp(); |
25 var playCoords; | 25 assert_false(video.paused); |
26 try { | 26 }); |
27 playCoords = mediaControlsButtonCoordinates(video, "play-but
ton"); | 27 |
28 } catch (exception) { | 28 video.src = findMediaFile("video", "content/test"); |
29 failTest(exception.description); | 29 }); |
30 return; | 30 </script> |
31 } | |
32 var clickX = playCoords[0]; | |
33 var clickY = playCoords[1]; | |
34 eventSender.mouseMoveTo(clickX, clickY); | |
35 eventSender.mouseDown(); | |
36 eventSender.mouseUp(); | |
37 } | |
38 testExpected("video.paused", false); | |
39 endTest(); | |
40 } ); | |
41 video.src = findMediaFile("video", "content/test"); | |
42 </script> | |
43 </body> | |
44 </html> | |
OLD | NEW |