OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Test that hiding volume / mute button works as expected.</title> | 2 <title>Test that hiding volume / mute button works as expected.</title> |
3 <script src="../resources/testharness.js"></script> | 3 <script src="../resources/testharness.js"></script> |
4 <script src="../resources/testharnessreport.js"></script> | 4 <script src="../resources/testharnessreport.js"></script> |
5 <script src="media-controls.js"></script> | 5 <script src="media-controls.js"></script> |
6 <script src="media-file.js"></script> | 6 <script src="media-file.js"></script> |
7 <video controls></video> | 7 <video controls></video> |
8 <script> | 8 <script> |
9 async_test(function(t) { | 9 async_test(function(t) { |
10 var video = document.querySelector("video"); | 10 var video = document.querySelector("video"); |
11 | 11 |
12 video.oncanplaythrough = t.step_func_done(function() { | 12 video.oncanplaythrough = t.step_func_done(function() { |
13 // Enable hidden audio preferences to take effect. | |
14 internals.setAllowHiddenVolumeControls(video, true); | |
15 // Request non-hidden audio controls. | 13 // Request non-hidden audio controls. |
16 internals.settings.setPreferHiddenVolumeControls(false); | 14 internals.settings.setPreferHiddenVolumeControls(false); |
17 video.muted = false; | 15 video.muted = false; |
18 muteButton = mediaControlsButton(video, "mute-button"); | 16 muteButton = mediaControlsButton(video, "mute-button"); |
19 volumeSlider = mediaControlsButton(video, "volume-slider"); | 17 volumeSlider = mediaControlsButton(video, "volume-slider"); |
20 | 18 |
21 // Make sure that both are visible. | 19 // Make sure that both are visible. |
22 assert_not_equals(getComputedStyle(muteButton).display, "none"); | 20 assert_not_equals(getComputedStyle(muteButton).display, "none"); |
23 assert_not_equals(getComputedStyle(volumeSlider).display, "none"); | 21 assert_not_equals(getComputedStyle(volumeSlider).display, "none"); |
24 | 22 |
(...skipping 11 matching lines...) Expand all Loading... |
36 | 34 |
37 // For muted video, the volume slider will hide but the mute button | 35 // For muted video, the volume slider will hide but the mute button |
38 // should stay, since we always have it present for media which have aud
io. | 36 // should stay, since we always have it present for media which have aud
io. |
39 video.muted = true; | 37 video.muted = true; |
40 assert_not_equals(getComputedStyle(muteButton).display, "none"); | 38 assert_not_equals(getComputedStyle(muteButton).display, "none"); |
41 assert_equals(getComputedStyle(volumeSlider).display, "none"); | 39 assert_equals(getComputedStyle(volumeSlider).display, "none"); |
42 }); | 40 }); |
43 | 41 |
44 video.src = findMediaFile("video", "content/test"); | 42 video.src = findMediaFile("video", "content/test"); |
45 }) | 43 }) |
46 </script> | 44 </script> |
OLD | NEW |