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

Side by Side Diff: chrome/test/data/extensions/api_test/tab_capture/constraints.js

Issue 734853003: Misc clean-up of TabCaptureApiTests; and re-enable more tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 supportsMediaConstraints() { 6 function supportsMediaConstraints() {
7 chrome.tabCapture.capture({ 7 chrome.tabCapture.capture({
8 video: true, 8 video: true,
9 audio: true, 9 audio: true,
10 videoConstraints: { 10 videoConstraints: {
11 mandatory: { 11 mandatory: {
12 maxWidth: 1000, 12 maxWidth: 1000,
13 minWidth: 300 13 minWidth: 300
14 } 14 }
15 } 15 }
16 }, function(stream) { 16 }, function(stream) {
17 chrome.test.assertTrue(!!stream); 17 chrome.test.assertTrue(!!stream);
18 stream.stop(); 18 stream.stop();
19 chrome.test.succeed(); 19 chrome.test.succeed();
20 }); 20 });
21 }, 21 },
22 22
23 function supportsOptionalMediaConstraints() { 23 function rejectsOptionalMediaConstraints() {
24 chrome.tabCapture.capture({ 24 chrome.tabCapture.capture({
25 video: true, 25 video: true,
26 audio: true, 26 audio: true,
27 videoConstraints: { 27 videoConstraints: {
28 mandatory: { 28 mandatory: {
29 }, 29 },
30 optional: { 30 optional: {
31 maxWidth: 1000, 31 maxWidth: 1000,
32 minWidth: 300 32 minWidth: 300
33 } 33 }
34 } 34 }
35 }, function(stream) { 35 }, function(stream) {
36 chrome.test.assertTrue(!stream); 36 chrome.test.assertTrue(!stream);
37 chrome.test.succeed(); 37 chrome.test.succeed();
38 }); 38 });
39 },
40
41 function rejectsInvalidConstraints() {
42 chrome.tabCapture.capture({
43 video: true,
44 audio: true,
45 videoConstraints: {
46 mandatory: {
47 notValid: '123'
48 }
49 }
50 }, function(stream) {
51 chrome.test.assertTrue(!stream);
52
53 chrome.tabCapture.capture({
miu 2014/11/19 01:15:54 This is the second test from api_tests_audio.js, w
54 audio: true,
55 audioConstraints: {
56 mandatory: {
57 notValid: '123'
58 }
59 }
60 }, function(stream) {
61 chrome.test.assertTrue(!stream);
62 chrome.test.succeed();
63 });
64 });
39 } 65 }
40 ]); 66 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698