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

Side by Side Diff: chrome/test/data/extensions/api_test/cast_streaming/null_stream.js

Issue 391263002: Cast: cast.streaming API to support null audio (or video) track (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: idl compiler Created 6 years, 5 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 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.
4
5 var rtpStream = chrome.cast.streaming.rtpStream;
6 var tabCapture = chrome.tabCapture;
7 var udpTransport = chrome.cast.streaming.udpTransport;
8 var createSession = chrome.cast.streaming.session.create;
9 var pass = chrome.test.callbackPass;
10
11 chrome.test.runTests([
12 function noVideo() {
13 console.log("[TEST] noVideo");
14 chrome.tabs.create({"url": "about:blank"}, pass(function(tab) {
15 tabCapture.capture({audio: true, video: false},
16 pass(function(stream) {
17 chrome.test.assertTrue(!!stream);
18 createSession(stream.getAudioTracks()[0],
19 null,
20 pass(function(stream, audioId, videoId, udpId) {
21 chrome.test.assertTrue(audioId > 0);
22 chrome.test.assertTrue(videoId == null);
23 chrome.test.assertTrue(udpId > 0);
24 rtpStream.destroy(audioId);
25 udpTransport.destroy(udpId);
26 }.bind(null, stream)));
27 }));
28 }));
29 },
30 function noAudio() {
31 console.log("[TEST] noAudio");
32 chrome.tabs.create({"url": "about:blank"}, pass(function(tab) {
33 tabCapture.capture({audio: false, video: true},
34 pass(function(stream) {
35 chrome.test.assertTrue(!!stream);
36 createSession(null,
37 stream.getVideoTracks()[0],
38 pass(function(stream, audioId, videoId, udpId) {
39 chrome.test.assertTrue(audioId == null);
40 chrome.test.assertTrue(videoId > 0);
41 chrome.test.assertTrue(udpId > 0);
42 rtpStream.destroy(videoId);
43 udpTransport.destroy(udpId);
44 }.bind(null, stream)));
45 }));
46 }));
47 },
48 function noStream() {
49 console.log("[TEST] noAudio");
50 chrome.tabs.create({"url": "about:blank"}, pass(function(tab) {
51 try {
52 createSession(null, null, function(a, b, c) {});
53 chrome.test.fail();
54 } catch (e) {
55 // Success.
56 }
57 }));
58 },
59 ]);
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/cast_streaming/null_stream.html ('k') | tools/json_schema_compiler/idl_schema.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698