| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 function TestStateMachine(stream, audioId, videoId, udpId) { | 5 function TestStateMachine(stream, audioId, videoId, udpId) { |
| 6 this.stream = stream; | 6 this.stream = stream; |
| 7 this.audioId = audioId; | 7 this.audioId = audioId; |
| 8 this.videoId = videoId; | 8 this.videoId = videoId; |
| 9 this.udpId = udpId; | 9 this.udpId = udpId; |
| 10 this.audioStarted = false; | 10 this.audioStarted = false; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 TestStateMachine.prototype.onStopped = function(id) { | 27 TestStateMachine.prototype.onStopped = function(id) { |
| 28 if (id == this.audioId) | 28 if (id == this.audioId) |
| 29 this.audioStopped = true; | 29 this.audioStopped = true; |
| 30 if (id == this.videoId) | 30 if (id == this.videoId) |
| 31 this.videoStopped = true; | 31 this.videoStopped = true; |
| 32 if (this.audioStopped && this.videoStopped) | 32 if (this.audioStopped && this.videoStopped) |
| 33 this.onAllStopped(); | 33 this.onAllStopped(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 TestStateMachine.prototype.onGotLogs = function(id, data) { | 36 TestStateMachine.prototype.onGotLogs = function(id) { |
| 37 chrome.test.assertTrue(!!data); | |
| 38 if (id == this.audioId) | 37 if (id == this.audioId) |
| 39 this.gotAudioLogs = true; | 38 this.gotAudioLogs = true; |
| 40 if (id == this.videoId) | 39 if (id == this.videoId) |
| 41 this.gotVideoLogs = true; | 40 this.gotVideoLogs = true; |
| 42 if (this.gotAudioLogs && this.gotVideoLogs) | 41 if (this.gotAudioLogs && this.gotVideoLogs) |
| 43 this.onGotAllLogs(); | 42 this.onGotAllLogs(); |
| 44 } | 43 } |
| 45 | 44 |
| 45 TestStateMachine.prototype.onGotRawEvents = function(id, data) { |
| 46 chrome.test.assertTrue(data.byteLength > 0); |
| 47 this.onGotLogs(id); |
| 48 } |
| 49 TestStateMachine.prototype.onGotStats = function(id, data) { |
| 50 chrome.test.assertTrue(!!data); |
| 51 this.onGotLogs(id); |
| 52 } |
| 53 |
| OLD | NEW |