OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 var tabCapture = chrome.experimental.tabCapture; |
| 6 |
| 7 chrome.test.runTests([ |
| 8 |
| 9 function getTabMediaInvalidTab() { |
| 10 var tabMediaRequestCallback = function(stream) { |
| 11 chrome.test.assertTrue(stream == undefined); |
| 12 if (!chrome.extension.lastError) { |
| 13 chrome.test.fail(); |
| 14 } |
| 15 chrome.test.succeed(); |
| 16 }; |
| 17 |
| 18 tabCapture.getTabMedia(-1, {audio: true, video: true}, |
| 19 tabMediaRequestCallback); |
| 20 }, |
| 21 |
| 22 function getTabMedia() { |
| 23 var tabMediaRequestCallback = function(stream) { |
| 24 // TODO(justinlin): Does not get here yet due to requiring auth input. |
| 25 }; |
| 26 |
| 27 var gotTabId = function(tab) { |
| 28 console.log('using tab: ' + tab[0].id); |
| 29 tabCapture.getTabMedia(tab[0].id, {audio: true, video: true}, |
| 30 chrome.test.callbackPass(tabMediaRequestCallback)); |
| 31 }; |
| 32 |
| 33 chrome.tabs.query({active: true}, gotTabId); |
| 34 }, |
| 35 |
| 36 ]); |
OLD | NEW |