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 d6d0bf45aea6b08e8c7e9c2de1d4c93711464b15..003f0e0f5a908a6aeb8ea61d6e56e4c52d805c28 100644 |
--- a/chrome/test/data/extensions/api_test/cast_streaming/basics.js |
+++ b/chrome/test/data/extensions/api_test/cast_streaming/basics.js |
@@ -17,6 +17,8 @@ function TestStateMachine(stream, audioId, videoId, udpId) { |
this.videoStarted = false; |
this.audioStopped = false; |
this.videoStopped = false; |
+ this.gotAudioRawEvents = false; |
+ this.gotVideoRawEvents = false; |
} |
TestStateMachine.prototype.onStarted = function(id) { |
@@ -37,6 +39,17 @@ TestStateMachine.prototype.onStopped = function(id) { |
this.onAllStopped(); |
} |
+TestStateMachine.prototype.onGotRawEvents = function(id, rawEvents) { |
+ if (id == this.audioId) { |
+ this.gotAudioRawEvents = true; |
+ } |
+ if (id == this.videoId) { |
+ this.gotVideoRawEvents = true; |
+ } |
+ if (this.gotAudioRawEvents && this.gotVideoRawEvents) |
+ this.onGotAllRawEvents(); |
+} |
+ |
chrome.test.runTests([ |
function rtpStreamStart() { |
console.log("[TEST] rtpStreamStart"); |
@@ -62,6 +75,9 @@ chrome.test.runTests([ |
stateMachine.onStarted.bind(stateMachine)); |
stateMachine.onAllStarted = |
pass(function(audioId, videoId) { |
+ console.log("Starting logging."); |
+ rtpStream.startLogging(audioId); |
+ rtpStream.startLogging(videoId); |
console.log("Stopping."); |
rtpStream.stop(audioId); |
rtpStream.stop(videoId); |
@@ -69,6 +85,13 @@ chrome.test.runTests([ |
rtpStream.onStopped.addListener( |
stateMachine.onStopped.bind(stateMachine)); |
stateMachine.onAllStopped = |
+ pass(function(audioId, videoId) { |
+ rtpStream.getRawEvents(audioId, |
+ stateMachine.onGotRawEvents.bind(stateMachine, audioId)); |
+ rtpStream.getRawEvents(videoId, |
+ stateMachine.onGotRawEvents.bind(stateMachine, videoId)); |
+ }.bind(null, audioId, videoId)); |
+ stateMachine.onGotAllRawEvents = |
pass(function(stream, audioId, videoId, udpId) { |
console.log("Destroying."); |
rtpStream.destroy(audioId); |