зеркало из https://github.com/mozilla/gecko-dev.git
Bug 454683 - "Media element setVolume should fail on invalid values" [r+sr=roc]
This commit is contained in:
Родитель
a449fb980a
Коммит
65ae6febc5
|
@ -390,6 +390,9 @@ NS_IMETHODIMP nsHTMLMediaElement::GetVolume(float *aVolume)
|
|||
|
||||
NS_IMETHODIMP nsHTMLMediaElement::SetVolume(float aVolume)
|
||||
{
|
||||
if (aVolume < 0.0f || aVolume > 1.0f)
|
||||
return NS_ERROR_DOM_INDEX_SIZE_ERR;
|
||||
|
||||
if (mMuted)
|
||||
mMutedVolume = aVolume;
|
||||
else {
|
||||
|
|
|
@ -53,6 +53,7 @@ _TEST_FILES = test_autoplay.html \
|
|||
test_playbackRate.html \
|
||||
test_readyState.html \
|
||||
test_start.html \
|
||||
test_volume.html \
|
||||
# test_bug448534.html \
|
||||
320x240.ogg \
|
||||
$(NULL)
|
||||
|
|
|
@ -17,7 +17,7 @@ function test(element, value, shouldThrow) {
|
|||
var threw = false;
|
||||
try {
|
||||
element.volume = value;
|
||||
} catch (err if err == "NS_ERROR_DOM_INDEX_SIZE_ERR") {
|
||||
} catch (err if err.name == "NS_ERROR_DOM_INDEX_SIZE_ERR") {
|
||||
threw = true;
|
||||
}
|
||||
is(shouldThrow, threw, "Case: " +element.id+ " setVolume=" + value);
|
||||
|
|
Загрузка…
Ссылка в новой задаче