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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/cast_streaming/null_stream.js
diff --git a/chrome/test/data/extensions/api_test/cast_streaming/null_stream.js b/chrome/test/data/extensions/api_test/cast_streaming/null_stream.js
new file mode 100644
index 0000000000000000000000000000000000000000..7974954ebd05e5259c3e25ab70d05ac7d5ea308c
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/cast_streaming/null_stream.js
@@ -0,0 +1,59 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var rtpStream = chrome.cast.streaming.rtpStream;
+var tabCapture = chrome.tabCapture;
+var udpTransport = chrome.cast.streaming.udpTransport;
+var createSession = chrome.cast.streaming.session.create;
+var pass = chrome.test.callbackPass;
+
+chrome.test.runTests([
+ function noVideo() {
+ console.log("[TEST] noVideo");
+ chrome.tabs.create({"url": "about:blank"}, pass(function(tab) {
+ tabCapture.capture({audio: true, video: false},
+ pass(function(stream) {
+ chrome.test.assertTrue(!!stream);
+ createSession(stream.getAudioTracks()[0],
+ null,
+ pass(function(stream, audioId, videoId, udpId) {
+ chrome.test.assertTrue(audioId > 0);
+ chrome.test.assertTrue(videoId == null);
+ chrome.test.assertTrue(udpId > 0);
+ rtpStream.destroy(audioId);
+ udpTransport.destroy(udpId);
+ }.bind(null, stream)));
+ }));
+ }));
+ },
+ function noAudio() {
+ console.log("[TEST] noAudio");
+ chrome.tabs.create({"url": "about:blank"}, pass(function(tab) {
+ tabCapture.capture({audio: false, video: true},
+ pass(function(stream) {
+ chrome.test.assertTrue(!!stream);
+ createSession(null,
+ stream.getVideoTracks()[0],
+ pass(function(stream, audioId, videoId, udpId) {
+ chrome.test.assertTrue(audioId == null);
+ chrome.test.assertTrue(videoId > 0);
+ chrome.test.assertTrue(udpId > 0);
+ rtpStream.destroy(videoId);
+ udpTransport.destroy(udpId);
+ }.bind(null, stream)));
+ }));
+ }));
+ },
+ function noStream() {
+ console.log("[TEST] noAudio");
+ chrome.tabs.create({"url": "about:blank"}, pass(function(tab) {
+ try {
+ createSession(null, null, function(a, b, c) {});
+ chrome.test.fail();
+ } catch (e) {
+ // Success.
+ }
+ }));
+ },
+]);
« 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