OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <title>effective media volume</title> | |
3 <script src="../resources/testharness.js"></script> | |
4 <script src="../resources/testharnessreport.js"></script> | |
5 <div id="log"></div> | |
6 <script> | |
7 [0, 0.5, 1].forEach(function(volume) | |
acolwell GONE FROM CHROMIUM
2014/08/07 15:52:58
ooo.. fancy. :)
| |
8 { | |
9 [false, true].forEach(function(muted) | |
10 { | |
11 test(function() | |
12 { | |
13 var audio = new Audio(); | |
14 audio.volume = volume; | |
15 audio.muted = muted; | |
16 assert_equals(internals.effectiveMediaVolume(audio), | |
17 volume * (muted ? 0 : 1)); | |
18 }, "volume: " + volume + ", muted: " + muted); | |
19 | |
20 [0, 0.5, 1].forEach(function(controllerVolume) | |
21 { | |
22 [false, true].forEach(function(controllerMuted) | |
23 { | |
24 test(function() | |
25 { | |
26 var audio = new Audio(); | |
27 audio.volume = volume; | |
28 audio.muted = muted; | |
29 var controller = new MediaController(); | |
30 controller.volume = controllerVolume; | |
31 controller.muted = controllerMuted; | |
32 audio.controller = controller; | |
33 assert_equals(internals.effectiveMediaVolume(audio), | |
34 volume * (muted ? 0 : 1) * controllerVolume * (controllerMuted ? 0 : 1)); | |
35 }, "volume: " + volume + ", muted: " + muted + ", controller vol ume: " + controllerVolume + ", controller muted: " + controllerMuted); | |
36 }); | |
37 }); | |
38 }); | |
39 }); | |
40 </script> | |
OLD | NEW |