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

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

Issue 170063006: Cast: Add JS API to get raw events logs from cast extension. (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/bad_logging.js
diff --git a/chrome/test/data/extensions/api_test/cast_streaming/basics.js b/chrome/test/data/extensions/api_test/cast_streaming/bad_logging.js
similarity index 74%
copy from chrome/test/data/extensions/api_test/cast_streaming/basics.js
copy to chrome/test/data/extensions/api_test/cast_streaming/bad_logging.js
index d6d0bf45aea6b08e8c7e9c2de1d4c93711464b15..3d36cfe9546a3e2816f64afedee06fc29175ff2a 100644
--- a/chrome/test/data/extensions/api_test/cast_streaming/basics.js
+++ b/chrome/test/data/extensions/api_test/cast_streaming/bad_logging.js
@@ -8,38 +8,10 @@ var udpTransport = chrome.cast.streaming.udpTransport;
var createSession = chrome.cast.streaming.session.create;
var pass = chrome.test.callbackPass;
-function TestStateMachine(stream, audioId, videoId, udpId) {
- this.stream = stream;
- this.audioId = audioId;
- this.videoId = videoId;
- this.udpId = udpId;
- this.audioStarted = false;
- this.videoStarted = false;
- this.audioStopped = false;
- this.videoStopped = false;
-}
-
-TestStateMachine.prototype.onStarted = function(id) {
- if (id == this.audioId)
- this.audioStarted = true;
- if (id == this.videoId)
- this.videoStarted = true;
- if (this.audioStarted && this.videoStarted)
- this.onAllStarted();
-}
-
-TestStateMachine.prototype.onStopped = function(id) {
- if (id == this.audioId)
- this.audioStopped = true;
- if (id == this.videoId)
- this.videoStopped = true;
- if (this.audioStopped && this.videoStopped)
- this.onAllStopped();
-}
-
chrome.test.runTests([
- function rtpStreamStart() {
- console.log("[TEST] rtpStreamStart");
+ function emptyLogWithLoggingDisabled() {
+
+ console.log("[TEST] emptyLogWithLoggingDisabled");
tabCapture.capture({audio: true, video: true},
pass(function(stream) {
console.log("Got MediaStream.");
@@ -54,6 +26,9 @@ chrome.test.runTests([
udpId);
var audioParams = rtpStream.getSupportedParams(audioId)[0];
var videoParams = rtpStream.getSupportedParams(videoId)[0];
+ var expectEmptyLogs = function(rawEvents) {
+ chrome.test.assertEq("", rawEvents);
+ }
chrome.test.assertEq(audioParams.payload.codecName, "OPUS");
chrome.test.assertEq(videoParams.payload.codecName, "VP8");
udpTransport.setDestination(udpId,
@@ -62,6 +37,12 @@ chrome.test.runTests([
stateMachine.onStarted.bind(stateMachine));
stateMachine.onAllStarted =
pass(function(audioId, videoId) {
+ console.log("Getting logs without enabling logging.");
+ rtpStream.getRawEvents(audioId, expectEmptyLogs);
+ rtpStream.getRawEvents(videoId, expectEmptyLogs);
+ console.log("Disabling logging that is already disabled.");
+ rtpStream.toggleLogging(audioId, false);
+ rtpStream.toggleLogging(videoId, false);
console.log("Stopping.");
rtpStream.stop(audioId);
rtpStream.stop(videoId);

Powered by Google App Engine
This is Rietveld 408576698