| OLD | NEW |
| 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.getVideoTracks()[0].stop(); |
| 19 stream.getAudioTracks()[0].stop(); |
| 19 chrome.test.succeed(); | 20 chrome.test.succeed(); |
| 20 }); | 21 }); |
| 21 }, | 22 }, |
| 22 | 23 |
| 23 function rejectsOptionalMediaConstraints() { | 24 function rejectsOptionalMediaConstraints() { |
| 24 chrome.tabCapture.capture({ | 25 chrome.tabCapture.capture({ |
| 25 video: true, | 26 video: true, |
| 26 audio: true, | 27 audio: true, |
| 27 videoConstraints: { | 28 videoConstraints: { |
| 28 mandatory: { | 29 mandatory: { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 57 notValid: '123' | 58 notValid: '123' |
| 58 } | 59 } |
| 59 } | 60 } |
| 60 }, function(stream) { | 61 }, function(stream) { |
| 61 chrome.test.assertTrue(!stream); | 62 chrome.test.assertTrue(!stream); |
| 62 chrome.test.succeed(); | 63 chrome.test.succeed(); |
| 63 }); | 64 }); |
| 64 }); | 65 }); |
| 65 } | 66 } |
| 66 ]); | 67 ]); |
| OLD | NEW |