OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>effective media volume</title> | 2 <title>effective media volume</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 <div id="log"></div> | |
6 <script> | 5 <script> |
7 [0, 0.5, 1].forEach(function(volume) | 6 [0, 0.5, 1].forEach(function(volume) |
8 { | 7 { |
9 [false, true].forEach(function(muted) | 8 [false, true].forEach(function(muted) |
10 { | 9 { |
11 test(function() | 10 test(function() |
12 { | 11 { |
13 var audio = new Audio(); | 12 var audio = new Audio(); |
14 audio.volume = volume; | 13 audio.volume = volume; |
15 audio.muted = muted; | 14 audio.muted = muted; |
16 assert_equals(internals.effectiveMediaVolume(audio), | 15 assert_equals(internals.effectiveMediaVolume(audio), |
17 volume * (muted ? 0 : 1)); | 16 volume * (muted ? 0 : 1)); |
18 }, "volume: " + volume + ", muted: " + muted); | 17 }, "volume: " + volume + ", muted: " + muted); |
19 }); | 18 }); |
20 }); | 19 }); |
21 </script> | 20 </script> |
OLD | NEW |