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

Side by Side Diff: content/test/data/media/webrtc_test_utilities.js

Issue 663793003: Relanding WebRTC real webcam browsertest for Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 2 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // These must match with how the video and canvas tags are declared in html. 5 // These must match with how the video and canvas tags are declared in html.
6 const VIDEO_TAG_WIDTH = 320; 6 const VIDEO_TAG_WIDTH = 320;
7 const VIDEO_TAG_HEIGHT = 240; 7 const VIDEO_TAG_HEIGHT = 240;
8 8
9 // Fake video capture background green is of value 135. 9 // Fake video capture background green is of value 135.
10 const COLOR_BACKGROUND_GREEN = 135; 10 const COLOR_BACKGROUND_GREEN = 135;
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 failTest("expected '" + expected + "', got '" + actual + "'."); 206 failTest("expected '" + expected + "', got '" + actual + "'.");
207 } 207 }
208 } 208 }
209 209
210 function assertNotEquals(expected, actual) { 210 function assertNotEquals(expected, actual) {
211 if (actual === expected) { 211 if (actual === expected) {
212 failTest("expected '" + expected + "', got '" + actual + "'."); 212 failTest("expected '" + expected + "', got '" + actual + "'.");
213 } 213 }
214 } 214 }
215 215
216 // Returns has-video-input-device to the test if there's a webcam available on
217 // the system.
218 function hasVideoInputDeviceOnSystem() {
219 MediaStreamTrack.getSources(function(devices) {
220 var hasVideoInputDevice = false;
221 devices.forEach(function(device) {
222 if (device.kind == 'video')
223 hasVideoInputDevice = true;
224 });
225
226 if (hasVideoInputDevice)
227 sendValueToTest('has-video-input-device');
228 else
229 sendValueToTest('no-video-input-devices');
230 });
231 }
OLDNEW
« no previous file with comments | « content/test/data/media/getusermedia-real-webcam.html ('k') | content/test/webrtc_content_browsertest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698