From: Pawel Kaczmarek
Date: Wed, 4 Feb 2015 13:42:44 +0000 (+0100)
Subject: [Sound] setVolume - TCT fix
X-Git-Tag: submit/tizen_tv/20150603.064601~1^2~482
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3aff8c8ccf9c8c0beb10c1b9c3fcc4f69411d4be;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git
[Sound] setVolume - TCT fix
[Verification]
tizen.sound.setVolume("SYSTEM", 3);
should throw invalid value exception
TCT 20/25
Change-Id: I0e6c0f5f59913b43c0ae263e70a3efdd474e148c
Signed-off-by: Pawel Kaczmarek
---
diff --git a/src/sound/sound_api.js b/src/sound/sound_api.js
index 0e2a6f34..b6a896ff 100644
--- a/src/sound/sound_api.js
+++ b/src/sound/sound_api.js
@@ -44,6 +44,9 @@ SoundManager.prototype.setVolume = function(type, volume) {
{name: 'volume', type: types_.DOUBLE}
]);
+ if (args.volume < 0 || args.volume > 1) {
+ throw new tizen.WebAPIException(tizen.WebAPIException.INVALID_VALUES_ERR);
+ }
var result = native_.callSync('SoundManager_setVolume', args);
if (native_.isFailure(result)) {
throw native_.getErrorObject(result);