OLD | NEW |
---|---|
(Empty) | |
1 <!doctype html> | |
2 <html> | |
3 <head> | |
4 <title>media controls cast button</title> | |
5 <script src="../resources/testharness.js"></script> | |
6 <script src="../resources/testharnessreport.js"></script> | |
7 <script src="media-file.js"></script> | |
8 <script src="media-controls.js"></script> | |
9 <script src="video-test.js"></script> | |
10 </head> | |
11 <body> | |
12 <video controls></video> | |
13 <script> | |
14 findMediaElement(); | |
acolwell GONE FROM CHROMIUM
2014/08/05 19:36:34
I'm pretty sure you need to put this code inside a
aberent
2014/08/22 14:08:33
Done.
| |
15 video.src = findMediaFile("video", "content/test"); | |
16 waitForEventAndEnd("loadedmetadata", function() | |
17 { | |
18 // Should not have a cast button by default | |
19 button = mediaControlsButton(video, "cast-button"); | |
20 assert_equals(button.style.display, "none", "button should not b e visible with no cast devices"); | |
21 | |
22 // Pretend we have a cast device | |
23 internals.mediaPlayerRemoteRouteAvailabilityChanged(video, true) ; | |
24 | |
25 // Now should have cast button | |
26 assert_false(("display" in button.style) && (button.style.displa y == "none"), "button should exist"); | |
27 dimensions = mediaControlsButtonDimensions(video, "cast-button") ; | |
28 assert_not_equals(dimensions[0], 0, "button should exist"); | |
29 assert_not_equals(dimensions[1], 0, "button should exist"); | |
30 | |
31 // Check its position is to the right of the timeline | |
32 // (can't test against volume control or closed caption button, since these don't always exist) | |
33 position = mediaControlsButtonCoordinates(video, "cast-button"); | |
34 timelinePosition = mediaControlsButtonCoordinates(video, "timeli ne"); | |
35 assert_greater_than(position[0], timelinePosition[0], "button sh ould be to right of timeline"); | |
36 | |
37 // Check that we don't have an overlay cast button | |
38 overlayButton = mediaControlsButton(video, "overlay-cast-button" ); | |
39 assert_equals(overlayButton.style.display, "none", "Overlay butt on should not be visible with controls"); | |
40 | |
41 // And to the left of the fullscreen button | |
42 fullscreenPosition = mediaControlsButtonCoordinates(video, "full screen-button"); | |
43 assert_less_than(position[0], fullscreenPosition[0], "button sho uld be to left of fullscreen button"); | |
44 | |
45 // Remove cast device - cast button should go away | |
46 internals.mediaPlayerRemoteRouteAvailabilityChanged(video, false ); | |
47 assert_equals(button.style.display, "none", "button should not b e visible after cast device goes away"); | |
48 }); | |
49 </script> | |
50 </body> | |
51 </html> | |
52 | |
OLD | NEW |