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

Unified Diff: chrome/test/data/extensions/api_test/cast_streaming/basics.js

Issue 121543003: Set AES key and IV mask to CastSender (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 7 years 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
« no previous file with comments | « chrome/renderer/media/cast_rtp_stream.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/cast_streaming/basics.js
diff --git a/chrome/test/data/extensions/api_test/cast_streaming/basics.js b/chrome/test/data/extensions/api_test/cast_streaming/basics.js
index 73b04ae7bb9bb6b8f099b03fff189fc972075be9..bc8c4302281b7a4b8a4d236a7c90c142aadbb4fd 100644
--- a/chrome/test/data/extensions/api_test/cast_streaming/basics.js
+++ b/chrome/test/data/extensions/api_test/cast_streaming/basics.js
@@ -6,22 +6,25 @@ 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 rtpStreamStart() {
- tabCapture.capture({audio: true, video: true}, function(stream) {
+ console.log("[TEST] rtpStreamStart");
+ tabCapture.capture({audio: true, video: true},
+ pass(function(stream) {
console.log("Got MediaStream.");
chrome.test.assertTrue(!!stream);
createSession(stream.getAudioTracks()[0],
stream.getVideoTracks()[0],
- function(stream, audioId, videoId, udpId) {
+ pass(function(stream, audioId, videoId, udpId) {
console.log("Starting.");
var audioParams = rtpStream.getCaps(audioId);
var videoParams = rtpStream.getCaps(videoId);
rtpStream.start(audioId, audioParams);
rtpStream.start(videoId, videoParams);
udpTransport.start(udpId, {address: "127.0.0.1", port: 2344});
- window.setTimeout(function() {
+ window.setTimeout(pass(function() {
console.log("Stopping.");
rtpStream.stop(audioId);
rtpStream.stop(videoId);
@@ -32,8 +35,34 @@ chrome.test.runTests([
chrome.test.assertEq(audioParams.payloads[0].codecName, "OPUS");
chrome.test.assertEq(videoParams.payloads[0].codecName, "VP8");
chrome.test.succeed();
- }, 0);
- }.bind(null, stream));
- });
+ }), 0);
+ }.bind(null, stream)));
+ }));
+ },
+ function invalidKey() {
+ console.log("[TEST] invalidKey");
+ tabCapture.capture({audio: true, video: true},
+ pass(function(stream) {
+ chrome.test.assertTrue(!!stream);
+ createSession(stream.getAudioTracks()[0],
+ stream.getVideoTracks()[0],
+ pass(function(stream, audioId, videoId, udpId) {
+ // AES key is invalid and exception is expected.
+ try {
+ var audioParams = rtpStream.getCaps(audioId);
+ var videoParams = rtpStream.getCaps(videoId);
+ audioParams.payloads[0].aesKey = "google";
+ videoParams.payloads[0].aesIvMask = "chrome";
+ rtpStream.start(audioId, audioParams);
+ rtpStream.start(videoId, videoParams);
+ } catch (e) {
+ rtpStream.destroy(audioId);
+ rtpStream.destroy(videoId);
+ udpTransport.destroy(udpId);
+ stream.stop();
+ chrome.test.succeed();
+ }
+ }.bind(null, stream)));
+ }));
},
]);
« no previous file with comments | « chrome/renderer/media/cast_rtp_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698