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

Unified Diff: LayoutTests/media/effective-media-volume.html

Issue 444173002: Let the effective media volume be 0 if the media element is muted (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/html/HTMLMediaElement.h » ('j') | Source/web/WebMediaPlayerClientImpl.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | Source/core/html/HTMLMediaElement.h » ('j') | Source/web/WebMediaPlayerClientImpl.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698