Index: LayoutTests/media/effective-media-volume.html |
diff --git a/LayoutTests/media/effective-media-volume.html b/LayoutTests/media/effective-media-volume.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..48cfe22da67554d57cb563e02da968f1f5cc4ece |
--- /dev/null |
+++ b/LayoutTests/media/effective-media-volume.html |
@@ -0,0 +1,40 @@ |
+<!DOCTYPE html> |
+<title>effective media volume</title> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<div id="log"></div> |
+<script> |
+[0, 0.5, 1].forEach(function(volume) |
acolwell GONE FROM CHROMIUM
2014/08/07 15:52:58
ooo.. fancy. :)
|
+{ |
+ [false, true].forEach(function(muted) |
+ { |
+ test(function() |
+ { |
+ var audio = new Audio(); |
+ audio.volume = volume; |
+ audio.muted = muted; |
+ assert_equals(internals.effectiveMediaVolume(audio), |
+ volume * (muted ? 0 : 1)); |
+ }, "volume: " + volume + ", muted: " + muted); |
+ |
+ [0, 0.5, 1].forEach(function(controllerVolume) |
+ { |
+ [false, true].forEach(function(controllerMuted) |
+ { |
+ test(function() |
+ { |
+ var audio = new Audio(); |
+ audio.volume = volume; |
+ audio.muted = muted; |
+ var controller = new MediaController(); |
+ controller.volume = controllerVolume; |
+ controller.muted = controllerMuted; |
+ audio.controller = controller; |
+ assert_equals(internals.effectiveMediaVolume(audio), |
+ volume * (muted ? 0 : 1) * controllerVolume * (controllerMuted ? 0 : 1)); |
+ }, "volume: " + volume + ", muted: " + muted + ", controller volume: " + controllerVolume + ", controller muted: " + controllerMuted); |
+ }); |
+ }); |
+ }); |
+}); |
+</script> |