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

Side by Side Diff: chrome/test/data/webrtc/media_devices.js

Issue 341123005: Disable getMediaDevices tests. Revert to use getSources instead for getUserMedia tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review + rebase. Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 /** 1 /**
2 * Copyright 2014 The Chromium Authors. All rights reserved. 2 * Copyright 2014 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /** 7 /**
8 * Queries for media devices on the current system using the getMediaDevices 8 * Queries for media devices on the current system using the getMediaDevices
9 * API. 9 * API.
10 * 10 *
(...skipping 11 matching lines...) Expand all
22 * Returns the list of sources available. 22 * Returns the list of sources available.
23 */ 23 */
24 function getSources() { 24 function getSources() {
25 MediaStreamTrack.getSources(function(sources) { 25 MediaStreamTrack.getSources(function(sources) {
26 returnToTest(JSON.stringify(sources)); 26 returnToTest(JSON.stringify(sources));
27 }); 27 });
28 } 28 }
29 29
30 /** 30 /**
31 * Queries for video input devices on the current system using the 31 * Queries for video input devices on the current system using the
32 * getMediaDevices API. 32 * getSources API.
33 * 33 *
34 * This does not guarantee that a getUserMedia with video will succeed, as the 34 * This does not guarantee that a getUserMedia with video will succeed, as the
35 * camera could be busy for instance. 35 * camera could be busy for instance.
36 * 36 *
37 * Returns has-video-input-device to the test if there is a webcam available, 37 * Returns has-video-input-device to the test if there is a webcam available,
38 * no-video-input-devices otherwise. 38 * no-video-input-devices otherwise.
39 */ 39 */
40 function hasVideoInputDeviceOnSystem() { 40 function hasVideoInputDeviceOnSystem() {
41 navigator.getMediaDevices(function(devices) { 41 MediaStreamTrack.getSources(function(devices) {
42 var hasVideoInputDevice = false; 42 var hasVideoInputDevice = false;
43 devices.forEach(function(device) { 43 devices.forEach(function(device) {
44 if (device.kind == 'videoinput') 44 if (device.kind == 'video')
45 hasVideoInputDevice = true; 45 hasVideoInputDevice = true;
46 }); 46 });
47 47
48 if (hasVideoInputDevice) 48 if (hasVideoInputDevice)
49 returnToTest('has-video-input-device'); 49 returnToTest('has-video-input-device');
50 else 50 else
51 returnToTest('no-video-input-devices'); 51 returnToTest('no-video-input-devices');
52 }); 52 });
53 } 53 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698