| OLD | NEW |
| 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.test.runTests([ | 5 chrome.test.runTests([ |
| 6 function waitForDeviceChangedEventTests() { | 6 function waitForDeviceChangedEventTests() { |
| 7 chrome.test.listenOnce(chrome.audio.OnDevicesChanged, function(devices) { | 7 chrome.test.listenOnce(chrome.audio.OnDevicesChanged, function(devices) { |
| 8 var deviceList = devices.map(function(device) { | 8 var deviceList = devices.map(function(device) { |
| 9 return { | 9 return { |
| 10 id: device.id, | 10 id: device.id, |
| 11 stableDeviceId: device.stableDeviceId, | 11 stableDeviceId: device.stableDeviceId, |
| 12 isInput: device.isInput, | 12 isInput: device.isInput, |
| 13 deviceType: device.deviceType, | 13 deviceType: device.deviceType, |
| 14 deviceName: device.deviceName, | 14 deviceName: device.deviceName, |
| 15 displayName: device.displayName | 15 displayName: device.displayName |
| 16 }; | 16 }; |
| 17 }).sort(function(lhs, rhs) { | 17 }).sort(function(lhs, rhs) { |
| 18 return Number.parseInt(lhs.id) - Number.parseInt(rhs.id); | 18 return Number.parseInt(lhs.id) - Number.parseInt(rhs.id); |
| 19 }); | 19 }); |
| 20 | 20 |
| 21 chrome.test.assertEq([{ | 21 chrome.test.assertEq([{ |
| 22 id: '30001', | 22 id: '30001', |
| 23 stableDeviceId: '80001', | 23 stableDeviceId: '116606' /* 80001 ^ 0xFFFF */, |
| 24 isInput: false, | 24 isInput: false, |
| 25 deviceType: 'USB', | 25 deviceType: 'USB', |
| 26 deviceName: 'Jabra Speaker', | 26 deviceName: 'Jabra Speaker', |
| 27 displayName: 'Jabra Speaker 1' | 27 displayName: 'Jabra Speaker 1' |
| 28 }, { | 28 }, { |
| 29 id: '30002', | 29 id: '30002', |
| 30 stableDeviceId: '80002', | 30 stableDeviceId: '116605' /* 80002 ^ 0xFFFF */, |
| 31 isInput: false, | 31 isInput: false, |
| 32 deviceType: 'USB', | 32 deviceType: 'USB', |
| 33 deviceName: 'Jabra Speaker', | 33 deviceName: 'Jabra Speaker', |
| 34 displayName: 'Jabra Speaker 2' | 34 displayName: 'Jabra Speaker 2' |
| 35 }, { | 35 }, { |
| 36 id: '30003', | 36 id: '30003', |
| 37 stableDeviceId: '80003', | 37 stableDeviceId: '116604' /* 80003 ^ 0xFFFF */, |
| 38 isInput: false, | 38 isInput: false, |
| 39 deviceType: 'HDMI', | 39 deviceType: 'HDMI', |
| 40 deviceName: 'HDMI output', | 40 deviceName: 'HDMI output', |
| 41 displayName: 'HDA Intel MID' | 41 displayName: 'HDA Intel MID' |
| 42 }], deviceList); | 42 }], deviceList); |
| 43 }); | 43 }); |
| 44 } | 44 } |
| 45 ]); | 45 ]); |
| 46 | 46 |
| 47 chrome.test.sendMessage('loaded'); | 47 chrome.test.sendMessage('loaded'); |
| OLD | NEW |