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

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

Issue 11038021: Implement Chrome Extension TabCapture API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Some tests, fixes Created 8 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 | Annotate | Revision Log
OLDNEW
(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 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698