| 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)));
|
| + }));
|
| },
|
| ]);
|
|
|