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

Side by Side Diff: extensions/test/data/api_test/audio/add_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
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 === 3) { 6 if (devices.length === 3) {
7 if (devices[0].id != "30001" || 7 if (devices[0].id != "30001" ||
8 devices[0].stableDeviceId != "80001" ||
8 devices[0].isInput != false || 9 devices[0].isInput != false ||
9 devices[0].deviceType != "USB" || 10 devices[0].deviceType != "USB" ||
10 devices[0].deviceName != "Jabra Speaker" || 11 devices[0].deviceName != "Jabra Speaker" ||
11 devices[0].displayName != "Jabra Speaker 1") { 12 devices[0].displayName != "Jabra Speaker 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 != "30002" || 17 if (devices[1].id != "30002" ||
18 devices[1].stableDeviceId != "80002" ||
17 devices[1].isInput != false || 19 devices[1].isInput != false ||
18 devices[1].deviceType != "USB" || 20 devices[1].deviceType != "USB" ||
19 devices[1].deviceName != "Jabra Speaker" || 21 devices[1].deviceName != "Jabra Speaker" ||
20 devices[1].displayName != "Jabra Speaker 2") { 22 devices[1].displayName != "Jabra Speaker 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 if (devices[2].id != "30003" || 27 if (devices[2].id != "30003" ||
28 devices[2].stableDeviceId != "80003" ||
26 devices[2].isInput != false || 29 devices[2].isInput != false ||
27 devices[2].deviceType != "HDMI" || 30 devices[2].deviceType != "HDMI" ||
28 devices[2].deviceName != "HDMI output" || 31 devices[2].deviceName != "HDMI output" ||
29 devices[2].displayName != "HDA Intel MID") { 32 devices[2].displayName != "HDA Intel MID") {
30 console.error("Got wrong device property for device:" + 33 console.error("Got wrong device property for device:" +
31 JSON.stringify(devices[2])); 34 JSON.stringify(devices[2]));
32 chrome.test.sendMessage("failure"); 35 chrome.test.sendMessage("failure");
33 } 36 }
34 chrome.test.sendMessage("success"); 37 chrome.test.sendMessage("success");
35 } else { 38 } else {
36 console.error("Got unexpected OnNodesChanged event failed"); 39 console.error("Got unexpected OnNodesChanged event failed");
37 chrome.test.sendMessage("failure"); 40 chrome.test.sendMessage("failure");
38 } 41 }
39 }); 42 });
40 chrome.test.sendMessage("loaded"); 43 chrome.test.sendMessage("loaded");
OLDNEW
« no previous file with comments | « extensions/browser/api/audio/audio_service_chromeos.cc ('k') | extensions/test/data/api_test/audio/remove_nodes/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698