OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <html> | 2 <title>This tests that controls do not fade out when the video is playing remote
ly.</title> |
3 <head> | 3 <script src="../resources/testharness.js"></script> |
4 <title>This tests that controls do not fade out when the video is playin
g remotely.</title> | 4 <script src="../resources/testharnessreport.js"></script> |
5 <script src="../resources/testharness.js"></script> | 5 <script src="media-file.js"></script> |
6 <script src="../resources/testharnessreport.js"></script> | 6 <script src="media-controls.js"></script> |
7 <script src="media-file.js"></script> | 7 <video controls loop></video> |
8 <script src="media-controls.js"></script> | 8 <script> |
9 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 9 async_test(function(t) |
10 (Please avoid writing new tests using video-test.js) --> | 10 { |
11 <script src="video-test.js"></script> | 11 var video = document.querySelector("video"); |
12 </head> | 12 video.src = findMediaFile("video", "content/test"); |
13 <body> | |
14 <video controls loop></video> | |
15 <script> | |
16 var controls; | |
17 var test; | |
18 | 13 |
19 function playing() | 14 video.onplaying = t.step_func(function() { |
| 15 internals.mediaPlayerPlayingRemotelyChanged(video, true); |
| 16 runAfterHideMediaControlsTimerFired(function() |
20 { | 17 { |
21 internals.mediaPlayerPlayingRemotelyChanged(video, true); | 18 var controls = mediaControlsButton(video, "panel"); |
| 19 assert_equals(getComputedStyle(controls).opacity, "1"); |
| 20 |
| 21 internals.mediaPlayerPlayingRemotelyChanged(video, false); |
22 runAfterHideMediaControlsTimerFired(function() | 22 runAfterHideMediaControlsTimerFired(function() |
23 { | 23 { |
24 controls = mediaControlsButton(video, "panel"); | 24 assert_equals(getComputedStyle(controls).opacity, "0"); |
25 testExpected("getComputedStyle(controls).opacity", 1); | 25 t.done(); |
| 26 }, video); |
| 27 }, video); |
| 28 }); |
26 | 29 |
27 consoleWrite(""); | 30 video.play(); |
28 | 31 }); |
29 internals.mediaPlayerPlayingRemotelyChanged(video, false); | 32 </script> |
30 runAfterHideMediaControlsTimerFired(function() | |
31 { | |
32 testExpected("getComputedStyle(controls).opacity", 0); | |
33 | |
34 consoleWrite(""); | |
35 | |
36 test.done(); | |
37 }, | |
38 video); | |
39 }, video); | |
40 } | |
41 | |
42 async_test(function(t) | |
43 { | |
44 test = t; | |
45 findMediaElement(); | |
46 video.src = findMediaFile("video", "content/test"); | |
47 video.addEventListener("playing", playing); | |
48 video.play(); | |
49 }); | |
50 </script> | |
51 </body> | |
52 </html> | |
OLD | NEW |