Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / tab_capture / constraints.js
blob9f652d5729171540f13bd9536566cdfc4991d6d8
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
3 // found in the LICENSE file.
5 chrome.test.runTests([
6 function supportsMediaConstraints() {
7 chrome.tabCapture.capture({
8 video: true,
9 audio: true,
10 videoConstraints: {
11 mandatory: {
12 maxWidth: 1000,
13 minWidth: 300
16 }, function(stream) {
17 chrome.test.assertTrue(!!stream);
18 stream.stop();
19 chrome.test.succeed();
20 });
23 function rejectsOptionalMediaConstraints() {
24 chrome.tabCapture.capture({
25 video: true,
26 audio: true,
27 videoConstraints: {
28 mandatory: {
30 optional: {
31 maxWidth: 1000,
32 minWidth: 300
35 }, function(stream) {
36 chrome.test.assertTrue(!stream);
37 chrome.test.succeed();
38 });
41 function rejectsInvalidConstraints() {
42 chrome.tabCapture.capture({
43 video: true,
44 audio: true,
45 videoConstraints: {
46 mandatory: {
47 notValid: '123'
50 }, function(stream) {
51 chrome.test.assertTrue(!stream);
53 chrome.tabCapture.capture({
54 audio: true,
55 audioConstraints: {
56 mandatory: {
57 notValid: '123'
60 }, function(stream) {
61 chrome.test.assertTrue(!stream);
62 chrome.test.succeed();
63 });
64 });
66 ]);