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

Unified Diff: extensions/test/data/api_test/audio/test.js

Issue 2578473002: chrome.audio API: treat mute as system wide property (Closed)
Patch Set: . Created 3 years, 11 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
Index: extensions/test/data/api_test/audio/test.js
diff --git a/extensions/test/data/api_test/audio/test.js b/extensions/test/data/api_test/audio/test.js
index f79afa85b7cc6f14829ea09c20103d42b7eef670..14460e68c0220f0b0c0e1f62433002538ce76a18 100644
--- a/extensions/test/data/api_test/audio/test.js
+++ b/extensions/test/data/api_test/audio/test.js
@@ -161,11 +161,9 @@ chrome.test.runTests([
var updatedOutput = expectedOutput['30001'];
chrome.test.assertFalse(updatedOutput.isMuted);
chrome.test.assertFalse(updatedOutput.volume === 35);
- updatedOutput.isMuted = true;
updatedOutput.volume = 35;
chrome.audio.setProperties('30001', {
- isMuted: true,
volume: 35
}, chrome.test.callbackPass(function() {
chrome.audio.setProperties('40002', {
@@ -182,22 +180,51 @@ chrome.test.runTests([
});
},
+ function inputMuteTest() {
+ var getMute = function(callback) {
+ chrome.audio.getMute('INPUT', chrome.test.callbackPass(callback));
+ };
+ getMute(function(originalValue) {
+ chrome.audio.setMute('INPUT', !originalValue,
+ chrome.test.callbackPass(function() {
+ getMute(function(value) {
+ chrome.test.assertEq(!originalValue, value);
+ });
+ }));
+ });
+ },
+
+ function outputMuteTest() {
+ var getMute = function(callback) {
+ chrome.audio.getMute('OUTPUT', chrome.test.callbackPass(callback));
+ };
+ getMute(function(originalValue) {
+ chrome.audio.setMute('OUTPUT', !originalValue,
+ chrome.test.callbackPass(function() {
+ getMute(function(value) {
+ chrome.test.assertEq(!originalValue, value);
+ });
+ }));
+ });
+ },
+
function setPropertiesInvalidValuesTest() {
chrome.audio.getInfo(function(originalOutputInfo, originalInputInfo) {
chrome.test.assertNoLastError();
var expectedInput = deviceListToExpectedDevicesMap(originalInputInfo);
var expectedOutput = deviceListToExpectedDevicesMap(originalOutputInfo);
+ var expectedError = 'Could not set volume/gain properties';
chrome.audio.setProperties('30001', {
isMuted: true,
// Output device - should have volume set.
gain: 55
- }, chrome.test.callbackFail('Could not set properties', function() {
+ }, chrome.test.callbackFail(expectedError, function() {
chrome.audio.setProperties('40002', {
isMuted: true,
// Input device - should have gain set.
volume:55
- }, chrome.test.callbackFail('Could not set properties', function() {
+ }, chrome.test.callbackFail(expectedError, function() {
// Assert that device properties haven't changed.
chrome.audio.getInfo(
chrome.test.callbackPass(function(outputInfo, inputInfo) {

Powered by Google App Engine
This is Rietveld 408576698