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

Side by Side Diff: extensions/test/data/api_test/audio/remove_nodes/background.js

Issue 1584613003: Expose stable_device_id in audio extension apis. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « extensions/test/data/api_test/audio/add_nodes/background.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 chrome.audio.OnDevicesChanged.addListener(function (devices) { 5 chrome.audio.OnDevicesChanged.addListener(function (devices) {
6 if (devices.length === 2) { 6 if (devices.length === 2) {
7 if (devices[0].id != "40001" || 7 if (devices[0].id != "40001" ||
8 devices[0].stableDeviceId != "90001" ||
8 devices[0].isInput != true || 9 devices[0].isInput != true ||
9 devices[0].deviceType != "USB" || 10 devices[0].deviceType != "USB" ||
10 devices[0].deviceName != "Jabra Mic" || 11 devices[0].deviceName != "Jabra Mic" ||
11 devices[0].displayName != "Jabra Mic 1") { 12 devices[0].displayName != "Jabra Mic 1") {
12 console.error("Got wrong device property for device:" + 13 console.error("Got wrong device property for device:" +
13 JSON.stringify(devices[0])); 14 JSON.stringify(devices[0]));
14 chrome.test.sendMessage("failure"); 15 chrome.test.sendMessage("failure");
15 } 16 }
16 if (devices[1].id != "40002" || 17 if (devices[1].id != "40002" ||
18 devices[1].stableDeviceId != "90002" ||
17 devices[1].isInput != true || 19 devices[1].isInput != true ||
18 devices[1].deviceType != "USB" || 20 devices[1].deviceType != "USB" ||
19 devices[1].deviceName != "Jabra Mic" || 21 devices[1].deviceName != "Jabra Mic" ||
20 devices[1].displayName != "Jabra Mic 2") { 22 devices[1].displayName != "Jabra Mic 2") {
21 console.error("Got wrong device property for device:" + 23 console.error("Got wrong device property for device:" +
22 JSON.stringify(devices[1])); 24 JSON.stringify(devices[1]));
23 chrome.test.sendMessage("failure"); 25 chrome.test.sendMessage("failure");
24 } 26 }
25 chrome.test.sendMessage("success"); 27 chrome.test.sendMessage("success");
26 } else { 28 } else {
27 console.error("Got unexpected OnNodesChanged event failed"); 29 console.error("Got unexpected OnNodesChanged event failed");
28 chrome.test.sendMessage("failure"); 30 chrome.test.sendMessage("failure");
29 } 31 }
30 }); 32 });
31 chrome.test.sendMessage("loaded"); 33 chrome.test.sendMessage("loaded");
OLDNEW
« no previous file with comments | « extensions/test/data/api_test/audio/add_nodes/background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698