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 var video = document.querySelector("video"); |
11 <script src="video-test.js"></script> | 11 video.src = findMediaFile("video", "content/test"); |
12 </head> | |
13 <body> | |
14 <video controls loop></video> | |
15 <script> | |
16 var controls; | |
17 var test; | |
18 | 12 |
19 function playing() | 13 video.onplaying = t.step_func(function() { |
20 { | 14 internals.mediaPlayerPlayingRemotelyChanged(video, true); |
21 internals.mediaPlayerPlayingRemotelyChanged(video, true); | 15 runAfterHideMediaControlsTimerFired(function() { |
22 runAfterHideMediaControlsTimerFired(function() | 16 var controls = mediaControlsButton(video, "panel"); |
23 { | 17 assert_equals(getComputedStyle(controls).opacity, "1"); |
24 controls = mediaControlsButton(video, "panel"); | |
25 testExpected("getComputedStyle(controls).opacity", 1); | |
26 | 18 |
27 consoleWrite(""); | 19 internals.mediaPlayerPlayingRemotelyChanged(video, false); |
| 20 runAfterHideMediaControlsTimerFired(function() { |
| 21 assert_equals(getComputedStyle(controls).opacity, "0"); |
| 22 t.done(); |
| 23 }, video); |
| 24 }, video); |
| 25 }); |
28 | 26 |
29 internals.mediaPlayerPlayingRemotelyChanged(video, false); | 27 video.play(); |
30 runAfterHideMediaControlsTimerFired(function() | 28 }); |
31 { | 29 </script> |
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 |