Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Side by Side Diff: LayoutTests/media/video-controls-hidden-audio.html

Issue 1303553003: Enable mute button, even if preferring hidden volume slider. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fixed test... which is why we have them. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/media/video-controls-hidden-audio-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <video controls></video> 1 <video controls></video>
2 <p>Test that hiding volume / mute buttons works as expected.</p> 2 <p>Test that hiding volume / mute buttons works as expected.</p>
3 <script src=media-file.js></script> 3 <script src=media-file.js></script>
4 <script src=video-test.js></script> 4 <script src=video-test.js></script>
5 <script src=media-controls.js></script> 5 <script src=media-controls.js></script>
6 <script> 6 <script>
7 video.src = findMediaFile("video", "content/test"); 7 video.src = findMediaFile("video", "content/test");
8 run("video.load()"); 8 run("video.load()");
9 waitForEvent("canplaythrough", function () { 9 waitForEvent("canplaythrough", function () {
10 // Enable hidden audio preferences to take effect. 10 // Enable hidden audio preferences to take effect.
11 run("window.internals.setAllowHiddenVolumeControls(video, true)"); 11 run("window.internals.setAllowHiddenVolumeControls(video, true)");
12 // Request non-hidden audio. 12 // Request non-hidden audio controls.
13 run("window.internals.settings.setPreferHiddenVolumeControls(false)"); 13 run("window.internals.settings.setPreferHiddenVolumeControls(false)");
14 run("video.muted = false"); 14 run("video.muted = false");
15 muteButton = mediaControlsButton(video, "mute-button"); 15 muteButton = mediaControlsButton(video, "mute-button");
16 volumeSlider = mediaControlsButton(video, "volume-slider"); 16 volumeSlider = mediaControlsButton(video, "volume-slider");
17 17
18 // Make sure that both are visible. 18 // Make sure that both are visible.
19 testExpected("getComputedStyle(muteButton).display", "none", '!='); 19 testExpected("getComputedStyle(muteButton).display", "none", '!=');
20 testExpected("getComputedStyle(volumeSlider).display", "none", '!='); 20 testExpected("getComputedStyle(volumeSlider).display", "none", '!=');
21 21
22 // Switch to muted video. Both should still be visible. We then 22 // Switch to muted video. Both should still be visible.
23 // remind it that we'd like to allow hidden audio preferences, since
24 // that also resets some state.
25 run("video.muted = true"); 23 run("video.muted = true");
26 run("window.internals.setAllowHiddenVolumeControls(video, true)");
27 testExpected("getComputedStyle(muteButton).display", "none", '!='); 24 testExpected("getComputedStyle(muteButton).display", "none", '!=');
28 testExpected("getComputedStyle(volumeSlider).display", "none", '!='); 25 testExpected("getComputedStyle(volumeSlider).display", "none", '!=');
29 26
30 run("window.internals.settings.setPreferHiddenVolumeControls(true)"); 27 run("window.internals.settings.setPreferHiddenVolumeControls(true)");
31 28
32 // Switch back to unmuted video. 29 // Switch back to unmuted video.
33 run("video.muted = false"); 30 run("video.muted = false");
34 run("window.internals.setAllowHiddenVolumeControls(video, true)");
35 31
36 testExpected("getComputedStyle(muteButton).display", "none", '=='); 32 testExpected("getComputedStyle(muteButton).display", "none", '!=');
37 testExpected("getComputedStyle(volumeSlider).display", "none", '=='); 33 testExpected("getComputedStyle(volumeSlider).display", "none", '==');
38 34
39 // For muted video, the volume slider will hide but the mute 35 // For muted video, the volume slider will hide but the mute
40 // button should come back, to let the user unmute. 36 // button should stay, since we always have it present for media
37 // which have audio.
41 run("video.muted = true"); 38 run("video.muted = true");
42 run("window.internals.setAllowHiddenVolumeControls(video, true)");
43 testExpected("getComputedStyle(muteButton).display", "none", '!='); 39 testExpected("getComputedStyle(muteButton).display", "none", '!=');
44 testExpected("getComputedStyle(volumeSlider).display", "none", '=='); 40 testExpected("getComputedStyle(volumeSlider).display", "none", '==');
45 41
46 endTest(); 42 endTest();
47 }); 43 });
48 </script> 44 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/media/video-controls-hidden-audio-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698