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

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

Issue 184853003: Cast: Add GetStats() extensions API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/cast_streaming/common.js
diff --git a/chrome/test/data/extensions/api_test/cast_streaming/common.js b/chrome/test/data/extensions/api_test/cast_streaming/common.js
index 36b6aec8287b2bb4ca13248486bc3366400b0bea..5c61bfae1edfcac53d1a1efeccf9b0ad15064fe7 100644
--- a/chrome/test/data/extensions/api_test/cast_streaming/common.js
+++ b/chrome/test/data/extensions/api_test/cast_streaming/common.js
@@ -13,6 +13,8 @@ function TestStateMachine(stream, audioId, videoId, udpId) {
this.videoStopped = false;
this.gotAudioRawEvents = false;
this.gotVideoRawEvents = false;
+ this.gotAudioStats = false;
+ this.gotVideoStats = false;
}
TestStateMachine.prototype.onStarted = function(id) {
@@ -33,15 +35,23 @@ TestStateMachine.prototype.onStopped = function(id) {
this.onAllStopped();
}
-TestStateMachine.prototype.onGotRawEvents = function(id, rawEvents) {
- chrome.test.assertTrue(rawEvents.length > 0);
+TestStateMachine.prototype.onGotLogs = function(id, isStats, data) {
+ chrome.test.assertTrue(data.length > 0);
if (id == this.audioId) {
- this.gotAudioRawEvents = true;
+ if (isStats)
+ this.gotAudioStats = true;
+ else
+ this.gotAudioRawEvents = true;
}
if (id == this.videoId) {
- this.gotVideoRawEvents = true;
+ if (isStats)
+ this.gotVideoStats = true;
+ else
+ this.gotVideoRawEvents = true;
+ }
+ if (this.gotAudioRawEvents && this.gotVideoRawEvents &&
+ this.gotAudioStats && this.gotVideoStats) {
+ this.onGotAllLogs();
}
- if (this.gotAudioRawEvents && this.gotVideoRawEvents)
- this.onGotAllRawEvents();
}

Powered by Google App Engine
This is Rietveld 408576698