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

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

Issue 184853003: Cast: Add GetStats() extensions API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: static cast to int Created 6 years, 9 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var rtpStream = chrome.cast.streaming.rtpStream; 5 var rtpStream = chrome.cast.streaming.rtpStream;
6 var tabCapture = chrome.tabCapture; 6 var tabCapture = chrome.tabCapture;
7 var udpTransport = chrome.cast.streaming.udpTransport; 7 var udpTransport = chrome.cast.streaming.udpTransport;
8 var createSession = chrome.cast.streaming.session.create; 8 var createSession = chrome.cast.streaming.session.create;
9 var pass = chrome.test.callbackPass; 9 var pass = chrome.test.callbackPass;
10 10
(...skipping 27 matching lines...) Expand all
38 rtpStream.toggleLogging(videoId, true); 38 rtpStream.toggleLogging(videoId, true);
39 console.log("Stopping."); 39 console.log("Stopping.");
40 rtpStream.stop(audioId); 40 rtpStream.stop(audioId);
41 rtpStream.stop(videoId); 41 rtpStream.stop(videoId);
42 }.bind(null, audioId, videoId)); 42 }.bind(null, audioId, videoId));
43 rtpStream.onStopped.addListener( 43 rtpStream.onStopped.addListener(
44 stateMachine.onStopped.bind(stateMachine)); 44 stateMachine.onStopped.bind(stateMachine));
45 stateMachine.onAllStopped = 45 stateMachine.onAllStopped =
46 pass(function(audioId, videoId) { 46 pass(function(audioId, videoId) {
47 rtpStream.getRawEvents(audioId, 47 rtpStream.getRawEvents(audioId,
48 stateMachine.onGotRawEvents.bind(stateMachine, audioId)); 48 stateMachine.onGotLogs.bind(stateMachine, audioId));
49 rtpStream.getRawEvents(videoId, 49 rtpStream.getRawEvents(videoId,
50 stateMachine.onGotRawEvents.bind(stateMachine, videoId)); 50 stateMachine.onGotLogs.bind(stateMachine, videoId));
51 }.bind(null, audioId, videoId)); 51 }.bind(null, audioId, videoId));
52 stateMachine.onGotAllRawEvents = 52 stateMachine.onGotAllLogs =
53 pass(function(stream, audioId, videoId, udpId) { 53 pass(function(stream, audioId, videoId, udpId) {
54 console.log("Disabling logging."); 54 console.log("Disabling logging.");
55 rtpStream.toggleLogging(audioId, false); 55 rtpStream.toggleLogging(audioId, false);
56 rtpStream.toggleLogging(videoId, false); 56 rtpStream.toggleLogging(videoId, false);
57 console.log("Destroying."); 57 console.log("Destroying.");
58 rtpStream.destroy(audioId); 58 rtpStream.destroy(audioId);
59 rtpStream.destroy(videoId); 59 rtpStream.destroy(videoId);
60 udpTransport.destroy(udpId); 60 udpTransport.destroy(udpId);
61 chrome.test.assertEq(audioParams.payload.codecName, "OPUS"); 61 chrome.test.assertEq(audioParams.payload.codecName, "OPUS");
62 chrome.test.assertEq(videoParams.payload.codecName, "VP8"); 62 chrome.test.assertEq(videoParams.payload.codecName, "VP8");
63 chrome.test.succeed(); 63 chrome.test.succeed();
64 }.bind(null, stream, audioId, videoId, udpId)); 64 }.bind(null, stream, audioId, videoId, udpId));
65 rtpStream.start(audioId, audioParams); 65 rtpStream.start(audioId, audioParams);
66 rtpStream.start(videoId, videoParams); 66 rtpStream.start(videoId, videoParams);
67 }.bind(null, stream))); 67 }.bind(null, stream)));
68 })); 68 }));
69 }, 69 },
70 ]); 70 ]);
OLDNEW
« no previous file with comments | « chrome/renderer/media/cast_session_delegate.cc ('k') | chrome/test/data/extensions/api_test/cast_streaming/common.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698